Analytics command bar: replace hero-metric, lead with bypassed techniques + weakest hosts#341
Open
ubercylon8 wants to merge 15 commits into
Open
Analytics command bar: replace hero-metric, lead with bypassed techniques + weakest hosts#341ubercylon8 wants to merge 15 commits into
ubercylon8 wants to merge 15 commits into
Conversation
…value, cover tone+a11y
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QdfJwx8RKSiJ29FNfGQMSf
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QdfJwx8RKSiJ29FNfGQMSf
Extract scoreBandTone() from BulletBar as a shared helper (>=80 protected, >=50 warning, else bypassed) and have WeakestHosts derive its score-text color through it instead of duplicating the thresholds a third time. Add StatusCommandBar: a compact horizontal band (Card, aria-busy when loading) that replaces HeroMetricsCard's giant text-7xl hero number with a text-3xl max value, a delta chip, a BulletBar vs the 80% target, an optional Sparkline, and Fleet / Needs-attention / Secure Score cells. Preserves HeroMetricsCard's exact sub-stat wording (actual X% (N excluded), EDR-only X%, X% inconclusive) and null -> em-dash handling. HeroMetricsCard itself is left in place; wiring the new bar into AnalyticsDashboardPage and removing the old card is Task 6.
…share TONE_TOKEN The "X% inconclusive" sub-line in StatusCommandBar was styled with var(--chart-warn) (amber), introducing a third color into the Defense cell. The redesign rule reserves the delta chip as the only valence color there, with bypassed-red the single saturated signal. Make the line neutral (text-muted-foreground) like its actual/EDR-only siblings; "inconclusive" carries the meaning. Add a regression test asserting the line is not rendered with var(--chart-warn). Also dedup TONE_TOKEN: it had become an identical copy in both BulletBar and WeakestHosts. Promote it to an export from BulletBar (alongside scoreBandTone, the shared threshold source of truth) and import it in WeakestHosts.
… bar
The "Needs attention" cell showed a bare bypassed count (e.g. "4,484
bypassed") with no unit, reading like a count of discrete techniques
and clashing with the other cells that pair a number with a unit
("22 endpoints", "168 tests"). bypassedCount is the sum of UNPROTECTED
test executions, so add a muted caption line — "unprotected runs" —
under the value, matching the Fleet cell's caption styling. When a
bypassedTacticCount is provided the existing "{n} tactics" caption
still takes precedence. Number and color are unchanged.
…d-center # Conflicts: # frontend/src/pages/analytics/components/HeroMetricsCard.tsx # frontend/src/pages/analytics/components/__tests__/HeroMetricsCard.test.tsx
Semgrep SAST ResultsNo security findings. All checks passed. |
…s, reorder dashboard flow
…s), swap Trend/Test Activity
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.
Why
The Analytics dashboard opened with a 100px
52.0%— the banned hero-metric the design system explicitly rejects. It spent the most valuable screen space on one aggregate number while the operator's real question — which techniques bypassed, on which hosts — sat three scrolls down. This PR replaces that with a compact status command bar and leads with the two panels an operator acts on. It's the flagship of the command-center redesign, built to the approved mockup.Third workstream in the redesign; builds on the tokens from #339.
What changed
New reusable primitive
BulletBar(components/shared/ui/BulletBar.tsx) — a value-vs-target meter (role="meter"), band-colored (≥80 protected / 50–79 warning / <50 bypassed) with a target marker. Exports a sharedscoreBandTone(value)+TONE_TOKENso the band thresholds live in exactly one place.Pure derivations (
pages/analytics/utils/analyticsDerivations.ts, fully unit-tested)topBypassedTechniques,weakestHosts,totalBypassedCount,scoreDelta— all derived from data the page already fetches (no new API calls, no backend change). They sort copies, never the live React-state arrays.Status command bar (
StatusCommandBar.tsx, replacesHeroMetricsCard)text-3xl, nottext-7xl): Defense Score with an inline sparkline, a 7-day delta chip (the only valence color in the cell), a bullet bar vs the 80% target, and the preserved sub-stats (actual,EDR-only,inconclusive— all neutral). Plus Secure Score (when Defender is configured), Fleet (endpoints/tests), and a "Needs attention" cell (N bypassed / unprotected runs).Two promoted panels
TopBypassedTechniques— sorted worst-first, the single worst row at full--chart-bypassed, others dimmed.WeakestHosts— bullet bars vs the 80% target,<50%red /50–79%amber, with a legend.HeroMetricsCard(+ its test) deleted.Dashboard recomposition (not just additive)
techniqueDistDataas Top Bypassed) and Defense Score by Host (samedefenseScoreByHostas Weakest Hosts) — the dashboard no longer shows the same data twice.DefenseScoreByHostChartdeleted.getTechniqueOverlapfetch from the dashboard load (the Defender tab'sTechniqueOverlapChartfetches it independently).Test evidence
cd frontend && npm test→ 418/418 passing, 42 files.BulletBar.npx tsc -b+npm run build→ clean. Every commit through the pre-commit hook; no--no-verify.Design discipline notes (from review)
--chart-bypassedpasses.Known follow-ups (non-blocking)
StatusCommandBarre-implements a smallx.toFixed(1)%formatter inline for a few sub-stats; could share one helper.Design context
Before/after mockup of all three dashboards: https://claude.ai/code/artifact/10ac4d51-df1f-43d6-a603-931d900e6ffe
Remaining workstreams (separate PRs): Tests ATT&CK coverage matrix; Endpoints fleet-status bar (consumes
TaskStatusBadgefrom #340 + this PR'sBulletBar/StatusCommandBarpatterns).🤖 Generated with Claude Code
https://claude.ai/code/session_01QdfJwx8RKSiJ29FNfGQMSf