fix(platform): seven low-severity cleanups on /repos - #158
Merged
Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Last batch from the
/reposaudit (after #156, #157) — the seven 🟢 low-severity findings.Fixes
isHyperEngineer()intolib/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.adoption.confidence.insufficienttranslation key —AdoptionTimelineCardreturns its own dedicated empty state for that confidence level before ever reaching the badge that would read it.deltaDecimalstoMetricCard(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".DistributionBar's total to sum only the keys it renders, matchingFlowEfficiencyCard'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.DORARepoCardalways 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./repos's "1 repositories" (always-plural) singular/plural bug, and wrappedlib/tenant.ts'scheckTenantAccessin React'scache(), extending it to return the org id/name it already fetches —/reposwas 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
isHyperEngineer.npx tsc --noEmit: clean.npm run test: 263/263 passing (260 + 3 new).npm run lint: 0 errors, same 72 pre-existing warnings.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com