Skip to content

fix(console): render unknown utilisation as unknown - #18

Merged
alice-viola merged 2 commits into
masterfrom
fix/null-budget-utilisation
Sep 7, 2026
Merged

fix(console): render unknown utilisation as unknown#18
alice-viola merged 2 commits into
masterfrom
fix/null-budget-utilisation

Conversation

@albertovincenzi

Copy link
Copy Markdown
Collaborator

Problem

The API deliberately returns utilisation: null for scoped budgets because there is no single live counter. The shared Vue helper fell back to (value ?? 0) / ceiling, turning that explicit unknown into 0%. Budget History then displayed an empty green bar as if nothing had been spent.

Fix

  • preserve an explicit null utilisation;
  • return unknown when neither value nor used exists or the ceiling is unusable;
  • allow BudgetBar to receive a null used value;
  • render an explanatory unknown state instead of a zero-width green fill;
  • stop Budget History from coercing null to zero.

Review notes for Alice

Known zero remains 0%; only missing/null data becomes . Existing overview and shared-budget bars continue to pass numeric values. The helper change centralizes the semantic distinction already documented in the API code.

Verification

  • npm run build
  • direct Node assertions for explicit null, absent value, and a known 5/10 value

albertovincenzi and others added 2 commits September 4, 2026 23:19
`BudgetBar` learned to render an absent value as unknown and `BudgetHistory`
was updated to stop coercing one, but `SharedBudgets` still passed
`b.used ?? 0`. A shared per-key budget with no single live counter therefore
kept drawing a bar at 0% in that view — the exact reading this change exists to
remove, and the one place an operator goes to compare counters across graphs.

`Targets.vue` and `Overview.vue` already pass `worst_used` through untouched,
and that field is never null, so they needed nothing.

Claude-Session: https://claude.ai/code/session_012K8u7BEJyd6nDNMCQAgH3z
@alice-viola
alice-viola merged commit 2159c83 into master Sep 7, 2026
1 check 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.

2 participants