Repository navigation
Conversation
…nal closed The terminal store remembers which terminal ids the server last listed, and closes a local terminal that later drops off that list. A terminal the user closed stayed on it, because the drawer unmounts before it sees the server drop the id. Reopening the drawer creates the same id, and the first reconcile closed it again. A closed id now leaves the list when it closes, and stays off it while it is still closing.
The store forgot a closed id at close time and kept it out of later reconciles. An id saved by an older build never went through either path, so its first reopen still took two clicks. Placing a fresh local id now drops it from the observed list instead, which covers the close, the close animation and the saved entry with one rule.
Owner
Author
|
Moved upstream as pingdotgg#39260, from this same branch. |
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.
Fixes #22.
After you close the last terminal in a thread, the next click on the terminal button opened the drawer and closed it again about 20 ms later. A second click worked.
The terminal store remembers which terminal ids the server last listed (
serverObservationsByThreadKey), and closes a local terminal that later drops off that list, so a terminal closed by another client leaves the drawer. A terminal you closed yourself stayed on the list, because the drawer unmounts before it sees the server drop the id. Reopening the drawer creates the same id (term-1), and the first reconcile treated it as closed elsewhere.Now, when the client places a terminal id it doesn't already have, that id leaves the list. Whatever put it there, that listing is older than the new terminal, so it is about an earlier one. The next reconcile lists the id again if the server has it, so a terminal another client closes later still leaves the drawer. This one rule covers the drawer unmounting right after the close, the drawer seeing the closing terminal once more during its close animation, and an entry saved before this fix.
Proof
vp run scenarios:provewith an uncommitted scenario (open a terminal, close it with the trash icon, click the terminal button once): fails on basee37e45fd5b, passes ond8a42e0451(the later commit only rewords a comment).Before (
e37e45fd5b): the first click on the terminal button does nothing, the second opens the drawer.terminal-reopen-before.mp4
After (the fix): the first click opens the drawer.
terminal-reopen-after.mp4
The store test gets two rows, one per drawer timing. Both fail without the new rule.
Web and desktop share this code. Mobile has no copy of this logic.
Implemented by Claude Opus 5.5 in Claude Code (T3 Code), reviewed by Claude Fable 5.2 and GPT-6.1 Sol.
🤖 Generated with Claude Code