Repository navigation
fix: key the leaf menu's rows so a row it gains or loses moves the others - #6260
Merged
Merged
Conversation
…hers The menu drew its rows as an unkeyed array. When a row came or went while the menu was drawn, Lit rewrote each later position with its neighbour's row, removing and recreating equal buttons and the rule, and moving the copy shortcut's element out and back. The write watch reports that as an unchanged write to div.lf-fp-menu's children. Keying the rows by their seat key moves rows instead. Closes #6259
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.
The leaf's menu drew its rows as an unkeyed array (
rootTemplateinbrowser/runtime/floating-panel.js). When the menu gained or lost a row while it was drawn, Lit wrote each later row into its neighbour's old position. It removed and recreated equal buttons and the<hr>rule, and moved the copy shortcut's persistentwa-copy-buttonout and back. The write watch reports that churn asunchanged write: children of div.lf-fp-menu. The rows are now keyed by their seat key throughrepeat, so a row that comes or goes moves the rows around it and leaves them otherwise untouched. A user hits the same path whenever the menu's rows change while it is open, so the fix is in the menu's render, not in the test.Since #6230,
open_threads/open_panel_threadreach Threads through the leaf, which opens this menu. That is whytest_a_reply_notice_survives_a_failed_state_and_keeps_its_agentbegan failing at teardown. It failed in both throttled runs (--cpu-throttle 4) on main and passed in 3 of 3 throttled runs with this change. A single paint (paintNow→ Lit) made the whole write, which I confirmed by recording the stacks of the menu's DOM writes during a failing run. Twelve menu tests intest_render_floating_panel.py,pnpm run test:runtimeandpnpm run check:browserpass.Closes #6259 — automated triage