Repository navigation
fix(inbox): a refused archive or unarchive puts the session back - #1211
Merged
Merged
Conversation
…e and Unarchive session (opencode#66327)
The put-back reopened the session's tab the way Reopen closed tab does, which shows it: a session archived from Home, or from another session's page, by its card's menu took the page when the server refused. Desktop moves nothing until the server has answered (packages/app/src/shell/titlebar/inbox-model.ts:476-487), so the page stays where it is. The archive now notes whether the tab it closed was the page shown: that one comes back shown, as before; one that was behind goes back to its place in the strip and the page stays.
Hona
marked this pull request as ready for review
November 25, 2026 17:19
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
This was referenced Nov 25, 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.
Follow-up to #1189: a session the server refuses to archive or unarchive goes back where it was.
The fault
Ours shows an archive or an unarchive at once and then asks the server. When the server refused, the toast said so, but the session kept showing as moved for the rest of the run: nothing put it back, and the archived list is read once per run. Official asks the server first and moves the session only when it has answered, so a refused session stays where it is (
packages/app/src/session/commands/use-session-commands.tsx:359-391,packages/app/src/shell/titlebar/inbox-model.ts:476-492,recent-sessions.tsx:914).What changes
The move at once stays, with its Undo toast. A refusal now puts the session back:
inbox-model.ts:476-487). The server's refusal shows as a toast, as before.PATCH, which a rename is too, and the toast was titled by the call alone: Failed to rename session. Official's title for both iscommon.requestFailed(use-session-commands.tsx:367,:383).How
apps/desktop/src/session/inbox/moves.rs: one explicit machine for the moves in flight (Moves,Event::Sent/Replied,Effect::PutBack), with what each move changed (Was::Listed { tab }, whereTabWasisAbsent,BehindorShown;Was::Archived(at)).apps/desktop/src/session/inbox/model.rs:archive_sessionandunarchive_sessionrecord their move.apps/desktop/src/shell/tabs/actions.rsput_back_closed: a closed tab back at its index without showing it.crates/opencode-kit/src/client/worker.rs(kindarchive),features/session-menu/src/lib.rsandhost.rs(on_archive_replied),apps/desktop/src/session/menu.rs.apps/desktop/src/session/composer/undo.rs:withdraw_archived.features/session-menu/src/lib.rssession_write_repliednames the toast by the write's kind (toast_wire_error_titled, shown by the existingstatus_toast::failed_wire).How it differs from official
Run
A PR build is of the PR's own head. Both heads named here hold the Rune pin bump #1192.
On
2ca9d2f2f(Windows x64 CI build, run45645976319; headless, a fixture file and no server, so each write is refused at once as one that could not be sent). Before: #1192's own PR build, headcc991c6505, run45629508899:devon the same pin without this change. 11 passes, every exit 0.b9b406382. The archive by the menu was pressed on Home. The put-back showed the session; on the before build the page stays Home. The put-back reopened the tab the way Reopen closed tab does, which shows it. It now shows it only when it was the page shown.On
b9b406382, the head that merges (Windows x64 CI build, run45651897076; the same fixture file, no server; 5 passes, every exit 0; the before passes are those above oncc991c6505). The put-back's three arms:2ca9d2f2f.Not run on any head (each needs a server):
Not run either: a real window; macOS; Linux. The unarchive was not repeated on
b9b406382: its code did not change between the two heads.