Chat sidebar: lazy Archived + System groups, unbounded conversation feed - #269
Open
arsenmuk wants to merge 1 commit into
Open
Chat sidebar: lazy Archived + System groups, unbounded conversation feed#269arsenmuk wants to merge 1 commit into
arsenmuk wants to merge 1 commit into
Conversation
The sidebar silently dropped active chats: GET /api/sessions capped
non-starred sessions at 50, and always-updating cron sessions crowded
conversations out of those slots. Archived sessions had no UI at all
(and no unarchive path anywhere).
- Main feed (GET /api/sessions) now returns ALL non-archived
conversation sessions (no LIMIT); cron/hook sessions are excluded
and served by GET /api/sessions/system instead. archived_count +
system_count piggyback on the payload, so collapsed groups show a
badge without fetching any rows.
- New Archived and System sidebar groups: collapsed by default (not
persisted), lazily fetched on first expand, hidden when empty.
- Archived rows get a Star / Rename / Unarchive / Delete menu. New
POST /api/sessions/{id}/unarchive restores to idle; starring an
archived session unarchives + stars in one PATCH, so the
star->project hook fires on a live session.
- Date buckets simplified to Last hour / Last 3 hours / Today /
This week / Other (relative first two, empty buckets never render).
Telegram's session picker keeps the old bounded list_sessions.
pytest tests/test_sessions.py 70/70; npm run build green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
The sidebar silently dropped active chats:
GET /api/sessionscapped non-starred sessions at 50, and cron sessions (bumped every heartbeat tick) crowded conversations out of those slots. Archived sessions had no UI at all — and no unarchive path existed anywhere in the backend.Changes
Backend
GET /api/sessionsnow serveslist_active_sessions(): all non-archived conversation sessions, unbounded;cron/hooksources excluded from the feed.archived_count+system_countride on the payload (twoCOUNT(*)s), so collapsed groups show a badge without fetching rows.GET /api/sessions/archivedandGET /api/sessions/system— fetched lazily, only when the corresponding sidebar group is expanded.POST /api/sessions/{id}/unarchive(restores toidle, clearsarchived_at, logs anunarchivedevent) — inverse of archive.PATCH /api/sessions/{id}withstarred: trueon an archived session unarchives + stars in one write, so the star→project hook fires on a live session.list_sessions— untouched.Frontend
Testing
pytest tests/test_sessions.py— 70/70 (10 new: unarchive lifecycle/events/missing, archived list/count, star-unarchive write, active-feed exclusions, unbounded feed regression, system list/count).npm run build(tsc + vite) green./archived//systemrequest until expand; unarchive returns a session to its date group; starring an archived session lands it in Starred.🤖 Generated with Claude Code