Add complete archive workflows to the default sidebar - #4384
Add complete archive workflows to the default sidebar#4384Quicksaver wants to merge 103 commits into
Conversation
- Add single, selected, and all-settled archive actions - Preserve lifecycle guards, confirmations, and failure feedback - Cover context menus and settled-header visibility
- Await archive mutations after failed draft navigation - Clear direct archive successes from thread selection - Document Sidebar V2 archive state guarantees
- Preserve optimistic state until archive completion - Limit bulk archive to eligible root threads - Keep bulk state from re-rendering unrelated rows - Add focused archive outcome and lifecycle tests
…hive-controls # Conflicts: # apps/web/src/components/SidebarV2.tsx
…hive-controls # Conflicts: # apps/web/src/components/Sidebar.logic.test.ts # apps/web/src/components/SidebarV2.tsx
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds significant new user-facing archive functionality to the sidebar, including new UI controls, bulk archive actions, and complex coordination logic. The scope and new capability introduced warrant human review. You can add or adjust custom eligibility rules. Learn more. |
- Keep disabled archive buttons as pointer targets - Ignore duplicate per-thread archive attempts
…hive-controls # Conflicts: # apps/web/src/components/SidebarV2.tsx
- Reserve thread keys across confirmation and archive mutation - Skip overlapping bulk entries and release reservations reliably - Cover shared reservations with focused concurrency tests
- Wait for current per-thread owners before running later flows - Retry canceled and failed entries while omitting completed archives - Verify owner success and cancellation in logic and browser tests
…hive-controls # Conflicts: # apps/web/src/components/SidebarV2.tsx
…hive-controls # Conflicts: # apps/web/src/components/Sidebar.tsx
- Share archive reservations across sidebar and chat header flows - Route menu eligibility, confirmation, and cleanup through one hook - Document post-merge ownership and integration seams 🤖 Co-authored by GPT-5 in Codex via Codex Desktop
- migrate archive status copy to the styled tooltip primitive - retain accessible disabled-state labeling and lifecycle guards 🤖 Co-authored by GPT-5 in Codex via T3 Code
- record the fork-owned styled tooltip behavior - clarify the upstream-owned row tooltip boundary 🤖 Co-authored by GPT-5 in Codex via T3 Code
- preserve focus and pointer targeting with aria-disabled - suppress blocked archive activation and row navigation - assert enabled and disabled archive tooltip copy 🤖 Co-authored by GPT-5.6 Sol in Codex via T3 Code
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 651c4ab. Configure here.
There was a problem hiding this comment.
One consistency finding in the new fork-owned archive controls. Everything else (shared lifecycle button classes, tooltip primitive usage for the row archive status copy, focus-visible crossfade on the slim status slot, sidebar token usage) lines up with the surrounding row surface.
Posted via Macroscope — UI Consistency
- Recheck selected threads before legacy archive mutations - Keep skipped threads selected and report eligibility drift - Cover mid-batch eligibility changes 🤖 Co-authored by GPT-5 in Codex via T3 Code
There was a problem hiding this comment.
One finding on the new fork-owned archive control's disabled presentation. Everything else in the changed UI surface (shared lifecycle button classes, settled divider layout, tooltip primitive usage, slim-slot focus-visible crossfade) lines up with the surrounding upstream row surface.
Posted via Macroscope — UI Consistency
- Use a not-allowed cursor for blocked row archive controls - Keep the blocked hover tone muted without disabling pointers - Cover the aria-disabled presentation classes 🤖 Co-authored by GPT-5 in Codex via T3 Code
…hive-controls # Conflicts: # apps/web/src/hooks/useThreadActionMenu.ts
- Connect timestamp-aware settle transitions to Archive all - Verify live membership skips threads un-settled while waiting 🤖 Co-authored by GPT-5 in Codex via T3 Code
- Gate pointer and hover affordances behind the enabled state - Keep disabled pointer capture with a not-allowed cursor - Cover the in-flight archive-all presentation 🤖 Co-authored by GPT-5 in Codex via T3 Code
…hive-controls # Conflicts: # apps/web/src/components/threadActionMenu.logic.ts
🤖 Co-authored by GPT-5.6-Sol in Codex via T3 Code
🤖 Co-authored by GPT-5 in Codex via T3 Code
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo Closing this PR after an automated pass over open pull requests. Sidebar archive actions already shipped in #6526. |

Summary
The default sidebar treats settle and archive as separate lifecycle states, but its archive support stopped short of the workflows people need. Archiving one root conversation, a selection, or every settled conversation required switching to the legacy sidebar. Any new action also had to avoid threads that were starting or still doing foreground or background work.
The default sidebar and chat header now cover the full archive lifecycle without taking ownership of their existing row, pagination, sorting, filtering, or search behavior. Archive flows confirm when configured, recheck live eligibility, and coordinate concurrent requests per thread. Overlapping actions cannot archive the same thread twice, and successful work stays visible if a later archive or navigation fails. Users can manage individual, selected, and all-settled conversations where they already work, without conflating archive with settle.
What changed
Archive allto the settled shelf for the complete settled partition in the current project, including rows behind pagination. It rechecks active work and settled membership before each archive and stays mounted while a batch is running.threadArchive.logic.tsfor individual, selected, and all-settled flows. Waiting requests reserve uncontested threads, consume successful archives and intentional skips, and retry canceled or failed work.SidebarArchiveControls.logic.tsand controls inSidebarArchiveControls.tsx. The narrowSidebar.logic.tscompatibility facade leaves upstream-owned sidebar integration points intact.Validation
pnpm exec vp test runpassed 135 focused tests across the sidebar logic, archive policy, archive controls, action-menu, and thread-action suites. Coverage included starting-session guards, owner-skip and later-throw coordination, live eligibility and settled-membership rechecks, and pointer-safe disabled controls.vp fmt --checkandvp lintpassed for the refactored archive-policy files.git diff --checkpassed for the complete branch diff.thread.archivedevent and one archived projection.Archive all 3 settled threads. Activating it removed the shelf, and SQLite recorded a distinctarchived_attimestamp for each authoritative projection.Archive allpasses kept the disabled button mounted and hit-testable through mutation and navigation. It reportedcursor: not-allowedandpointer-events: auto, and center-point hit testing returned the button. When every confirmed fixture became active, the batch warned about the skips and left the projections unarchived.5743/13783covered settled-row archiving, starting-session blocking, legacy multi-select archiving, and the blocked row control's pointer-safe state against Archive settings and SQLite. The browser console had no warnings or errors.Note
Medium Risk
Touches thread lifecycle, navigation after archive, and concurrent bulk mutations across three surfaces; coordination and live re-checks are heavily tested but regressions could affect selection state or partial bulk outcomes.
Overview
Brings archive to parity with settle in the default sidebar: settled rows get hover/focus un-settle + archive controls, the Settled shelf gets Archive all (including paginated tail), and multi-select/context menus route archive through shared hooks instead of inline logic in
Sidebar.tsxanduseThreadActionMenu.ts.Eligibility widens from “running turn only” to starting sessions, active turns, and any background liveness (
isThreadArchiveBlocked), with disabled controls still capturing clicks and tooltips explaining why. Bulk paths re-check eligibility at mutation time, skip ineligible threads without stopping the batch, warn on skips, and only remove successfully archived keys from selection.New
threadArchive.logic.tscentralizes batch outcomes and a process-wide reservation pool so overlapping individual, selection, and archive-all flows don’t double-archive or drop work;useThreadArchiveActions/useSidebarArchiveActionsown confirmation, toasts, selection cleanup, and settled-membership checks for archive-all.SidebarArchiveControlsisolates fork UI;Sidebar.logic.tsre-exports archive helpers for legacy import seams.Reviewed by Cursor Bugbot for commit 5544d62. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add complete archive workflows to the default sidebar
SidebarSettledLifecycleControlsandSidebarSettledDividerto expose per-row and bulk "Archive All" actions in the sidebar.archiveSelectedThreadEntriesandwithCoordinatedThreadArchiveEntriesin threadArchive.logic.ts to handle batch archiving and coordinate concurrent flows to prevent double-processing.isThreadArchiveBlockedto disable archiving when a thread is starting, running, or has active background work, replacing inline running-session checks across the sidebar.ThreadArchiveBlockedErrormessage to "Cannot archive a thread while work is still active." and bulk archive now skips blocked threads instead of failing entirely.Macroscope summarized 5544d62.