feat: add unarchive/restore for archived sessions#24154
Open
alohaninja wants to merge 2 commits intoanomalyco:devfrom
Open
feat: add unarchive/restore for archived sessions#24154alohaninja wants to merge 2 commits intoanomalyco:devfrom
alohaninja wants to merge 2 commits intoanomalyco:devfrom
Conversation
Allow users to restore archived sessions back to active status. Backend: accept null for time.archived in PATCH endpoint to clear the archived timestamp. Pass null through setArchived to the projector so time_archived is set to NULL in SQLite. Web app: add unarchiveSession() and command palette entry. Show 'Unarchive' instead of 'Archive' in the session dropdown when viewing an archived session. Label archived sessions in the file picker with '(archived)'. Increment sessionTotal when a session is re-inserted into the store via un-archive event. TUI: add ctrl+a keybind in session list to toggle archive state. Show '[archived]' prefix on archived sessions. Closes anomalyco#24153
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue for this PR
Closes #24153
Type of change
What does this PR do?
Archiving a session is currently one-way — once archived, there is no way
to restore it from the UI. The backend schema already supports clearing
time.archived(theUpdatedTimetype acceptsNullOr(Number)), so thiswires up the missing pieces.
Backend (2 files):
/session/:idvalidator now acceptsnullfortime.archivedsetArchivedpassesnullto the projector when clearing, sotime_archived = NULLin SQLiteWeb app (5 files):
unarchiveSession()in layout.tsx — calls update witharchived: null,then navigates to the restored session
session is archived (conditional via
info()?.time?.archived)sessionTotalwhen an unarchived session isre-inserted into the store
TUI (1 file):
ctrl+akeybind in session list toggles archive/unarchive[archived]prefix in the listGenerated (3 files):
./script/generate.tsHow did you verify your code works?
packages/opencodeandpackages/appwithtsc --noEmit— zero errorsnull→ archived field cleared)bun dev serve+bun dev:webto validate the web UI (screenshots below)Screenshots / recordings
1. Command palette: archived session shows
(archived)label2. Session dropdown: "Unarchive" instead of "Archive" for archived sessions
3. Session restored and accessible after unarchiving
Checklist