Skip to content

fix(platform): seven low-severity cleanups on /repos - #158

Merged
clickmatos merged 1 commit into
mainfrom
fix/repos-low-issues
Aug 13, 2026
Merged

fix(platform): seven low-severity cleanups on /repos#158
clickmatos merged 1 commit into
mainfrom
fix/repos-low-issues

Conversation

@clickmatos

Copy link
Copy Markdown
Contributor

Last batch from the /repos audit (after #156, #157) — the seven 🟢 low-severity findings.

Fixes

  1. Extracted isHyperEngineer() into lib/queries/org-summary.ts, replacing a hand-copied copy of the same threshold in the repo-detail page's badge logic. DRY only — the two copies happened to agree, but had no shared source of truth.
  2. Removed the dead adoption.confidence.insufficient translation keyAdoptionTimelineCard returns its own dedicated empty state for that confidence level before ever reaching the badge that would read it.
  3. Added deltaDecimals to MetricCard (default 0, every other call site unaffected) and set it to 1 on the repo-detail Revert Rate card — the value showed 1 decimal, the delta showed 0, so a 2.3%→2.9% move displayed as "+1pp".
  4. Low-sample caveat on tight-coupling hotspots below 5 joint changes — the engine's own floor for surfacing one at all is 3, so a 3-for-3 coupling rendered as confident "high severity, 100%" with nothing distinguishing it from dozens of occurrences.
  5. Fixed DistributionBar's total to sum only the keys it renders, matching FlowEfficiencyCard's already-correct pattern in the same file — latent today, would silently under-100% the bar if the engine ever adds an intent/origin value without a matching UI label.
  6. DORARepoCard always renders now, with an explicit empty state (matching Investment Hotspots and Adoption Timeline on the same page) instead of vanishing when there's no deployment data.
  7. Fixed /repos's "1 repositories" (always-plural) singular/plural bug, and wrapped lib/tenant.ts's checkTenantAccess in React's cache(), extending it to return the org id/name it already fetches — /repos was re-running its own org-by-slug + membership queries to recompute exactly what the [tenant] layout's own call had already resolved for the same request.

Verification

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

- Extracted the "hyper engineer" threshold (high_velocity_weeks > 0 ||
  ai_commit_pct >= 80) into a shared isHyperEngineer() in
  lib/queries/org-summary.ts. It was hand-copied into the repo-detail
  page's own badge logic — both copies happened to agree today, but had
  no shared source of truth to keep them that way.

- Removed the dead adoption.confidence.insufficient translation key.
  AdoptionTimelineCard returns its own dedicated empty state for that
  confidence level before ever reaching the badge that would have read
  it — a badge label for a value the component can never receive.

- Added a deltaDecimals prop to MetricCard (defaults to 0, so every
  existing call site is unaffected) and set it to 1 on the repo-detail
  Revert Rate card, matching the value's own 1-decimal display. A move
  from 2.3% to 2.9% was showing delta "+1pp" (rounded from +0.6) next
  to a value with finer precision than its own trend indicator.

- Added a low-sample caveat to tight-coupling hotspots below 5 joint
  changes. The engine's own floor for surfacing one at all is 3, so a
  3-for-3 coupling was rendering as a confident "high severity, 100% of
  the time" with nothing distinguishing it from a coupling backed by
  dozens of occurrences.

- Fixed DistributionBar (repo-detail's intent/origin bars) to sum only
  over the keys it actually renders, matching FlowEfficiencyCard's
  already-correct pattern in the same file. Previously it summed every
  key in the raw payload — latent today (the label maps are exhaustive
  for the current enums) but would silently under-100% the rendered
  segments the day the engine adds a value without a matching label.

- DORARepoCard now always renders, with an explicit empty-state card
  (mirroring Investment Hotspots and Adoption Timeline on the same
  page) instead of just vanishing when there's no deployment data in
  the window — previously the only DORA-adjacent section on the page
  with no explanation for its own absence.

- Fixed /repos always rendering "{count} repositories" (plural) even
  for count=1, matching the singular/plural pattern already used by
  connect-view.tsx. Also wrapped lib/tenant.ts's checkTenantAccess in
  React's cache() and had it return the org id/name it already fetches
  internally — /repos was re-running its own org-by-slug and
  membership-by-user queries to recompute exactly what the [tenant]
  layout's own checkTenantAccess call had already resolved for the
  same request; now it just calls the same (deduped) function.

Added a regression test for isHyperEngineer. The other six fixes are
UI-only or direct-DB-query code this codebase doesn't unit-test
anywhere (same convention noted in the two prior PRs on this page).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clickbus-iris Ready Ready Preview Aug 13, 2026 8:52pm

Request Review

@clickmatos
clickmatos merged commit 87cf121 into main Aug 13, 2026
5 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