Skip to content

fix(gui): gui.json forgets deleted Workspaces (#395) - #416

Merged
bRRRITSCOLD merged 1 commit into
mainfrom
fix/395-gui-state-prune
Nov 24, 2026
Merged

bRRRITSCOLD merged 1 commit into
mainfrom
fix/395-gui-state-prune

Conversation

@bRRRITSCOLD

Copy link
Copy Markdown
Owner

Closes #395

What changes

gui.json kept every deleted Workspace's last_side, collapsed.workspaces and dismissed entries forever. Now the GUI forgets them:

  • Deleted from this GUI: the Delete workspace dialog forgets the Workspace as soon as the delete succeeds (nothing on a failed delete).
  • Deleted elsewhere (CLI, another client, or while the GUI was closed): each successful sidebar read forgets the Workspaces it no longer lists. The list includes archived Workspaces, so those are kept.
  • Transient states don't prune: the sidebar's snapshot read is all or nothing, so pruning runs only on an Ok read. 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.
  • The file is written back only when something was forgotten. A read that finds nothing stale doesn't write.

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_state unit tests: forget_workspace clears only that Workspace's side, groups and dismissals. workspaces() names every Workspace remembered. keep_workspaces writes the file back with only the listed ones, and doesn't write at all when nothing is stale.
  • Sidebar view tests over FakeApi (new fail_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.
  • Delete workspace dialog view tests: it forgets the deleted Workspace and writes the file back, and forgets nothing on a failed delete.

cargo xtask ci passes locally.

🤖 Generated with Claude Code

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>
@bRRRITSCOLD
bRRRITSCOLD merged commit cdc1522 into main Nov 24, 2026
6 checks passed
@bRRRITSCOLD
bRRRITSCOLD deleted the fix/395-gui-state-prune branch November 24, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gui.json keeps the side and collapsed groups of deleted Workspaces

1 participant