Repository navigation
fix(gui): gui.json forgets deleted Workspaces (#395) - #416
Merged
Merged
Conversation
What gui.json keeps by Workspace id (collapsed groups, last side, dismissals) is forgotten when the Delete workspace dialog deletes the Workspace, and on the sidebar's next successful read that no longer lists it (deleted from the CLI, another client or while the GUI was closed). Nothing is forgotten before the first read succeeds or on a failed one. Repository ids are kept: a Repository comes back with the same GitHub id once linked again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #395
What changes
gui.jsonkept every deleted Workspace'slast_side,collapsed.workspacesanddismissedentries forever. Now the GUI forgets them:Okread. It never runs on the empty snapshot before the first read lands, after a failed read, or with an older daemon that's missing a route (that read fails too). An older daemon that does answer lists every Workspace, just like a current one.Repository ids: kept
Stale Repository ids aren't pruned, either under a Workspace that still exists or on the Pull requests view. When a Repository's last link goes, the Repository is deleted, but linking it again brings it back with the same GitHub id, so its collapse state is still worth keeping. A dismissal also names a Repository the daemon may never hold (a Suggestion it doesn't link), so pruning against the Repository list would undo Not now.
Spec
docs/spec.md§11: the GUI state paragraph now says when Workspace entries are forgotten, when they aren't, and why Repository ids stay. The testing row lists the new tests. No route change.Tests
gui_stateunit tests:forget_workspaceclears only that Workspace's side, groups and dismissals.workspaces()names every Workspace remembered.keep_workspaceswrites the file back with only the listed ones, and doesn't write at all when nothing is stale.FakeApi(newfail_next_read): it forgets on the first read the Workspaces deleted meanwhile, forgets a Workspace deleted elsewhere on the next read, keeps an archived one, and forgets nothing when the first read or a later read fails. Each test checks the file on disk.cargo xtask cipasses locally.🤖 Generated with Claude Code