Skip to content

feat(web): global sessions page with filter, group, sort - #35

Merged
lroolle merged 2 commits into
mainfrom
feat/web-global-sessions
Aug 11, 2026
Merged

feat(web): global sessions page with filter, group, sort#35
lroolle merged 2 commits into
mainfrom
feat/web-global-sessions

Conversation

@lroolle

@lroolle lroolle commented Aug 11, 2026

Copy link
Copy Markdown
Member

What

/sessions — the cross-project session cockpit the web UI was missing. Every session across every project, with:

  • Filter by: text (q = summary substring OR session-ID prefix), provider, project, model, after/before dates
  • Group by: project / day / provider / model — sticky headers with per-group aggregates (count, projects, tokens), groups ordered by most-recent session (provider mode: fixed CC/CX/GX)
  • Sort by: recency / messages / prompts / tokens — tokens added at the catalog layer, so the CLI gains ccx sessions --sort tokens too
  • GET /api/sessions serves the same query as JSON in a {sessions, total, shown} envelope; per-project /api/sessions/<project> keeps its bare-array shape

Design

Spec'd before building: docs/design/0003-global-sessions.md (design-system pass against the 0002 quiet-terminal contract). Key calls: dense two-line rows instead of cards (every sort key is a visible aligned column), one GET form usable with JS disabled, active filters as per-param-clearable chips, limit=100 default with an honest Showing X of Y footer, state entirely in the URL.

Adjacent defects the design audit surfaced, fixed here: dark-mode provider badge contrast (~2.1:1 → ground-color text), .empty-state trapped in memSectionCSS(), the advertised-but-unbound d theme shortcut (bound on this page).

Verification

  • make fmt / make test / make build clean; 25+ new assertions (grouping modes + ordering, q ID-prefix semantics, chips, footer copy, API envelope, invalid-param fallback, per-project API shape unchanged)
  • Live against a real ~1,800-session store: all variants 200 in ~40ms; default page 200KB; limit=0 2.4MB (opt-in, labeled "(slower)")
  • XSS sweep: every user/file-derived interpolation goes through html.EscapeString; URLs via url.Values.Encode(); no map-iteration ordering leaks

Follow-ups (not filed, Eric-gated)

  • Quick-parse Session.Title (SessionMeta + CacheFormatVersion bump) to light up the row-label precedence
  • Repo-wide flags from the audit: Tailwind CDN in pageHeader(), 900px sidebar breakpoint vs the 0002 two-breakpoint rule, index/project / focus contradicting its own placeholder

🤖 Generated with Claude Code

lroolle and others added 2 commits August 11, 2026 03:15
/sessions lists sessions across every project. Filters: q (summary
OR ID prefix), provider, project, model, after/before. Group by
project, day, provider, or model with sticky aggregate headers.
Sort by time, messages, prompts, or tokens — tokens is new in the
catalog layer, so the CLI gains --sort tokens too.

Dense two-line rows per docs/design/0003-global-sessions.md (kiln
pass over the quiet-terminal material): every sort key is a visible
column, active filters render as clearable chips, the form works
without JS, limit=100 with honest Showing X of Y footer.

GET /api/sessions is the same query as JSON in an envelope with
total/shown. Fixes shipped alongside per the design audit:
.empty-state promoted out of memSectionCSS, dark-mode provider
badge contrast, the advertised-but-unbound d shortcut (this page).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… native submit

Review pass: Enter in a text field fires native form submit, which
bypassed the debounced empty-param stripping and produced
?q=x&provider=&model= URLs. One shared stripEmpty on the submit
event covers both paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle
lroolle merged commit 14504f9 into main Aug 11, 2026
2 checks passed
@lroolle
lroolle deleted the feat/web-global-sessions branch August 11, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant