-
Notifications
You must be signed in to change notification settings - Fork 55
Add archived project support and session deletion #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Features: - Show fully archived projects (cached but no JSONL files) in TUI and HTML index - Projects with [ARCHIVED] badge in project selector and greyed-out styling in index - Archived projects automatically open in archived view mode - Delete sessions from cache via 'd' key with confirmation dialog - Restore JSONL now produces compact JSON format matching original files - Project list refreshes after restore to update archived status Implementation: - Add get_all_cached_projects() to discover archived projects from cache.db - Add delete_session() and delete_project() methods to CacheManager - Update CLI to discover and track archived projects, refresh on return - Update SessionBrowser to handle is_archived_project flag - Add DeleteConfirmScreen modal for delete confirmation Tests: - Add tests for compact JSON export, session/project deletion - Add tests for get_all_cached_projects with active/archived detection - Add TUI test for archived project loading in archived mode
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 |
|
I like the idea of the TUI enabling you to manage your sessions. I tested it and here's my feedback. Well, some of the feedback, as what I started to write was general feedback about the TUI.. So the unrelated part of the feedback is in #73, and here I focus on the archive/restore functionality. So, I didn't immediately "get" it...
I somehow expected to have 'a' to be the symmetrical to 'r'. The 'd' action can't be used for that either, as it will propose to delete the archive and keep the file. Likewise, I expected the ability to archive ('a') a whole project, but I'm OK to let that happen by itself once all sessions are archived (as it is now). So, what do you think about having 'A' (upper case, "dangerous", "think twice" connotation) do the archiving (i.e., deleting the session file)? Also:
In summary, and to answer your question: "I'm not sure if the added complexity is worth it". Definitely yes, if you can use |
|
Thanks a lot, this is great feedback! I'll improve the usability of the TUI. Will need to think how to incorporate these new functions into the TUI without crowding the bottom bar too much 🤔 but accepting Enter for actions and always showing what keys do what action makes perfect sense (might even add it to CLAUDE.md). I guess then managing session logs should be the remit of this library, so maybe we can even expand this functionality to delete JSONL logs too! |
|
In the end I realised we could remove a lot of confusion by having a unified list, having Here's Claude's summary: Summary of Changes
Archive dialog (ArchiveConfirmScreen):
Delete dialog (DeleteConfirmScreen):
Files Modified
|
…s well as archive and restore
|
Added all these actions (archive / restore / delete) to projects as well and wired up Enter and Esc more to do main action / back. I'm quite happy with this PR now so will merge it back into the main SQLite PR! |

@cboos I went down a rabbit hole adding functionality around handling deleted sessions and projects (where the JSONL files are gone, but the SQLite cache still has the info) and it's working all right now, but I'm not sure if the added complexity is worth it, so instead of committing into #59 I thought I'd open a PR to separately look at and discuss.
Features:
Implementation:
Tests:
This is how the CLI output looks like if you have deleted / archived sessions and projects (with a few work projects removed so the numbers don't add up):