fix(web): session history empty + agents never highlighted (rc3 UX fix)#40
Merged
Merged
Conversation
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.
|
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.



Summary
Three live UX gaps surfaced after rc2 went up at https://clm.randomcodespace.dev:
useSessionListwas callingGET /api/v1/sessions(in-flight only). Switched toGET /api/v1/sessions/recent?limit=50(history + in-flight). Same cross-session SSE still drives live deltas.activeAgent={null}hardcoded. Now derived from the current session'sactive_agentfield (set bysession.agent_runningcross-session SSE). Active node gets theasr-flow-halobreathing animation.statusByAgentfromsessionFull.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 commentweb/src/App.tsx(~25 lines):activeAgent+statusByAgentderivation, pass-through to<FlowStrip>Verification
npm run typecheckcleannpm run test:unit→ 48 files / 196 tests pass (no regression)npm run build→ 321 kB raw / 98 kB gzip (under budget)GET /api/v1/sessions→[];GET /api/v1/sessions/recent?limit=5→ 5 sessionsTest plan
web/dist→ backend serves new SPAdonefor run agents🤖 Generated with Claude Code