fix(editor): the drawing stays clear of the strip while the page scrolls
The drawing column (chips, tools, canvas, add row, message line) is pinned under the strip from 1 024 px wide and 644 px high; the canvas box is capped in width by the window height (4:3 kept, unchanged at the three sizes); pinned controls carry no strip margin. The rev 4 test workarounds go; the row-click scroll was Playwright's bring-into-view.
This commit is contained in:
1 parent
da04c79d13
commit
36ed9f980b
7 files changed
+286
-31
No files matched your search
@@ -20,7 +20,6 @@ import {
|
||||
reloadAccepting,
|
||||
revisionText,
|
||||
saveLine,
|
||||
scrollToTop,
|
||||
seedDraft,
|
||||
selectionTag,
|
||||
selectTab,
|
||||
@@ -141,18 +140,6 @@ async function expectDeselected(page: Page) {
|
||||
await expect(overview(page)).toBeVisible()
|
||||
}
|
||||
|
||||
/** The client point hits the canvas box, not the sticky strip or bar over it. */
|
||||
async function expectOnDrawing(page: Page, at: { x: number; y: number }) {
|
||||
const hit = await page.evaluate(
|
||||
({ x, y }) =>
|
||||
document
|
||||
.elementFromPoint(x, y)
|
||||
?.closest('[data-testid="annotation-canvas"]') != null,
|
||||
at,
|
||||
)
|
||||
expect(hit, `${at.x}, ${at.y} lands on the drawing`).toBe(true)
|
||||
}
|
||||
|
||||
/** A negative check: the state is still there after two animation frames. */
|
||||
async function expectKept(page: Page, name: string) {
|
||||
await frames(page)
|
||||
@@ -305,9 +292,6 @@ test.describe('deselect and D6b (editor, mouse and keyboard)', () => {
|
||||
requests.forbid(actor.account.email, actor.account.password)
|
||||
await select(page, POINT)
|
||||
for (const at of [IN_CIRCLE, IN_RECT, IN_ROOT]) {
|
||||
// The row click scrolled the page: the drawing's top band is under the sticky strip.
|
||||
await scrollToTop(page)
|
||||
await expectOnDrawing(page, await clientOf(page, at.x, at.y))
|
||||
await clickAt(page, at)
|
||||
await expectDeselected(page)
|
||||
await select(page, POINT)
|
||||
@@ -640,11 +624,9 @@ test.describe('deselect and D6b (touch, editor at 1 280 px)', () => {
|
||||
|
||||
// b. Empty drawing, a zone about 40 px below the tap.
|
||||
await select(page, POINT)
|
||||
await scrollToTop(page)
|
||||
await takeRecord(page)
|
||||
const top = await clientOf(page, 175, 100)
|
||||
const above = { x: top.x, y: top.y - 40 }
|
||||
await expectOnDrawing(page, above)
|
||||
expect(await annotationUnder(page, above)).toBeNull()
|
||||
await tap(cdp, above)
|
||||
await expectDeselected(page)
|
||||
|
||||
Reference in new issue
Block a user