Repository navigation
Draw the floating panel once for a Go-to press, a fold, and a view change without motion - #7358
Merged
Merged
Conversation
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
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.
leaf-agent
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
lf-chrome-preference. Its one listener painted the new rest beside the old route, and every caller of the setter already paints.transition()asksmotionPlays()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-kselections 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.