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 feed used one LIMIT 50 window over every session row, cron included, so ~96 cron runs a day pushed conversations out of the pane within hours. Rework it into three server-scoped lists with one shared page-size knob: - sessions.sidebar_page_size (default 50, 0 = unlimited) caps the feed and sizes one Archived/System page. - The window applies only to non-archived, non-system rows, so cron traffic can never displace conversations. - Starred sessions are off-budget: always returned in full, whatever the page size, and pinned even when their source is cron/hook. - Archived and System load lazily (nothing fetched until expanded) and page via ?offset=, with has_more/next_offset driving a '...' row. Collapsing a group drops its rows, so reopening repeats the same cold request. The feed gets the same '...' rather than truncating silently. - Sources split by exclusion (system = cron/hook): the client no longer whitelists, so workflow/external sessions stop rendering nowhere. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
arsenmuk
force-pushed
the
arsenmuk/archived-sessions-group
branch
from
August 11, 2026 10:06
8e8d187 to
72c7263
Compare
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