Skip to content

fix(web): session history empty + agents never highlighted (rc3 UX fix)#40

Merged
aksOps merged 1 commit into
mainfrom
feat/v2-rc3-ui-session-history-and-active-agent
May 16, 2026
Merged

fix(web): session history empty + agents never highlighted (rc3 UX fix)#40
aksOps merged 1 commit into
mainfrom
feat/v2-rc3-ui-session-history-and-active-agent

Conversation

@aksOps
Copy link
Copy Markdown
Contributor

@aksOps aksOps commented May 16, 2026

Summary

Three live UX gaps surfaced after rc2 went up at https://clm.randomcodespace.dev:

  1. SessionsRail empty when nothing is runninguseSessionList was calling GET /api/v1/sessions (in-flight only). Switched to GET /api/v1/sessions/recent?limit=50 (history + in-flight). Same cross-session SSE still drives live deltas.
  2. FlowStrip nodes always IDLE — App.tsx passed activeAgent={null} hardcoded. Now derived from the current session's active_agent field (set by session.agent_running cross-session SSE). Active node gets the asr-flow-halo breathing animation.
  3. No pipeline-progress visualisation — derive statusByAgent from sessionFull.state.agentsRun: agents that have run mark done (green fill); on session error and no current active, last run flips to error (red).

Files

  • web/src/state/useSessionList.ts (4-line change): endpoint switch + a comment
  • web/src/App.tsx (~25 lines): activeAgent + statusByAgent derivation, pass-through to <FlowStrip>

Verification

  • npm run typecheck clean
  • npm run test:unit → 48 files / 196 tests pass (no regression)
  • npm run build → 321 kB raw / 98 kB gzip (under budget)
  • Backend confirmed: GET /api/v1/sessions[]; GET /api/v1/sessions/recent?limit=5 → 5 sessions
  • Will verify in browser via Caddy after merge + SPA rebuild

Test plan

  • Merge → pull main → rebuild web/dist → backend serves new SPA
  • Open https://clm.randomcodespace.dev/ — SessionsRail shows past sessions
  • Select a finished session → FlowStrip nodes coloured done for run agents
  • Create new session → FlowStrip's active node breathes during agent run

🤖 Generated with Claude Code

Three UX gaps surfaced in the live app after rc2:

1. SessionsRail was empty whenever no session was actively running.
   useSessionList was calling GET /api/v1/sessions (in-flight only),
   not GET /api/v1/sessions/recent (history + in-flight). Backend
   docstring confirms: /sessions returns "snapshot of in-flight
   sessions"; /sessions/recent returns "any status — closed + active".
   Switched useSessionList to /sessions/recent?limit=50; the same
   cross-session SSE still pushes live status_changed / agent_running
   deltas onto the rendered list.

2. FlowStrip nodes were always "IDLE" because App.tsx passed
   activeAgent={null} hardcoded. Now derive it from the current
   session's active_agent field (set by the cross-session SSE's
   session.agent_running event) — when set, FlowStrip's
   asr-flow-halo breathes on that node, giving the "X is thinking"
   feedback the user was missing.

3. No history of which agents had already run on a session. Derive
   statusByAgent from sessionFull.state.agentsRun: any agent that
   appears in the run log marks 'done' (filled background); when the
   session terminates in 'error' and there's no current active agent,
   the last run flips to 'error'. The flow strip now visibly shows the
   pipeline's progress at a glance.

Files:
  - web/src/state/useSessionList.ts: /sessions -> /sessions/recent?limit=50
  - web/src/App.tsx: derive activeAgent + statusByAgent and pass to FlowStrip

Verified locally: npm run typecheck clean, vitest 48 files / 196 tests
pass, npm run build 321 kB / 98 kB gzip.
@sonarqubecloud
Copy link
Copy Markdown

@aksOps aksOps merged commit 6e3d2b2 into main May 16, 2026
10 checks passed
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