Repository navigation
Write the panel row's posture once for each press on a menu row - #6126
Merged
Merged
Conversation
… row Pressing a row in the leaf's menu puts the menu away, which paints the empty row, and then runs the row's command, which may paint again. When `z` showed a resolved thread in the panel, the first paint showed the On Me mark and the second hid it, in the same task, and the write watch failed `test_z_names_what_it_takes_and_how_long_ago_in_a_fresh_tab` on every main and nightly run (#4745). Folding from the menu flipped the leaf's error dot the same way, which #5263 answered by sending the Fold row around `putAwayThen`. `putAwayThen` now keeps the leaf's dots and count and the quick seat as they were while the press runs (Lit's `noChange`), then paints once, so they change once per press. The Fold row's bypass goes; Fold takes the same path as every other row. Rejected: drawing the put-away and the command's view as one transition, by deferring the put-away's paint to the command's own. The command then ran with the menu still drawn, and Align from the menu on touch left the page unscrolled; an undo whose thread view opens a microtask after the press, and a refused copy, gained new unchanged-write findings. What the user sees is unchanged: `leaf-dev probe --base` sampling each frame after pressing Undo, Fold and Copy link shows the same frames on both. Closes #4745 > _This was written by Claude Code on behalf of max-sixty_
The first commit held only the leaf's dots and the quick seat. With a page draft in the field, Undo from the menu still wrote `data-lf-drafted` and put it back in one press, since the draft posture follows the field's occupant (the menu's search, then the page editor, then the thread's reply). `paintNow` now writes the row's posture attributes (writing, draft, offer, press) through one gate with the marks, so the row's posture is one unit a press holds; which editor or search stands in the field stays live, since a command may open and focus it. Also reword two comments the hold made stale: the page-search reason for keeping `search` out of `quickHidden`, and the fold test's docstring. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
approved these changes
Nov 16, 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.
Pressing a row in the leaf's menu puts the menu away, which paints the empty row, and then runs the row's command, which may paint again. When
zshows a resolved thread in the panel, the first paint showed the On Me mark and the second hid it, in one task, so the write watch failedtest_z_names_what_it_takes_and_how_long_ago_in_a_fresh_tabon every main and nightly run. With a page draft in the field,data-lf-draftedflipped the same way.putAwayThennow holds the row's posture while the press runs: the parts of the row that follow the field and the view over it (the host's writing, draft, offer and press attributes, the leaf's dots and count, and the quick seat). It then paints once, so each is written once per press. The Fold row's bypass from #5263, which avoided the same paint flipping the leaf's error dot, is removed, and Fold goes throughputAwayThenlike every other row.Why not one transition, as the issue proposed. I tried deferring the put-away's paint into the command's own transition. The command then ran with the menu still drawn: Align from the menu on touch left the page unscrolled (
test_the_menu_keeps_its_place_when_a_revision_shortens_the_words_it_held), and two other menu tests gained new unchanged-write findings. Commands need the panel the put-away drew, so only the posture waits. #4760 and #5335 fixed a different cause, a focus move after a paint changing the writing posture, and those fixes stand.What it leaves. The hold ends when the command returns. A view a command opens after an
await, as Undo does for a resolved thread anchored below the fold, still repaints the posture, as on main; the watch doesn't report that case, since the two writes reach it in separate batches. Pressing Search page from the menu's search still hides and re-shows the field's editors, search surface and mode chip in one press, on main as here: the field's occupant goes search, page editor, search, and the command needs that search drawn, so the hold leaves it.Checks.
leaf-dev probe --base, sampling each frame for 800 ms after pressing Undo, Undo over a page draft, Fold with an error pending, and Copy link, shows the same frames on base and head; base writes the quick seat'shiddentwice in the Undo press anddata-lf-draftedtwice in the draft case, head neither. The failing test, the Fold test (which fails with the oldputAwayThenand no bypass) and 29 other focused tests onputAwayThen's callers pass, as doespnpm run check.Closes #4745