Skip to content

feat(dashboard): overhaul one-off components page and chart UX#100

Merged
georgewrmarshall merged 1 commit into
mainfrom
feat/dashboard-oneoff-components-overhaul
Jul 15, 2026
Merged

feat(dashboard): overhaul one-off components page and chart UX#100
georgewrmarshall merged 1 commit into
mainfrom
feat/dashboard-oneoff-components-overhaul

Conversation

@AndyMBridges

@AndyMBridges AndyMBridges commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR rewrites the One-off Components page (formerly "Untracked Components") and adds several UX improvements across the Overview page charts.


One-off Components page (UntrackedComponents.tsx)

  • Renamed "Untracked Components" → "One-off Components" throughout the UI. The page now focuses exclusively on local-oneoff source category entries — platform primitives and third-party packages are excluded from both tables.
  • Renamed the two tables to better communicate intent:
    • "Potential MMDS Replacements" → Replace with MMDS today — in-repo one-offs with a direct MMDS equivalent, sorted by migration impact.
    • "Future DS Candidates" → Introduce to MMDS — custom components with no DS equivalent yet, sorted by breadth signal.
  • Priority score column added to the "Replace Now" table: instances × confidence weight (exact ×3, strong ×2, partial ×1), visualised as an inline bar.
  • Breadth signal column added to the DS Roadmap table: instances × unique teams, surfacing components used widely across the org as stronger roadmap signals.
  • Migration vs Overall adoption callout added per project — shows the gap between the tracked migration rate (MMDS ÷ MMDS+deprecated) and the true overall adoption rate (which also counts one-off instances in the denominator), with an explanation of what's driving the difference.
  • OneoffTrendChart — new line chart showing replaceable, candidate, and total one-off instance counts over time alongside overall adoption %, with a trend pill showing the weekly change direction.
  • SourceCell component replaces the old source-category badge display. Uses a direct tree link when a reliable path is available, falling back to a GitHub code-search link — no more broken 404 links.
  • SummaryCard gains colour accent variants (green / purple / blue / amber) to visually differentiate the four stat cards.
  • Summary cards updated to show: "Replace Now" count, "Introduce to MMDS" count, teams with one-offs, and the adoption gap in percentage points.
  • @unknown owners are filtered out of the team dropdown.

CodeOwnerAdoptionChart.tsx

  • Adds a configurable threshold prop (default 90).
  • Bars are now colour-coded by adoption %: green ≥ threshold, amber ≥ 70% of threshold, red below — replacing the old blue/orange stacked bars.
  • Adds a compliance summary header showing "X / N teams on target" and "Y teams below" as callout cards.
  • Teams are sorted by migration % descending (best performing teams first).
  • The Recharts Legend is replaced with an inline colour key.

CodeOwnerTrendChart.tsx + CodeOwnerAdoptionTrendChart.tsx

  • Both trend charts gain a Team filter dropdown for focusing on a single team's line without losing the overall colour assignment (colours stay stable across filter state).
  • Chart height reduces to 300 px in single-team mode (vs 450 px for all teams).

Overview.tsx

  • New DeprecatedDeltaSparkline component added below each project's main chart — a compact bar chart showing week-over-week changes in deprecated instances (green = reduction, red = net increase).
  • Passes explicit threshold={90} to both CodeOwnerAdoptionChart instances.

Hooks, types & scripts

  • New useUntrackedTimeline() hook in useMetricsData.ts — fetches untracked-timeline.json, gracefully handling 404 (returns null).
  • New UntrackedProjectTimeline and UntrackedTimeline TypeScript types in metrics.ts.
  • New scripts/update-untracked-timeline.js script that builds the timeline JSON consumed by the hook, with a corresponding update-untracked-timeline entry in package.json.

Test plan

  • Open the dashboard locally (cd dashboard && npm run dev) and verify the One-off Components page loads without errors for both Mobile and Extension.
  • Confirm the "Replace with MMDS today" table is pre-sorted by Priority score descending.
  • Confirm the "Introduce to MMDS" table is pre-sorted by Breadth signal descending.
  • Verify the Migration vs Overall adoption callout renders correct percentages and gap.
  • Check the Team filter dropdown on both trend charts — selecting a team should isolate that line with stable colouring.
  • Check the DeprecatedDeltaSparkline renders on the Overview page for both projects.
  • Run yarn update-untracked-timeline to confirm the new script generates untracked-timeline.json correctly, then copy to dashboard/public/metrics/ and verify the OneoffTrendChart renders.
  • Build the dashboard (npm run build) and confirm no TypeScript errors.

@socket-security

socket-security Bot commented Jul 14, 2026

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@georgewrmarshall georgewrmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Really nice 🔥 Just need to investigate and address socket security issue

Renames "Untracked Components" to "One-off Components" throughout the UI
and rewrites the page with clearer intent, better scoring, and richer
context. Key changes across components and hooks:

**UntrackedComponents page**
- Filters to `local-oneoff` source category only — platform primitives and
  third-party packages are no longer shown in either table.
- Renames "Potential MMDS Replacements" → "Replace with MMDS today" and
  "Future DS Candidates" → "Introduce to MMDS".
- Adds a **Priority score** column (instances × confidence weight) with an
  inline bar to highlight the highest-value migration targets.
- Adds a **Breadth signal** column to the DS Roadmap table (instances ×
  unique teams), replacing the old instances-only sort.
- Default sort changes: replaceable table sorts by priority desc;
  candidates table sorts by breadth desc.
- New **Migration vs Overall adoption callout** at the top of each project
  section shows the gap between the tracked migration rate (MMDS ÷
  MMDS+deprecated) and the true overall adoption rate (which also accounts
  for one-off instances).
- Replaces the old source-category badge UI with a `SourceCell` component
  that links directly to the source tree when a reliable path is available,
  with a fallback GitHub code-search link.
- New `OneoffTrendChart` line chart shows replaceable, candidate, and total
  one-off instance counts over time alongside the overall adoption %.
- `SummaryCard` gains colour accent variants (green / purple / blue / amber).
- `@unknown` owners are filtered out of the team dropdown.

**CodeOwnerAdoptionChart**
- Adds a configurable `threshold` prop (default 90 %).
- Bars are now colour-coded by adoption %: green ≥ threshold, amber ≥ 70 %
  of threshold, red below — replacing the old blue/orange stacked bars.
- Adds a compliance summary header showing teams on-target vs below-target.
- Sorts teams by migration % descending (best first) instead of total
  instances.
- Legend is removed in favour of an inline colour key.

**CodeOwnerTrendChart / CodeOwnerAdoptionTrendChart**
- Adds a **Team filter** dropdown to both trend charts, letting users focus
  on a single team's line. Clearing the filter restores all lines.
- Team colours remain stable when the filter is applied (colour index is
  computed against the full owner list).
- Chart height reduces to 300 px in single-team mode.

**Overview page**
- Adds a new `DeprecatedDeltaSparkline` component below each project's
  deprecated-instances chart, showing week-over-week deltas as a green
  (reduction) / red (increase) bar chart.
- Passes the explicit `threshold={90}` prop to both `CodeOwnerAdoptionChart`
  instances.

**Hooks & types**
- New `useUntrackedTimeline` hook fetches `untracked-timeline.json`.
- New `UntrackedProjectTimeline` and `UntrackedTimeline` types added to
  `metrics.ts`.
- New `scripts/update-untracked-timeline.js` script (and corresponding
  `update-untracked-timeline` package.json entry) that builds the timeline
  JSON consumed by the hook.

Co-authored-by: Cursor <cursoragent@cursor.com>
@AndyMBridges AndyMBridges force-pushed the feat/dashboard-oneoff-components-overhaul branch from be6b58a to 5a95deb Compare July 15, 2026 07:16
@georgewrmarshall georgewrmarshall merged commit 699aafc into main Jul 15, 2026
2 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.

2 participants