Repository navigation
Offer a notice's Undo only while ⌘Z would take its gesture - #6844
Merged
Merged
Conversation
A Resolve that leaves no thread open says "All threads resolved · Undo ⌘Z". If the user picks an option while that notice stands, ⌘Z then takes back the pick, yet the notice still showed Undo ⌘Z, and a click on it took back the Resolve: the key the press showed did something other than the press. The notice's Undo (`offerUndo`, undo.js) now names ⌘Z's command only while ⌘Z would take the gesture the notice reports, and no command otherwise, so the field draws no press, as it draws none for Show changes while Versions stands. The notice keeps its words, and still leaves when the gesture is refused or taken back. The press makes ⌘Z's own press, so the press's own `run`, which looked up its gesture by attempt, goes. Max chose this on the handoff page for #6827's follow-ups, over keeping a click that takes back the Resolve while ⌘Z takes the pick. ⌘Z twice, or Reopen in Threads, still takes the Resolve back. Behavior changed in tests: test_a_resolve_s_notice_stands_for_that_resolve_alone held that the notice's Undo took back its Resolve after another tab's Reopen made that Reopen the newest gesture. It now holds that the notice keeps its words and offers no Undo then, and that the agent picking the Resolve up leaves the Undo standing. That test, test_resolving_a_thread_from_threads_moves_on_to_the_next, test_every_way_back_from_a_settlement_returns_the_user_where_they_made_it, `pnpm run check:browser` and `pnpm run test:runtime` pass.
leaf-agent
approved these changes
Nov 23, 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 notice's Undo now shows only while ⌘Z would take the gesture the notice reports. Before, a Resolve that left no thread open said "All threads resolved · Undo ⌘Z", and a pick made while that notice stood left it unchanged: ⌘Z then took back the pick, while a click on the notice's Undo took back the Resolve. Now the notice keeps its words and drops the press once another gesture is the newest.
Where to look.
offerUndo(undo.js) names ⌘Z's command only while ⌘Z's next target is its gesture, and no command otherwise; the field draws no press without keys, as it already does for Show changes while Versions stands. The press's ownrun, which took back its gesture by attempt, goes, since the press now only shows when ⌘Z's own press would take the same gesture. ⌘Z twice, or Reopen in Threads, still takes the Resolve back.Max picked this on the handoff page for #6827's follow-ups, over keeping the click. Tests:
test_a_resolve_s_notice_stands_for_that_resolve_alonenow holds that the notice offers no Undo once another tab's Reopen is the newest gesture (it held the reverse); it, the other Resolve-notice test, every way back from a settlement,pnpm run check:browserandpnpm run test:runtimepass.