Skip to content

fix(usage): say when cost is unavailable instead of $0.00

MacroscopeApp / Macroscope - UI Consistency failed Aug 16, 2026 in 2m 4s

UI Consistency: 3 issues found

Reviewed the changed web usage surface (apps/web/src/components/usage/**). Three concrete findings, all posted as inline comments:

  • apps/web/src/components/usage/UsagePage.tsx (line 281-284): the cost-unavailable chart placeholder reserves only h-56, while UsageProviderChart occupies h-56 plus gap-1 and the x-axis label row. Toggling cost/tokens with rates unavailable shifts the page below the chart. UsageSkeleton already mirrors the full chart geometry for this reason.
  • apps/web/src/components/usage/UsagePage.tsx (line 391): the model breakdown puts the sentence "Cost unavailable" in a right-aligned tabular-nums cell sized for $0.00 on every row, while the adjacent Share column uses — for the same state.
  • apps/web/src/components/usage/UsagePage.tsx (line 441, also 445): the time breakdown repeats the same sentence across every provider column and the total column on each row, widening the numeric columns.

Minor note also posted: apps/web/src/components/usage/usageCost.test.ts duplicates, byte for byte, the formatUsageCost cases this PR adds to packages/shared/src/usageFormat.test.ts.

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/ui-consistency.md
More information about how Check Run Agents work can be found in our Help Center.

Methodology:

  • Read the full head version of apps/web/src/components/usage/UsagePage.tsx and UsageProviderChart.tsx to compare the placeholder footprint against the real chart (plot row h-56 + flex flex-col gap-1 + text-[10px] axis label row, gutter w-14/pl-16).
  • Confirmed text-muted-foreground is the correct web token (the mobile text-foreground-muted usage in the same PR is a separate design system and out of scope).
  • Confirmed vite-plus/test is the correct web test runner import, so the new web test file is a placement/duplication issue only, not a wiring error.
  • Checked the mobile counterpart for context: it substitutes a placeholder of exactly CHART_HEIGHT, matching the chart it replaces, which the web placeholder does not.
  • No findings raised on the shared formatUsageCost helper, the merged pricingStatus propagation, the coverage-notice copy, or the metric tile detail text; those are consistent with existing patterns.

Files examined: apps/web/src/components/usage/UsagePage.tsx, apps/web/src/components/usage/UsageProviderChart.tsx, apps/web/src/components/usage/usageCost.test.ts, plus packages/shared/src/usageFormat.ts, packages/shared/src/usageMerge.ts, and apps/mobile/src/features/usage/UsageRouteScreen.tsx as context.


🔍 Agent activity — 1 tool call

💭 Looking at the usage page components and test files to check the chart placeholder styling and verify whether the text color token matches the project's conventions — specifically comparing text-muted-foreground against what's used elsewhere in the codebase like text-foreground-muted. I'm checking the placeholder styling for the chart — it uses h-56 with flexbox centering, but I need to verify this won't cause layout shifts since the actual UsageProviderChart has a w-14 axis gutter and additional space for the legend and x-axis labels below. There's also a potential issue when cost data is unavailable and the metric value is missing. I'm noticing a layout shift issue where the chart container shrinks by about 17 pixels when switching between metrics if cost data isn't available—the placeholder is shorter than the full chart with its axis labels and spacing, so toggling creates a minor visual jump. The table's empty state with "Cost unavailable" repeated across multiple columns creates a visual clutter problem—especially in the time breakdown table where four columns would each display that same 16-character string, making the table much wider and harder to scan. The "Share" column handles this better with an em dash, so there's an inconsistency in how unavailable data is presented across the table. I should flag the formatCost() function rendering "Cost unavailable" in those dense tabular cells as a concrete regression, since it breaks the layout and contradicts the design choice already made for the adjacent column. The mobile app and the duplicate test file are outside the scope of this review. I'm noticing there's a duplicate test file in the web app that mirrors one from the shared packages exactly—same four test cases, which seems redundant since the web test doesn't add anything new. The question is whether this counts as a UI consistency violation under the PR's check spec, which addresses tests for visual migrations but doesn't explicitly cover duplicate test scenarios. Looking at the actual UI issues, I see two concrete findings worth flagging: the breakdown tables show "Cost unavailable" repeated across cells, which is inconsistent with the "—" dash used elsewhere and disrupts the right-aligned tabular-nums formatting—I'd suggest using the dash consistently. And the chart placeholder height doesn't match the actual chart geometry (the h-56 plot plus the gap and axis label row), which causes a layout shift when toggling metrics. The repo intentionally mirrors chart dimensions in the skeleton to prevent this, so I should verify the exact line height calculation for the axis labels to confirm the mismatch. nt — it's a concrete duplicate test in the same PR that should be deleted. The shared test file also has a trailing blank line added, but that's minor. Now I'm weighing severity. The findings are real but moderate. The table repetition issue is significant — 40 instances of "Cost unavailable" across provider rows — and combined with the layout shift, this feels like it justifies a failure state given the risk of consistency issues. For inline comments, I need to map the line numbers in the head file: the chart placeholder spans lines 281-284, the model table cost cell is at line 391, and the time table cells are around 441 and 445. I'll place one comment at line 391 for the model table and another covering the time table range to keep feedback focused. I'm deciding between posting one comment covering both tables or splitting them across lines 391 and 441 to give reviewers clear location context. I'll go with separate comments for clarity. Now I'm drafting the first comment about the placeholder height on line 282—it's shorter than the actual chart because of the gap and axis label, which causes layout shift when toggling cost/tokens. I could suggest wrapping the placeholder in a flex container that matches the full chart footprint to reserve space properly. Fixing the indentation for the cost display... I should verify that the test file exists and check whether the shared tests are genuinely duplicated across the PR. The formatCost function also handles the "Cost unavailable" case for metrics that lack rate table data, which looks fine. The main headline displaying the merged cost could wrap if the "Cost unavailable" string is long, but that's acceptable given the column width. Now I'm ready to post the review with inline comments tied to the specific diff line numbers.

1. modify_pr — UI consistency review of the changed web usage surface. Three findings, all in apps/web/src/components/usage: the cost-unavailable placeholder does not reserve the chart's full footprint, and the long "Cost unavailable" sentence is rendered inside dense right-aligned table cells where the sibling Share column already uses an em dash. One minor note on the duplicated test file.


Agent Credits: 100 credits