Skip to content

feat(health): make the Coverage tab a Tests tab that answers without a report - #1758

Merged
swati510 merged 4 commits into
mainfrom
feat/tests-tab-ui
Aug 19, 2026
Merged

swati510 merged 4 commits into
mainfrom
feat/tests-tab-ui

Conversation

@RaghavChamadiya

@RaghavChamadiya RaghavChamadiya commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Test intelligence went from something you configure to something you have. The CLI and MCP tools already reflect that; the web UI was the last layer still assuming a coverage report is the only way to know whether code is tested, and in two places it contradicted the product:

  • The empty state sent people away to ingest a report while claiming "Nothing is inferred: we read the lines your tests really executed" — untrue since the graph could answer.
  • The lede repeated the claim.

Coverage → Tests

The health tab, the file-page tab and the breadcrumb. The URL stays /coverage.

One tab, two bases. A second tab would split one question — is this tested? — across two places and make you check both to be sure. Inside the tab, "coverage" still means the measured thing.

The chart

RiskCoverageScatter takes a basis prop rather than being rewritten. On the inferred basis the X axis collapses from a 0–100 continuum to two positions: nothing reaches this file, or something does.

That is the point, not a fallback. Two columns read as coarser than a measurement without needing a disclaimer, and ingesting a report becomes the axis gains focus rather than the price of entry. A gradient that is never drawn cannot be misread as one.

The columns are beeswarmed because X carries a single bit there, so without spread a thousand files stack into two lines and the mass is invisible. The jitter is seeded off a hash of the file path, so re-rendering does not move the field.

Dots are plum for "nothing reaches it" and orange for "a test reaches it", not the red/amber/green health ramp. Those colours carry a measured band, and a static reading should not borrow them. Height already is the health score, so banding the dots would only re-say their own position while leaving nothing to carry the split.

No percentage anywhere on the inferred basis

The hero figure is a small integer — risky files nothing reaches — because "1,074 of 2,185 reached" invites a progress bar, and a progress bar is the coverage percentage this data cannot claim. A test asserts no % and no bar element renders.

The file page

Names the tests that reach a file, distinguishing a test whose calls run into it from one that only imports it. This works on install, with no setup, and its no-report state is no longer a dead end.

Also fixed

  • The file tab's description claimed "Line coverage, once a test report has been ingested", which is no longer true above its empty state.
  • A duplicate-key bug: the health drawer already had a "Tests" metric cell, so its coverage cell keeps its old name.
  • A "1 are reached" plural bug.

Carries one server change

include_inferred=false lets a caller decline the graph fallback. The code-health page badges this tab from a deliberately cheap request, and without this that request would read every call edge in the repository to compute a number the badge cannot render anyway. It was part of #1757 but did not make its squash, so it rides here.

Checks

Typecheck clean across types, api-client, ui and web. Full packages/ui suite green at 1,209 tests, 13 of them new. Verified against a live index in the browser on both bases.

@repowise-bot

repowise-bot Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Health of changed files: 7.2 → 7.5 (+0.4)
🚨 Change risk: high, riskier than 83% of this repo's commits.

📋 At a glance
1 file changed health · 5 hotspots touched · 4 new findings introduced · 5 files with recent fix history · 1 dead-code finding. Scoped to packages.

✅ Health gate: passed

📌 Before you merge

  • Run .../src/hosted.fixtures.test.ts, .../__tests__/health.test.ts, .../health/churn-complexity-quadrant.test.tsx, .../files/file-decisions-tab.test.tsx (+3 more): they import the changed files

🎯 Blast radius (symbols whose signature this PR changed, and who calls them)

  • getHealthCoverage in .../src/code-health.ts signature changed. Called by 2 symbols outside this PR: .../code-health/findings-tab.tsx::FindingsTab, .../code-health/triage-tab.tsx::TriageTab
  • buildFilePanels in .../files/file-page-panels.tsx signature changed. Called by 1 symbol outside this PR: .../files/file-decisions-tab.test.tsx::renderPage
🔎 More signals (3)

🗺️ Change map

flowchart LR
  subgraph PR ["Changed in this PR (5 modules)"]
    m_packages_api_client["packages/api-client (1 file)"]:::changed
    m_packages_server["packages/server (1 file)"]:::changed
    m_packages_types["packages/types (1 file)"]:::changed
    m_packages_ui["packages/ui (8 files)"]:::changed
    m_packages_web["packages/web (1 file)"]:::changed
  end
  d_packages_vscode["packages/vscode"]
  m_packages_api_client -->|3 files| d_packages_vscode
  d_packages_web["packages/web"]
  m_packages_ui -->|2 files| d_packages_web
  d_packages_api_client["packages/api-client"]
  m_packages_types -->|1 file| d_packages_api_client
  d_packages_server["packages/server"]
  m_packages_types -->|1 file| d_packages_server
  d_packages_server["packages/server"]
  m_packages_ui -->|1 file| d_packages_server
  classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
  classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
  classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Loading

Solid arrows: code that imports the changed files (59 direct dependents, from the last indexed snapshot). Dashed: history/tests.

🔥 Hotspots touched (5)

  • .../files/file-page-header.tsx: 2 commits/90d, 3 dependents
  • .../files/file-page-tabs.ts: 4 commits/90d, 5 dependents
  • .../[...path]/page.tsx: 5 commits/90d, 0 dependents
2 more
  • .../files/file-coverage-tab.tsx: 4 commits/90d, 2 dependents
  • .../code-health/page.tsx: 9 commits/90d, 0 dependents

💀 Dead code (1 finding)

  • 💀 .../layout/repo-breadcrumb-label.ts SEGMENT_LABELS (confidence 0.65)

📊 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-08-19 18:34 UTC (since the last push: 2 new findings)

…a report

The core answers "does a test reach this file" from the call graph, and #1757
carries that to the API as a `basis`. The UI was the last layer still assuming
a coverage report is the only way to know, and in two places it contradicted
the product: the empty state told people to go ingest one while claiming
"Nothing is inferred: we read the lines your tests really executed", and the
lede repeated the claim. Both now read as they should.

Coverage -> Tests on the health tab, the file-page tab and the breadcrumb. The
URL stays `/coverage`. One tab, two bases: splitting them would put one
question ("is this tested?") in two places and make the reader check both to be
sure. Inside the tab "coverage" keeps meaning the measured thing, which is why
the health drawer's metric cell stays "Coverage" - a "Tests" cell already sits
four rows under it carrying the paired-file flag.

The chart is the same component with a prop, not a second chart. On the
inferred basis X collapses from a 0-100 continuum to two positions, which is
the honest statement about the evidence: two columns read as coarser than a
measurement without a disclaimer nobody reads, ingesting a report becomes "the
axis gains focus" rather than the price of entry, and a gradient that is never
drawn cannot be misread as one. The columns are beeswarmed because X carries
one bit there, so horizontal space is otherwise dead and a thousand files stack
into two lines; the jitter is seeded off the file path so a re-render does not
move the field.

Column grounds are the sunset pair, plum and orange, not green and red. Health
bands are reserved for health readouts, and painting a static reading in band
colours would make it look like a measurement. The dots keep their health band,
which is a different mark on a different object, so nothing collides.

Nothing on the inferred basis is a percentage or a bar. The hero is a small
integer - risky files nothing reaches - because "1,074 of 2,185 reached" begs
for a bar and a bar is a percentage. A test asserts no `%` appears anywhere in
the rendered view.

The file page is the piece that works on install: it names the tests that reach
this file, with `via` separating a test whose calls run into it from one that
only imports it. Its no-report state stops being a dead end.

Also fixes a false tab description ("Line coverage, once a test report has been
ingested") which the tab's own docstring requires to stay true above the empty
state, and a "1 are reached" plural bug the tests caught.

12 new tests; full packages/ui suite green (1,208).
Pairs with the server side. The badge reads one number off `summary`, so it
already declines file rows and modules; it now also declines the inferred map,
which it could not render anyway - the inferred basis has no percentage, by
design.
The code-health page badges the Tests tab from a deliberately cheap request:
`limit=1, module_limit=0`, which its own comment measures at 0.7 KB against the
tab's 442 KB. The inferred fallback made that call read every call edge in the
repository plus every health metric, on any repo without a coverage report.

`include_inferred=false` declines it. Not a third cap: the other two bound how
much of an answer comes back, this one decides whether an expensive second
answer is computed at all.

A declined response omits `basis` rather than reporting "none". The graph was
not consulted, which is not the same as the graph having nothing to say, and
collapsing the two would leave a consumer unable to tell a repo with no tests
from a request that never asked.
The inferred chart painted its two columns as a 6% ground and left the dots on
the health ramp. On screen that failed twice over: plum at that opacity is
indistinguishable from grey on a light background, so the split was invisible,
and the health-banded dots took the entire visual budget to re-say what their
own vertical position already said.

Health is the Y axis. Colouring a dot by health band is therefore redundant,
and it left nothing carrying the one fact the chart exists to show. The dots now
take plum for "no test reaches it" and orange for "a test reaches it", and the
grounds are gone rather than competing with them.

This also keeps green/amber/red off inferred data, which is the point: those
carry a measured band, and a static reading should not borrow them.
@RaghavChamadiya
RaghavChamadiya changed the base branch from feat/coverage-basis-api to main August 19, 2026 18:33
@swati510
swati510 merged commit a06bebc into main Aug 19, 2026
1 check passed
@swati510
swati510 deleted the feat/tests-tab-ui branch August 19, 2026 18:45
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