Skip to content

feat(web): "Recently deleted" section in workspace switcher#829

Merged
xarmian merged 3 commits into
mainfrom
feat/switcher-recently-deleted
Jul 6, 2026
Merged

feat(web): "Recently deleted" section in workspace switcher#829
xarmian merged 3 commits into
mainfrom
feat/switcher-recently-deleted

Conversation

@xarmian

@xarmian xarmian commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What:
Adds a collapsible "Recently deleted" section below the active-workspaces list in WorkspaceSwitcher.svelte, populated from api.workspaces.listDeleted() and (re)loaded each time the switcher opens. Each row shows the workspace name, a subtle "N days left" (from days_left), and an inline Restore button. Restore calls api.workspaces.restore(slug), then refreshes both the deleted list and the active workspaces list (via workspaceStore.loadAll()) so the restored workspace reappears, and shows a success toast. The section is hidden entirely when there are no deleted workspaces, and fetch failures are swallowed quietly so the switcher never breaks. Renders in both the desktop dropdown and the mobile BottomSheet.

Why:
Gives users a discoverable, low-friction way to recover a soft-deleted workspace still inside the restore window, right where they switch between workspaces. Scope is this component only (the console page + post-delete Undo are TASK-1975/1976).

Notes:

  • Svelte 5 runes throughout ($state, $derived, $effect, $props); matches the components existing conventions and styling tokens.
  • npm run check: 0 errors.

Closes TASK-1974

https://claude.ai/code/session_01HxBkAMiFBtCRJ2tKSCt3ST

xarmian added 3 commits July 6, 2026 14:18
Adds a collapsible "Recently deleted" section below the active-workspaces
list in WorkspaceSwitcher, populated from api.workspaces.listDeleted() and
loaded each time the switcher opens. Each row shows the workspace name, a
subtle "N days left", and an inline Restore button that calls
api.workspaces.restore() then refreshes both the deleted list and the
active workspaces list so the restored workspace reappears; a success
toast confirms. The whole section is hidden when there are no deleted
workspaces, and fetch failures are swallowed quietly so the switcher never
breaks. Renders in both the desktop dropdown and the mobile BottomSheet.

Closes TASK-1974

Claude-Session: https://claude.ai/code/session_01HxBkAMiFBtCRJ2tKSCt3ST
A failing workspaceStore.loadAll() after a successful restore no longer
shows a misleading "Couldn't restore" toast. The restore API call now has
its own catch; the post-restore refresh is guarded separately so a reload
failure stays silent (the restore already succeeded). Addresses Codex P2.

Claude-Session: https://claude.ai/code/session_01HxBkAMiFBtCRJ2tKSCt3ST
Adds a monotonic request token to loadDeleted() (mirroring workspaceStore's
membershipSeq) so an older open-triggered listDeleted() response can no
longer clobber the fresher post-restore refresh and re-surface a
just-restored workspace with a live Restore button. Addresses Codex P2.

Claude-Session: https://claude.ai/code/session_01HxBkAMiFBtCRJ2tKSCt3ST
@xarmian xarmian merged commit fa34ac3 into main Jul 6, 2026
4 checks passed
@xarmian xarmian deleted the feat/switcher-recently-deleted branch July 6, 2026 14:24
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.

1 participant