feat(vault): show Healthy label when health factor exceeds 50#1784
feat(vault): show Healthy label when health factor exceeds 50#1784jonybur wants to merge 3 commits into
Conversation
jonybur
commented
May 27, 2026
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
🔐 Commit Signature Verification✅ All 3 commit(s) passed verification
Summary
Required key type: Last verified: 2026-05-28 16:35 UTC |
Greptile SummaryThis PR adds a compact Healthy label for very high Aave health factors. The main changes are:
Confidence Score: 4/5This is close, but the formatter scope should be fixed before merging.
Important Files Changed
Reviews (1): Last reviewed commit: "feat(vault): show Healthy label when hea..." | Re-trigger Greptile |
gbarkhatov
left a comment
There was a problem hiding this comment.
Approving — the substantive Greptile findings (action delta regression, repay preview asymmetry, unbounded consistency) were correctly resolved in the revision cycle by moving the label out of formatHealthFactor into the Overview call site.
Two follow-ups worth folding in (left inline):
- Add a test that pins
formatHealthFactorto numeric output for high HF, so the invariant currently documented only in a comment can't silently regress. - Point
STATUS_LABELS.safeinhealthFactorGauge.tsat the newCOPY.overview.healthFactorHealthykey — same word, same screen, two sources today.
| * intentionally do not, to preserve the magnitude of the change. */ | ||
| export const HEALTH_FACTOR_HEALTHY_THRESHOLD = 50; | ||
|
|
||
| export function formatHealthFactor(healthFactor: number | null): string { |
There was a problem hiding this comment.
The invariant from the revision cycle — label substitution lives at the call site, never inside this formatter — is now documented above (L28-30), but nothing in CI guards it. A future tidy-up that pushes the > HEALTH_FACTOR_HEALTHY_THRESHOLD check back into formatHealthFactor would silently regress all three Greptile findings (action deltas would show Healthy → Healthy, repay preview would flip back to the Healthy vs - asymmetry, etc.).
A single test pins it:
// services/vault/src/applications/aave/utils/__tests__/healthFactorDisplay.test.ts
it("returns the raw number for high HF (delta callers depend on this)", () => {
expect(formatHealthFactor(100)).toBe("100.00");
expect(formatHealthFactor(50)).toBe("50.00");
});No test file exists for this module today, so this would also seed the right home for future formatter tests.
| overview: { | ||
| heading: "Overview", | ||
| healthFactorLabel: "Health factor", | ||
| healthFactorHealthy: "Healthy", |
There was a problem hiding this comment.
This PR introduces the canonical key for the "Healthy" string — but STATUS_LABELS.safe in services/vault/src/components/shared/utils/healthFactorGauge.ts:10 still has "Healthy" inlined, and the gauge renders directly above this label in OverviewSection (same user, same screen). Not this PR's bug — it pre-dates — but this is the moment a canonical key exists, so worth pointing the gauge at it too. Otherwise a future copy change (e.g. "Healthy" → "Strong") silently de-syncs the two surfaces.