You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Restore archived sessions and remove worktrees #833
Settled with the Home menu prototype shared with #929. Same design on iOS and Android, built from existing design-system components (top-bar overflow menu, OpenCodeBottomSheet, OpenCodeDialog, OpenCodeSnackbar).
Entry. Home's ⋯ menu (from #929): Search sessions, Archived sessions, Worktrees (subtitle "N across M projects"), divider, Settings. Worktrees pushes a screen titled "Worktrees", subtitle "N worktrees · M projects".
Worktrees screen. Grouped by project. Each group header shows the project badge, name and worktree count. First row: "Main checkout" with its path and "Can't be removed" (not tappable). Then one row per worktree: branch icon, name, path · session count, a "Running" pill when one of its sessions is running, an "N changed" pill when the server reports uncommitted changes, and a trailing ⋯. A project without worktrees says so and points at New session → choose worktree. The footer says removing deletes the folder on the server and sessions stay.
Actions (row tap or ⋯, bottom sheet headed by the worktree name and "project · N sessions"): Show sessions on Home (sets Home's existing scope picker to that worktree), New session here (existing new-session flow), Remove worktree… (destructive).
Confirmation.
Clean: "Remove worktree “x”?" / "Deletes on the server." / Cancel + Remove.
Uncommitted changes: warning "N uncommitted changes will be lost". Sessions attached: note that they stay on Home but can't run there again. The button becomes "Remove anyway".
A running session: "Can't remove “x” yet", with OK + Show session.
Removing. The row shows "Removing…" with a spinner and is disabled. Success: the row leaves, snackbar "Removed worktree “x”", Home's worktree grouping refreshes. Failure: the row comes back and an error snackbar offers Retry. Sessions from a removed worktree stay on Home with the worktree name struck through and "worktree removed".
Server API (checked against the specs):
v2: GET /api/worktree?projectID=, DELETE /api/worktree with {projectID, directory, force} (204). Without force a dirty checkout fails with 400 WorktreeError and data.forceRequired: true. POST /api/worktree/refresh afterwards.
v1: GET /experimental/worktree?directory=<project>, DELETE /experimental/worktree?directory=<project> with {directory} (200 true).
Uncommitted changes: both servers report them. v2 GET /api/vcs/status at the worktree's location, v1 GET /vcs/status?directory=<worktree>. The count drives the pill and the warning. v2 sends force: true only after "Remove anyway". If the count could not be read and the server answers forceRequired, the app shows the dirty confirmation again before forcing.
Part 1 (restore archived sessions): settled design
Settled with the Home menu prototype shared with #929. Part 2 (worktree removal) is tracked separately.
Entry point. Home's top bar gets a ⋯ menu (#929). Its second entry, after Search sessions, is Archived sessions, with the subtitle "N in ". The entry is hidden on servers that can't restore archived sessions.
Archived sessions screen (pushed from the menu):
The title is "Archived sessions" and the subtitle is Home's current scope.
Sessions are grouped This week / Earlier by archive time, newest first. Rows use Home's session row, captioned with the archive time.
Each row has a trailing one-tap Unarchive button.
Tapping a row opens a bottom sheet with the title and "Archived ". The sheet offers Unarchive, Open and Delete…; Delete is red and is confirmed with a dialog.
Unarchive removes the row and shows a snackbar, "Unarchived “title”", with Undo (which archives it again). On Home the session returns at the top, because the server bumps its update time.
Empty state: "No archived sessions". When the scope is one project and other projects have archived sessions, it adds Show all projects.
The list refreshes live on session.archived, session.unarchived and session.deleted.
Session Chat. An archived session opened from the list (or later from search) shows a banner, "Archived ", with Unarchive.
Protocols:
v2:GET /api/session?archived=true lists archived sessions per project, and PATCH /api/session/{id} with {archived: false} restores one. The UI is gated on the same contract probe as Archive (sessionArchive, 2.1.0+).
v1: archive sets time.archived through PATCH /session/{id}. The schema only accepts a number, so there is no way to clear it, and v1 has no archived listing apart from /experimental/session?archived=true. v1 servers therefore hide Archived sessions. A new supportsArchivedSessions capability carries this gate. If you open an archived session on v1, the banner shows without Unarchive.
Domain. The repository adds listArchivedSessions(directory:) and unarchiveSession(id:directory:). A shared ArchivedSessionList helper (load across directories, dedupe, newest first) is meant for Search's "Include archived" to reuse.
Activity
ivanfenenko commentedon Nov 3, 2026
Part 2 (remove a worktree): settled design
Settled with the Home menu prototype shared with #929. Same design on iOS and Android, built from existing design-system components (top-bar overflow menu,
OpenCodeBottomSheet,OpenCodeDialog,OpenCodeSnackbar).Entry. Home's ⋯ menu (from #929): Search sessions, Archived sessions, Worktrees (subtitle "N across M projects"), divider, Settings. Worktrees pushes a screen titled "Worktrees", subtitle "N worktrees · M projects".
Worktrees screen. Grouped by project. Each group header shows the project badge, name and worktree count. First row: "Main checkout" with its path and "Can't be removed" (not tappable). Then one row per worktree: branch icon, name, path · session count, a "Running" pill when one of its sessions is running, an "N changed" pill when the server reports uncommitted changes, and a trailing ⋯. A project without worktrees says so and points at New session → choose worktree. The footer says removing deletes the folder on the server and sessions stay.
Actions (row tap or ⋯, bottom sheet headed by the worktree name and "project · N sessions"): Show sessions on Home (sets Home's existing scope picker to that worktree), New session here (existing new-session flow), Remove worktree… (destructive).
Confirmation.
Removing. The row shows "Removing…" with a spinner and is disabled. Success: the row leaves, snackbar "Removed worktree “x”", Home's worktree grouping refreshes. Failure: the row comes back and an error snackbar offers Retry. Sessions from a removed worktree stay on Home with the worktree name struck through and "worktree removed".
Server API (checked against the specs):
GET /api/worktree?projectID=,DELETE /api/worktreewith{projectID, directory, force}(204). Withoutforcea dirty checkout fails with 400WorktreeErroranddata.forceRequired: true.POST /api/worktree/refreshafterwards.GET /experimental/worktree?directory=<project>,DELETE /experimental/worktree?directory=<project>with{directory}(200true).GET /api/vcs/statusat the worktree's location, v1GET /vcs/status?directory=<worktree>. The count drives the pill and the warning. v2 sendsforce: trueonly after "Remove anyway". If the count could not be read and the server answersforceRequired, the app shows the dirty confirmation again before forcing.ivanfenenko commentedon Nov 3, 2026
Part 1 (restore archived sessions): settled design
Settled with the Home menu prototype shared with #929. Part 2 (worktree removal) is tracked separately.
Entry point. Home's top bar gets a ⋯ menu (#929). Its second entry, after Search sessions, is Archived sessions, with the subtitle "N in ". The entry is hidden on servers that can't restore archived sessions.
Archived sessions screen (pushed from the menu):
session.archived,session.unarchivedandsession.deleted.Session Chat. An archived session opened from the list (or later from search) shows a banner, "Archived ", with Unarchive.
Protocols:
GET /api/session?archived=truelists archived sessions per project, andPATCH /api/session/{id}with{archived: false}restores one. The UI is gated on the same contract probe as Archive (sessionArchive, 2.1.0+).time.archivedthroughPATCH /session/{id}. The schema only accepts a number, so there is no way to clear it, and v1 has no archived listing apart from/experimental/session?archived=true. v1 servers therefore hide Archived sessions. A newsupportsArchivedSessionscapability carries this gate. If you open an archived session on v1, the banner shows without Unarchive.Domain. The repository adds
listArchivedSessions(directory:)andunarchiveSession(id:directory:). A sharedArchivedSessionListhelper (load across directories, dedupe, newest first) is meant for Search's "Include archived" to reuse.#833 Add Archived sessions to the Home menu
#929 Android: Include archived in session search
#833 Fix archived sessions verification findings
#833 Warn when uncommitted changes can't be checked, keep v1 extras
#833 Address review findings on archived sessions
#833 Only server-listed worktrees are removable
#833 Test that unarchive leaves server read state alone
#929 #833 Home top-bar overflow menu (#976)
#833 One row per worktree folder, plain connection error
#833 Address second review pass on archived sessions
#833 Test unarchiving an undone row again while the list lags
#833 Restore archived sessions (#977)