Skip to content

feat(dashboard): three-pane workspace + rebuilt analytics#38

Merged
doganarif merged 1 commit into
mainfrom
feat/three-pane-dashboard
May 22, 2026
Merged

feat(dashboard): three-pane workspace + rebuilt analytics#38
doganarif merged 1 commit into
mainfrom
feat/three-pane-dashboard

Conversation

@doganarif
Copy link
Copy Markdown
Owner

The old sidebar + main + modal-drawer worked when the dashboard was just
"a list of recent requests", but the drawer hurts triage: opening it
hides the table, dismissing it drops the selection, and clicking through
ten requests is ten animations. Three-pane (rail · list · persistent
detail) keeps the selection alive on the right while the list stays
visible on the left. Same pattern as Mail.app, Linear, and the browser
DevTools Network panel.

Layout

  • Icon rail (56px) — Inbox · Errors · Slow · Analytics · Environment
  • Request list (340px) — search, status chips, time-grouped rows
  • Detail pane (flex) — Overview / Headers / Body / Trace /
    Performance tabs, with inline Replay / Compare / Copy cURL

Errors and Slow are auto-filtered (status >= 400, duration >= 200ms) so
the rail isn't just navigation, it's a triage tool. Analytics and
Environment swap the list+detail for a full-width page.

Analytics rebuild

The old analytics page was a card with a chart and a card with export
buttons. The chart used an area path which silently smooths between
buckets — fine for continuous metrics, misleading for the bursty traffic
HTTP servers actually see. Switched to discrete bars stacked with error
counts in red. Plus:

  • p50 / p95 / p99 / max in the hero, with amber tinting past 500ms / 1s
  • status donut for 2xx / 3xx / 4xx / 5xx
  • latency-bucket histogram color-coded by speed
  • endpoints table sorted by p95, each row with a heat bar
  • export / import collapsed into a small `Data` dropdown in the header

Backend

One server fix in handler.go: SSE was seeding lastSeen = "" after
writing the initial snapshot, so the first tick re-emitted the whole
snapshot as an `append` event and the client prepended duplicates.
Now seeds from the snapshot's newest ID.

Removed

`SimpleSidebar`, `RequestDrawer`, `RequestTable`, `StatsDashboard`,
`Filters`, `ResponseTimeChart`, `ExportImport`, plus the
`ui/drawer` / `ui/sheet` / `ui/sidebar` / `ui/tooltip` primitives,
the `use-mobile` hook, and the `react-compat` shim. All superseded
by the new panes or unused after the migration.

Testing

  • `go test -race ./...` clean
  • `npm run build` clean
  • Exercised every view (Inbox / Errors / Slow / Analytics / Environment)
    in Playwright against the profiling example. Verified live SSE updates
    no longer duplicate, the slow / errors filters land where expected,
    and the Analytics charts populate correctly under sparse data.

Compatibility

UI-only change. The HTTP API the dashboard hits is unchanged. Anyone
running govisual upgrades transparently — they just see the new layout
the next time they load `/__viz`.

The old sidebar + main + modal-drawer worked when the dashboard was a
list of recent requests, but the drawer hurts triage: opening it loses
the table context, dismissing it loses the selection, and the animation
adds friction to clicking row after row. Three-pane (icon rail · request
list · persistent detail) keeps the selection alive in the right pane,
which is the Mail.app / Linear pattern for this kind of workflow.

Views in the rail are Inbox, Errors, Slow, Analytics, Environment.
Errors filters to >= 400 and Slow filters to >= 200ms — they are
triage destinations, not just nav. The list pane has a search input
and status-class chips; the detail pane has Overview / Headers / Body /
Trace / Performance tabs with inline Replay / Compare / Copy cURL.

Analytics rebuild:

- discrete bars per time bucket; the previous area path implied
  continuous data between buckets, which lies when traffic is bursty
- errors stacked on each bar in red
- p50 / p95 / p99 / max prominent in the hero, with amber tinting
  past 500ms / 1s
- status donut and a latency-bucket histogram (color-coded by speed)
- endpoints table sorted by p95, each row with a heat bar
- export / import collapsed into a Data dropdown in the header,
  replacing the old ExportImport card

Backend: handler.go SSE was seeding lastSeen as "" after writing the
snapshot, so the first tick re-emitted the entire snapshot as an
append event and the client prepended duplicates. lastSeen now seeds
from the snapshot's newest ID.

Removes the SimpleSidebar, RequestDrawer, RequestTable, StatsDashboard,
Filters, ResponseTimeChart, ExportImport components and the
ui/drawer / ui/sheet / ui/sidebar / ui/tooltip primitives, plus the
unused use-mobile hook and react-compat shim. All superseded by the
new panes or unused after the migration.
@doganarif doganarif merged commit f69e288 into main May 22, 2026
1 check 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