feat: active session lanes panel in Flow tab (#721)#2208
Open
vivekchand wants to merge 1 commit into
Open
Conversation
Add /api/flow/lanes endpoint returning sessions active within the last 30 minutes, annotated with channel type, event count, and status. The Flow tab now renders a "Active Session Lanes" panel below the topology SVG — one color-coded pill badge per active session showing channel type, short session ID, and event count. Refreshes every 30 s via visibilitySetInterval so it never fires when the tab is hidden. No changes to the existing topology SVG or live SSE stream. Closes #721 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Visual diffComparing 2 of 38 comparison(s) flagged (>1% pixel diff).
Folder: pr/2208/f78915fda6b2. Full PNGs also attached as a workflow artefact. Generated by visual-diff bot. Pixel diffs >1% flagged; eyeball the table before merging. This check is non-blocking — fail = bot bug, not a code problem. |
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.
Closes #721
Summary
GET /api/flow/lanesendpoint (routes/infra.py): queriesquery_flow_runsscoped to the last 30 minutes and returns per-session lane data (channel type, event count, active/failed status). Falls back gracefully to empty list when DuckDB is unavailable.clawmetry/templates/tabs/flow.html): inserted between the topology SVG and the Live Tool Call Stream. One color-coded pill badge per active session — Telegram blue, WhatsApp green, Slack purple, CLI indigo, etc. Shows channel label, short session ID, and event count.loadFlowLanes()JS function (clawmetry/static/js/app.js): fetches/api/flow/lanes, renders the pill badges, called frominitFlow()on page load and refreshed every 30 s viavisibilitySetInterval(pauses when tab is hidden to avoid idle polling).Tradeoff: the lanes are an additive panel below the SVG rather than replacing the static SVG channel nodes. This keeps the diff to 120 LOC and avoids regressions in the existing topology animation. The full per-session SVG lane replacement is a natural follow-up once this data layer is proven.
Test plan
TGbadge with the session's short ID and event count appears.GET /api/flow/lanesreturns{"lanes": [...], "_source": "local_store"}when DuckDB is populated.Generated by Claude Code