Skip to content

feat(health): lead with two figures and mark history as something to watch - #2161

Merged
swati510 merged 2 commits into
mainfrom
feat/health-first-screen
Sep 8, 2026
Merged

feat(health): lead with two figures and mark history as something to watch#2161
swati510 merged 2 commits into
mainfrom
feat/health-first-screen

Conversation

@RaghavChamadiya

Copy link
Copy Markdown
Member

The Code Health page led with one number, roughly half of which comes from git
history. It fell through a week of good refactoring and never said why.

It now leads with two figures. Code health, footed by "Structure 8.4.
History pulls it to 7.0.", and Maintainability, which is code shape only
and the number a refactor actually moves. Neither changes value when the map
lens changes; the lens highlights one of them.

History findings are watch items, not work. In the file drawer they wear a
neutral chip with an explainer instead of the pillar's orange, and in both AI
prompts they move out of the fix list into the file's behaviour-over-time
section with an explicit instruction not to try to fix them. The drawer's
leading cause now passes over a history lead for the strongest code-shape
finding, and says so plainly when a file's whole deduction is history.

Only the three canonical bands are named anywhere. The lede and the file drawer
carried a five-band vocabulary of their own, so a 6.9 read "Good" in green
beside marks calling it "Warning" in amber. The map's four colour steps had
borrowed band words for ranges that did not match, and invented a "Fair" band
the product never returns; they name their score ranges instead. The map lens,
the coverage and test table headers and the file page follow the headline to
"Code health".

A production / all-code toggle in the page header narrows the overview, map,
trend, files, findings and work queue. Scope rides in the cache key as well as
the query, so a narrowed population cannot render under the previous label.

The trend chart gains a maintainability line and a shaded band for what history
costs, both drawn only across the snapshots that recorded them rather than
backfilled.

Server changes are held to what the screens could not be built without: the two
halves on the overview summary, a maintainability column on health_snapshots
with the three figures exposed per trend point, and scope on the findings
route.

Removes HealthKpiCards, the dashboard barrel and the legacy /health
redirect, none of which had a caller, and moves HealthScoreRing beside its
only consumer.

Verification

  • packages/ui 1,660 passed / 192 files; packages/web 84 passed / 16 files.
  • Root npm run type-check green across every workspace.
  • Python health and health-route suites green.
  • The trend route declares a response_model, which dropped the new per-point
    fields after serialization — they reached the browser as null with every
    unit test green. Two route-level tests now cover the model itself.
  • Screenshot pass in light and dark over the overview, the maintainability
    lens, the production scope, the drawer, the prompt modal and the trend.
  • The lede's two figures were read out of the DOM under both lenses to confirm
    they hold at 7.0 / 8.0 and only the label colour changes.

…watch

The Code Health page led with one number that half comes from git history, so
it fell through a week of good refactoring and never said why. It now leads
with two: Code health, footed by "Structure 8.4. History pulls it to 7.0.", and
Maintainability, which is code shape only and the number a refactor moves.
Neither changes value when the map lens changes; the lens highlights one.

History findings are watch items, not work. In the drawer they wear a neutral
chip with an explainer instead of the pillar's orange, and in both AI prompts
they move out of the fix list into the file's behaviour-over-time section with
an explicit instruction not to try to fix them. The drawer's leading cause now
passes over a history lead for the strongest code-shape finding, and says so
when a file's whole deduction is history.

Only the three canonical bands are named. The lede and the file drawer had a
five-band vocabulary of their own, so a 6.9 read "Good" in green beside marks
calling it "Warning" in amber; the map's four colour steps borrowed band words
for ranges that did not match, and invented a "Fair" band the product never
returns, so they name their score ranges instead. The map lens, the coverage
and test table headers and the file page follow the headline to "Code health".

A production/all-code toggle in the page header narrows the overview, map,
trend, files, findings and work queue. Scope rides in the cache key as well as
the query, so a narrowed population cannot render under the previous label.

The trend gains a maintainability line and a shaded band for what history
costs, both drawn only across the snapshots that recorded them.

Server changes are the ones the screens could not be built without: the two
halves on the overview summary, a maintainability column on health_snapshots
with the three figures exposed per trend point, and scope on the findings
route. The trend route's response model dropped the new per-point fields after
serialization, which reached the browser as nulls with every unit test green,
so two route-level tests now cover the model itself.

Removes HealthKpiCards, the dashboard barrel and the legacy /health redirect,
none of which had a caller in either repository, and moves HealthScoreRing
beside its only consumer.
@repowise-bot

repowise-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🔍 3 things to check

  1. PageLede in .../shared/page-lede.tsx signature changed. Review 17 callers outside this PR: .../commits/commit-detail-card.tsx::CommitDetailCard, .../commits/commits-lede.tsx::CommitsLede, .../dead-code/dead-code-lede.tsx::DeadCodeLede (+14 more)
  2. save_health_snapshot in .../analysis/health.py signature changed. Review 6 callers outside this PR: .../generation/test_editor_file_fetcher.py::test_code_health_trend_is_read_from_the_snapshots, .../persistence/test_health_overview_reads.py::_history, .../persistence/test_health_overview_reads.py::test_snapshot_file_counts_matches_the_headline_ordering (+3 more)
  3. listHealthFindings in .../src/code-health.ts signature changed. Review 3 callers outside this PR: .../core/fileSignals.ts::getFileFindings, .../code-health/coverage-tab.tsx::CoverageTab, .../code-health/performance-tab.tsx::PerformanceTab
    ...and 3 more, on the PR page

✅ Health of changed files: 4.8 (unchanged)
🚨 Change risk: high, riskier than 71% of this repo's commits.

✅ Health gate: passed


📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot · Updated 2026-09-08 06:58 UTC

… test

Both are CI failures from the change that renamed the code-health headline.
The import block lost its order when a symbol was added to it, and the VS Code
webview test still looked for "Defect risk" on a lede that now says "Code
health" — and the new label collides with the page title, so the assertion
names the figure's own label rather than the first match.
@swati510
swati510 merged commit 8052986 into main Sep 8, 2026
8 checks passed
@swati510
swati510 deleted the feat/health-first-screen branch September 8, 2026 16:08
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