Skip to content

feat(dashboard): shared range bar, sensitivity control, drill breadcrumb (PR-B)#152

Merged
surpradhan merged 3 commits into
mainfrom
feat/dashboard-analytics-polish
Jun 26, 2026
Merged

feat(dashboard): shared range bar, sensitivity control, drill breadcrumb (PR-B)#152
surpradhan merged 3 commits into
mainfrom
feat/dashboard-analytics-polish

Conversation

@surpradhan

Copy link
Copy Markdown
Owner

What does this PR do?

Builds on PR-A (#151) with analytics UX improvements and session drill-through. Stacked on feat/dashboard-nav-polish — will rebase to main once #151 merges.

Changes

Shared range bar — replaces three duplicate per-view toolbars (Policy Analytics, Performance, Anomalies) with a single range bar shown above the Analyze sub-nav. All three views read from shared-since/shared-until. Range persists as you switch sub-tabs within Analyze.

change-trigger — when both Since and Until inputs are set, the active view auto-loads. No more mandatory Apply click for range changes. Explicit Apply and quick-range buttons still work.

Sensitivity control — the z-score threshold (ad-threshold) was previously buried inline with the Anomalies range toolbar. It's now a dedicated "Sensitivity (z-score)" section that appears only on the Anomalies sub-tab — semantically separate from the time range.

Custom Analytics untouched — Custom keeps its own cq-since/cq-until controls and explicit "Run query" button. The shared range bar is hidden on the Custom sub-tab.

Drill breadcrumbdrillSession() now captures the source view, encodes it as #sessions?from=analytics in the URL (survives back-navigation), and shows a "← Back to Policy Analytics" breadcrumb inside the Sessions panel. applyInitialHash() restores the breadcrumb on reload.

Why?

Three identical toolbars forced the user to reconfigure the range every time they switched sub-tabs. Hiding the threshold inside the range bar implied it was a time value. No breadcrumb left users stranded after drilling into a session from Performance or Anomalies.

How to test?

ADMIN_TOKEN=dev-admin npm run ingest
open http://localhost:8787/dashboard
  1. Navigate to Analyze → Policy Analytics — shared range bar appears
  2. Set a 1h range, click Apply — loads filtered data
  3. Switch to Performance sub-tab — same range still set, auto-loads
  4. Navigate to Analyze → Anomalies — Sensitivity control appears below the range bar
  5. Navigate to Analyze → Custom Analytics — shared range bar disappears, Custom's own controls visible
  6. In Performance: click "Go to session" on any result — Sessions panel shows "← Back to Performance" breadcrumb
  7. Click the breadcrumb — returns to Performance view
  8. Navigate to #sessions?from=analytics directly — breadcrumb appears without drilling

Checklist

@surpradhan surpradhan left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 findings (all addressed in ceec8a0): (1) drillOrigin set after switchMain in both drillSession and applyInitialHash — fixed by moving the assignment before the call; (2) no guard for mainView === 'sessions' drill — fixed; (3) indentation nit on inner .layout div — fixed. Round 2: all three fixes are correct, no new issues, tests 239/0. Approve.

@surpradhan surpradhan left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 findings (all addressed in ceec8a0): (1) drillOrigin set after switchMain in both drillSession and applyInitialHash — fixed by moving the assignment before the call; (2) no guard for mainView === 'sessions' drill — fixed; (3) indentation nit on inner .layout div — fixed. Round 2: all three fixes are correct, no new issues, tests 239/0. Approve.

surpradhan and others added 2 commits June 25, 2026 23:40
- Replace three separate per-view toolbars (Policy/Performance/Anomalies)
  with one shared range bar above the Analyze sub-nav; all three views
  read from shared-since/shared-until; range persists across sub-tab switches
- Auto-trigger the active Analyze view on change when both fields are set
- Extract ad-threshold (z-score sensitivity) from the range toolbar into its
  own dedicated Sensitivity section, visible only on the Anomalies sub-tab
- Custom Analytics retains its own independent controls with explicit Run
- Add drill breadcrumb: drillSession() captures origin, encodes it as
  #sessions?from=origin in the URL (survives back navigation), and shows
  a "← Back to [view]" breadcrumb in the Sessions panel; updateBreadcrumb()
  called on switchMain so the bar hides correctly on manual nav

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…nitialHash

- Set drillOrigin before switchMain in both drillSession() and applyInitialHash()
  so the updateBreadcrumb() call inside switchMain already sees the correct value;
  removes the redundant explicit updateBreadcrumb() call after switchMain
- Guard drillSession() against mainView === 'sessions' to avoid writing a
  semantically meaningless #sessions?from=sessions URL
- Fix indentation of inner .layout wrapper inside #view-sessions (2sp → 4sp)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@surpradhan surpradhan force-pushed the feat/dashboard-analytics-polish branch from ceec8a0 to 4bde832 Compare June 25, 2026 18:11
@surpradhan surpradhan changed the base branch from feat/dashboard-nav-polish to main June 25, 2026 18:11
@surpradhan surpradhan merged commit b1e3d3d into main Jun 26, 2026
14 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