Skip to content

Add complete archive workflows to the default sidebar - #4384

Closed
Quicksaver wants to merge 103 commits into
pingdotgg:mainfrom
Quicksaver:feat/sidebar-v2-archive-controls
Closed

Add complete archive workflows to the default sidebar#4384
Quicksaver wants to merge 103 commits into
pingdotgg:mainfrom
Quicksaver:feat/sidebar-v2-archive-controls

Conversation

@Quicksaver

@Quicksaver Quicksaver commented Jul 23, 2026

Copy link
Copy Markdown

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

  • Added adjacent un-settle and archive buttons to settled rows. They appear on hover or keyboard focus, use the shared lifecycle styling and tooltip, and keep disabled clicks from falling through to row navigation.
  • Added Archive all to 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.
  • Added Archive to the default-sidebar and chat-header menus for settled and unsettled root conversations. Nested subagent rows still omit root lifecycle actions.
  • Added selected-thread archiving with confirmation, live eligibility checks, selection cleanup, partial-success reporting, and matching safeguards in the legacy sidebar.
  • Moved confirmation, optimistic visibility, archived-snapshot refresh, selection cleanup, and outcome reporting into shared archive hooks. A later failure no longer makes completed archives look rolled back.
  • Added one process-wide reservation pool in threadArchive.logic.ts for individual, selected, and all-settled flows. Waiting requests reserve uncontested threads, consume successful archives and intentional skips, and retry canceled or failed work.
  • Kept sidebar-only eligibility and presentation rules in SidebarArchiveControls.logic.ts and controls in SidebarArchiveControls.tsx. The narrow Sidebar.logic.ts compatibility facade leaves upstream-owned sidebar integration points intact.
  • Added focused logic and component tests for menu composition, lifecycle controls, active-work detection, live rechecks, coordination outcomes, and archive feedback.

Validation

  • pnpm exec vp test run passed 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.
  • Targeted vp fmt --check and vp lint passed for the refactored archive-policy files. git diff --check passed for the complete branch diff.
  • Playwright exercised the default sidebar against an isolated server and disposable project. Two synchronous triggers produced one thread.archived event and one archived projection.
  • Controlled-browser overlap passes covered owner success, owner cancellation, incremental success, intentional eligibility skips, and waiter retries. They produced no duplicate archive commands or stale confirmation scopes.
  • An isolated pagination pass rendered three settled rows and Archive all 3 settled threads. Activating it removed the shelf, and SQLite recorded a distinct archived_at timestamp for each authoritative projection.
  • In-flight Archive all passes kept the disabled button mounted and hit-testable through mutation and navigation. It reported cursor: not-allowed and pointer-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.
  • Settled-membership passes held confirmation open and then un-settled an owned fixture. The active fixture stayed unarchived, its settled sibling archived, and overlapping waiters did not retry the intentional skip.
  • Controlled-browser passes on fixed ports 5743/13783 covered 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.

🤖 Generated by GPT-5 in Codex via T3 Code


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.tsx and useThreadActionMenu.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.ts centralizes batch outcomes and a process-wide reservation pool so overlapping individual, selection, and archive-all flows don’t double-archive or drop work; useThreadArchiveActions / useSidebarArchiveActions own confirmation, toasts, selection cleanup, and settled-membership checks for archive-all. SidebarArchiveControls isolates fork UI; Sidebar.logic.ts re-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

  • Adds SidebarSettledLifecycleControls and SidebarSettledDivider to expose per-row and bulk "Archive All" actions in the sidebar.
  • Introduces archiveSelectedThreadEntries and withCoordinatedThreadArchiveEntries in threadArchive.logic.ts to handle batch archiving and coordinate concurrent flows to prevent double-processing.
  • Adds isThreadArchiveBlocked to disable archiving when a thread is starting, running, or has active background work, replacing inline running-session checks across the sidebar.
  • Risk: Updates ThreadArchiveBlockedError message to "Cannot archive a thread while work is still active." and bulk archive now skips blocked threads instead of failing entirely.

Macroscope summarized 5544d62.

- 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
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9866ef72-f5a1-4783-896a-fa6e07a1b3b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 23, 2026
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
…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
Comment thread apps/web/src/components/Sidebar.logic.ts Outdated
- 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
Comment thread apps/web/src/components/Sidebar.logic.ts Outdated
Comment thread apps/web/src/components/Sidebar.logic.ts Outdated
…hive-controls

# Conflicts:
#	apps/web/src/components/SidebarV2.tsx
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 24, 2026
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
T3 Verification and others added 9 commits August 10, 2026 01:14
…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

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/components/LegacySidebar.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/SidebarArchiveControls.tsx Outdated
- 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

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread apps/web/src/components/SidebarArchiveControls.tsx Outdated
- 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
@t3dotgg

t3dotgg commented Aug 23, 2026

Copy link
Copy Markdown
Member

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.

@t3dotgg t3dotgg closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants