Skip to content

Add thread archiving support#122

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-thread-archiving-support
Closed

Add thread archiving support#122
Copilot wants to merge 2 commits intomainfrom
copilot/add-thread-archiving-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Adds thread archiving as a distinct action from hard deletion. Archived threads are hidden from the sidebar by default with a toggle to reveal them.

What Changed

Contracts

  • Added archivedAt: string | null to OrchestrationThread (decoding defaults to null for backward compat)
  • Added ThreadArchiveCommand, ThreadUnarchiveCommand, ThreadArchivedPayload, ThreadUnarchivedPayload
  • Added thread.archived / thread.unarchived to OrchestrationEventType and the event union
  • Both new commands added to DispatchableClientOrchestrationCommand and ClientOrchestrationCommand

Server

  • Migration 018_ProjectionThreadsArchivedAt: adds archived_at TEXT column to projection_threads
  • ProjectionThread schema + SQL upsert/select updated to carry archived_at
  • decider.ts: handles thread.archivethread.archived and thread.unarchivethread.unarchived
  • projector.ts + ProjectionPipeline.ts: apply archive/unarchive events to in-memory read model and DB projection

Web

  • Thread type gains archivedAt: string | null
  • syncServerReadModel maps archivedAt from the read model
  • New showArchivedThreads: boolean app setting (default false)
  • Sidebar: context menu shows "Archive" / "Unarchive" per thread; archive icon toggle in Projects header filters archived threads; archiving the active thread navigates to a fallback

Why

Threads could previously only be removed via hard delete (deletedAt). Archiving is a non-destructive alternative — lets users hide old threads without losing history, matching the TODO.md entry for this feature.

UI Changes

Archive toggle button added to the Projects section header; thread context menu gains Archive/Unarchive action (mutually exclusive based on current archivedAt state).

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Copilot AI linked an issue Mar 31, 2026 that may be closed by this pull request
5 tasks
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
okcode-marketing Ready Ready Preview Mar 31, 2026 10:07pm

- Add archivedAt field to OrchestrationThread schema in contracts
- Add ThreadArchiveCommand and ThreadUnarchiveCommand to contracts
- Add ThreadArchivedPayload and ThreadUnarchivedPayload to contracts
- Add thread.archived and thread.unarchived to OrchestrationEventType
- Update DispatchableClientOrchestrationCommand and ClientOrchestrationCommand
- Add archive/unarchive handlers in the decider
- Add archive/unarchive event handlers in the projection pipeline
- Add archive/unarchive to the projector
- Add migration 018 for archived_at column
- Add archivedAt to ProjectionThread schema and SQL queries
- Add archivedAt to web Thread type
- Add showArchivedThreads setting to appSettings
- Update Sidebar: archive/unarchive context menu, show toggle button
- Filter archived threads in sidebar based on showArchivedThreads setting
- Update all tests to include archivedAt field

Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/b99a8fc7-a48f-4212-9ce8-eb793dcf4110

Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Copilot AI changed the title [WIP] Add thread archiving support as a distinct action Add thread archiving support Mar 31, 2026
Copilot AI requested a review from BunsDev March 31, 2026 22:14
@BunsDev BunsDev marked this pull request as ready for review March 31, 2026 22:22
@github-actions github-actions bot added size:L vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 31, 2026
@BunsDev BunsDev closed this Apr 1, 2026
@BunsDev BunsDev deleted the copilot/add-thread-archiving-support branch April 1, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 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.

Thread archiving support

2 participants