Skip to content

fix(frontend): keep usage chart date labels in bounds - #730

Merged
wesm merged 1 commit into
mainfrom
codex/fix-usage-view-date-display
Jun 18, 2026
Merged

fix(frontend): keep usage chart date labels in bounds#730
wesm merged 1 commit into
mainfrom
codex/fix-usage-view-date-display

Conversation

@cpcloud

@cpcloud cpcloud commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the usage page cost-over-time chart so the final date label stays inside the SVG bounds instead of being clipped at the right edge.

The chart previously centered the last x-axis date on the plot boundary while reserving only an 8px right gutter, which was not enough for month-day labels such as Jun 18. The chart now has a named right-side x-label gutter and subtracts that gutter from the plot width, preserving the overall SVG size while moving the last tick inward.

The regression coverage mounts the usage chart at the wide layout that exposed the clipping and checks that the rightmost label fits inside the viewBox. Reviewers should look at CostTimeSeriesChart.svelte for the layout change and CostTimeSeriesChart.test.ts for the focused coverage.

This also adds the product context and live-mode config files required by the frontend design workflow used for the fix.

The usage chart centered the final x-axis date on the plot's right edge while reserving only 8px after the plot. Month-day labels such as "Jun 18" extend farther than that, so the SVG viewBox clipped the rightmost label in the usage view.

Reserve a named right gutter for x-axis labels and subtract it from the plot width so the SVG remains the same overall size while the final tick lands inside the drawable area. Add a Vitest regression that drives the chart to the reported wide layout and checks the label bounds. The design workflow also now has product context and live-mode config for this Vite frontend.
@roborev-ci

roborev-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

roborev: Combined Review (e55babb)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 1m3s), codex_security (codex/security, done, 10s) | Total: 1m13s

@wesm
wesm merged commit 16ff029 into main Jun 18, 2026
21 checks passed
@wesm
wesm deleted the codex/fix-usage-view-date-display branch June 18, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants