Skip to content

Draw the floating panel once for a Go-to press, a fold, and a view change without motion - #7358

Merged
max-sixty merged 2 commits into
mainfrom
go-to-hints-leaf-controls
Nov 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
go-to-hints-leaf-controls

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

A Go-to press of a panel tab, a fold with a list open, and a view change under reduced motion each drew the floating panel more than once in one task, the earlier draws in states no frame showed. On the Menu tab that hid and showed the field's mode span, which the write watch fails. Three changes, one per path:

  • The field's writing-posture listener requests a Lit update instead of painting, so the click that follows Go-to's focus takes the update over.
  • The rest preference's setter no longer dispatches lf-chrome-preference. Its one listener painted the new rest beside the old route, and every caller of the setter already paints.
  • transition() asks motionPlays() before its paint, so a view change without motion draws once.

A thread's rewrite hold still paints inside the focus move, because a later listener in the same move measures the held view.

Panel draws per input, main → this branch: Go-to → Menu, 5 → 4 over the next 300 ms; fold with On Me open, 3 → 2 in its task (4 → 2 with reduced motion); the Menu tab with reduced motion, 3 → 2.

To weigh: the posture now draws at the end of the script that moved focus, so code that focuses a panel control and reads the row's posture in the same script would see the old one. Codex's review found no such reader.

Max asked for this as an open item on the Go-to hints page after #7332 landed. Tests: pnpm run test:runtime, pnpm run check:browser, and -k selections of the Go-to, floating-panel, rewrite, key-scope, On-panel, sending, obligation-walk and threads browser tests. The Go-to test of the panel's own controls takes the Menu route again, and failed 3 of 3 runs without the fix.

This was written by Claude Code on behalf of max-sixty

Go-to's press focuses its target and then clicks it, so pointer and keyboard stay one behavior. Each step painted the floating panel synchronously: the focus move through the panel's location listener, then the click through the tab's transition. Taking a Go-to chip onto the Menu tab therefore drew the panel twice in one task, the first time in a state no frame showed (Go-to ended, the menu's search not begun), so the field's mode span hid and showed again and the write watch failed any test that took that route. Measured on a page with Threads open, a Go-to press of the Menu or Threads tab drew the panel 5 times over the next 300 ms before this change and 4 after.

The panel's two location listeners (the field's writing posture and a thread's rewrite hold) now request a Lit update rather than painting at once. The update runs once the moving script ends, still before the next frame, and a synchronous paint later in the same script takes it over, so the press draws once. A focus move with nothing after it draws as before.

The Go-to test of the panel's own controls takes the Menu route again, once the chips show, so the field's mode span says Go to before the press. The write watch failed it on 3 of 3 runs before this change and passes it on 3 of 3 after.
leaf-agent
leaf-agent previously approved these changes Nov 27, 2026
…ge once

Codex's review of the previous commit found that deferring the rewrite listener's paint left the thread view at its old height while a later listener in the same focus move measured it. Returning focus from a rewrite to a page control just above the held view folded the panel to the leaf, and reopening a saved 24-line rewrite measured 668 px before the 168 px hold landed. That listener paints at once again; only the field's writing posture waits for Lit's update, since nothing later in the move measures it.

The same review found two more draws of states no frame shows. The rest preference's setter dispatched lf-chrome-preference, whose one listener painted the new rest beside the old route before the fold cleared it; every caller of the setter already paints or runs a transition, so the event and its listener go. transition() painted the leaving view and then, where motion doesn't play, painted again without it; it now asks motionPlays() before its paint, as dom/motion.js says a caller keeping an old view drawn only while it fades should, and draws once.

Counted as the panel host's updates in the task of each input on alert-review, main against this branch: folding with On Me open drew 3 times before and 2 after (4 and 2 with reduced motion), and pressing the Menu tab with reduced motion drew 3 times before and 2 after.
@max-sixty max-sixty changed the title Draw the panel once for a press that moves focus and then clicks Draw the floating panel once for a Go-to press, a fold, and a view change without motion Nov 27, 2026
@max-sixty
max-sixty merged commit 35c97f7 into main Nov 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the go-to-hints-leaf-controls branch November 27, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants