Repository navigation
#833 Restore archived sessions - #977
Conversation
Home's Settings button becomes a ⋯ menu that holds Settings for now. HomeMenu (iOS and Android) puts feature entries first, in order, and adds Settings last behind a divider, so Search sessions, Archived sessions and Worktrees each add one entry. The shared overflow menu gains a dividerAbove slot, and on iOS a whole menu row now takes the tap, not just its icon and text. ⌘, / Ctrl+, still open Settings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add an Archived sessions screen on Android and iOS: Home's scope, grouped
This week / Earlier by archive time, with one-tap Unarchive (snackbar with
Undo), an actions sheet (Unarchive, Open, Delete…) and a live refresh on
session.archived / unarchived / deleted. Session Chat shows an "Archived
<time>" banner with Unarchive.
v2 lists with ?archived=true and restores with PATCH {archived: false}.
v1 can archive but cannot clear time.archived, so a new
supportsArchivedSessions capability hides the feature there.
ArchivedSessionList is shared so search can reuse it for archived results.
The Home ⋯ menu entry lands after the #929 menu foundation.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cd742c7. Configure here.
There was a problem hiding this comment.
Automated review: no finding that 2+ of 2 passes agreed on.
3 finding(s) from a single pass, not posted
android/app/src/main/java/dev/opencode/mobile/ui/archived/ArchivedSessionsModel.kt:337medium: Undo-restored row dropped when directory is unknown (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/UI/Archived/ArchivedSessionsViewModel.swift:307medium: Undo-restored row dropped when directory is unknown (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/ui/archived/ArchivedSessionsModel.kt:637low: Undo-restored rows can be dropped from the list when the session directory maps to no Home project (glm-5.3-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.152 · 1 pass(es) failed
…into feature/833-restore-archived-sessions
The ⋯ menu lists "Archived sessions" with "N in <scope>", counted when the menu opens and left out on servers that cannot restore archived sessions. It opens the Archived sessions screen for Home's current scope. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both branches add a Home route, menu entry, analytics names and a Container factory; all kept. Menu order: Archived sessions, Worktrees. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Automated review: no finding that 2+ of 2 passes agreed on.
6 finding(s) from a single pass, not posted
ios/OpenCode Mobile/OpenCode Mobile/Domain/Session/ArchivedSessionList.swift:24medium: iOS archived load swallows task cancellation (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/ui/archived/ArchivedSessionsModel.kt:268medium: One failing project fails the whole archived list (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/ui/archived/ArchivedSessionsModel.kt:335low: Undo row dropped when its directory matches no project (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/Domain/Session/V2SessionRemote.swift:94low: Unarchive unconditionally clears archived state (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Region/SessionInfo.swift:234low: Stale archived banner persist across rebind when loadArchiveState GET fails (glm-5.3-flash)android/app/src/main/java/dev/opencode/mobile/domain/session/ArchivedSessionList.kt:63low: Archived time of 0 (null archivedAt) formats epoch 0 caption (glm-5.3-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.191 · 1 pass(es) failed
- Home menu: recount the Archived sessions entry once Home's server probe finishes, so it shows on the first open after launch (both apps). - Android overflow menu: size the panel to its widest entry; a divider no longer stretches it to the window. Gallery gains the Home menu shape. - iOS: archived rows drop the long-press overlay that covered the trailing Unarchive button; a tap still opens the actions. - Delete confirmation names the session and says it is deleted from the server for good, from a target the closing sheet cannot clear. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Undo the overflow menu width change; #976 fixes the divider there. - Session Chat: session.unarchived clears the banner directly, and an archive change since a session read began wins over that read, so a lagging GET no longer brings the banner back (both apps). iOS also clears the banner on rebind. - Archived list: unarchived or deleted rows stay gone while a list still carries their old archive time; Undo rows keep their project, so an unknown directory no longer drops them; one failing project keeps the others listed (both apps). - iOS: subscribe to events before the first load, and report cancellation from ArchivedSessionList. Co-Authored-By: Claude Opus 5.5 <[email protected]>
HorizontalDivider fills the width it is offered, and the panel offered the popup window's width, so a divider stretched the menu across the screen. The panel column now takes its widest row's intrinsic width, and every row fills it, so the whole row takes the tap as on iOS. Adds a grouped preview (subtitles plus divider) on both platforms and an instrumented layout test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Triage of the single-pass findings in the automated review summaries: Fixed in d09e0a3:
Not changed:
|
…into feature/833-restore-archived-sessions
There was a problem hiding this comment.
Automated review: no finding that 2+ of 2 passes agreed on.
7 finding(s) from a single pass, not posted
android/app/src/main/java/dev/opencode/mobile/domain/session/V2SessionRemote.kt:89medium: Unarchive hides row forever if server keeps listing it (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/ui/archived/ArchivedSessionsModel.kt:302medium: Stale load can overwrite a newer load on Android (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/ui/archived/HomeArchivedMenu.kt:71medium: Stale archived-count overwrites newer scope (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/domain/session/V2SessionRemote.kt:29low: Project lookup swallows coroutine cancellation (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/domain/session/ArchivedSessionList.kt:55low: Dedupe keeps first duplicate instead of newest (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/UI/Archived/HomeArchivedMenu.swift:54low: recheck recounts with stale projects snapshot (muse-spark-1.3-contributor)android/app/src/main/java/dev/opencode/mobile/ui/archived/ArchivedSessionsModel.kt:306low: Archived list marks itself loaded with zero projects and never re-reads the projects flow (deepseek-v4.1-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.139 · 1 pass(es) failed
Home's Done pill is server unread state. Unarchive from the Archived screen must not acknowledge it; only opening the session does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
main's only new commit is the #976 squash, whose tree matches fa295aa, already merged here in a9d2fac, so this branch's tree is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Automated review: no finding that 2+ of 2 passes agreed on.
3 finding(s) from a single pass, not posted
android/app/src/main/java/dev/opencode/mobile/ui/archived/ArchivedSessionsModel.kt:248low: Undo-then-unarchive-again stores a fabricated archive time, so a lagging server list brings the unarchived row back (glm-5.3-flash)ios/OpenCode Mobile/OpenCode Mobile/UI/Archived/ArchivedSessionsViewModel.swift:224low: Same fabricated archive-time bug as Android in the undo path (glm-5.3-flash)android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/region/SessionInfo.kt:475low: loadArchivedAt captures archive generation inside the launched coroutine (deepseek-v4.1-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.179 · 1 pass(es) failed
- Dedupe archived sessions after sorting, so a duplicate keeps its newest copy. - A row Undo put back settles against any archive time when unarchived again, since the app never saw the server's time for it. - Android: capture the archive generation before launching the read; the v2 project lookup rethrows cancellation. - iOS: recheck the menu entry with Home's current projects. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Triage of the single-pass findings in the two latest automated reviews: Fixed in d6c2f29:
Not changed:
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # android/app/src/main/java/dev/opencode/mobile/domain/session/V2SessionRemote.kt
main's tree equals #977's final commit f30175e, merged in the parent. Co-Authored-By: Claude Opus 5.5 <[email protected]>









Summary
Part 1 of #833: restore archived sessions, on Android and iOS.
session.archived/session.unarchived/session.deleted.SessionRepository.listArchivedSessions/unarchiveSession(v2:GET /api/session?archived=true,PATCH /api/session/{id}{archived:false}).ArchivedSessionListhelper (load across directories, dedupe, newest first) is there for Search's "Include archived" to reuse.time.archivedbut has no way to clear it, so the newsupportsArchivedSessionscapability (v2 with archive only) hides the feature. On v1 the banner shows without Unarchive.SessionListRow).unarchiveicon (lucidearchive-restore).Checks
ArchivedSessionsModelTest, plus new cases inSessionProtocolRepositoryTestandServerProtocolClassifierTest.assembleDebug/assembleDebugAndroidTestOK. ktlint is clean for the changed files.build-for-testing(generic simulator) succeeds.ArchivedSessionsViewModelTestsand the newSessionProtocolRepositoryTests/ServerProtocolClassifierTestscases are not run yet.node scripts/check-string-keys.mjspasses. gitleaks found nothing.Evidence
Pending: device verification runs on the shared simulator and emulator once the menu entry lands.
Issue
#833 (part 1. Part 2, worktree removal, is a separate PR that finishes the issue.)
Risks / Follow-ups
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
New session lifecycle APIs and optimistic list/undo state on both platforms; incorrect gating or refresh could hide or duplicate archived rows, though behavior is covered by repository and view-model tests.
Overview
Adds list and restore archived sessions for v2 servers with archive support (
supportsArchivedSessions), wired throughlistArchivedSessions/unarchiveSessionand sharedArchivedSessionListloading/sorting.Archived sessions screen (Android route + iOS
HomeRoute.archivedSessions): sessions for the current Home scope, grouped This week / Earlier, reusing HomeSessionListRowwith a trailing Unarchive, snackbar Undo, and sheet actions (Open, Delete). Live refresh on archive/unarchive/delete events. Empty state can widen to Show all projects.Session Chat shows an Archived <time> banner; Unarchive when the server supports restore. Archive state reloads on open and on
session.archived/session.unarchived.v1 still archives via
time.archivedbut cannot list/restore—the UI gates on the new capability (banner without Unarchive on v1). Design: compact list rows get a trailing slot on Android; new unarchive icon.Navigation destinations exist; the PR description notes the Home ⋯ menu entry may land separately after menu foundation work.
Reviewed by Cursor Bugbot for commit cd742c7. Bugbot is set up for automated code reviews on this repo. Configure here.