Skip to content

fix(profile): default usage chart to chronological order#874

Merged
junhoyeo merged 1 commit into
mainfrom
fix/profile-chart-chronological-default
Jul 13, 2026
Merged

fix(profile): default usage chart to chronological order#874
junhoyeo merged 1 commit into
mainfrom
fix/profile-chart-chronological-default

Conversation

@junhoyeo

@junhoyeo junhoyeo commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Default the profile Usage over time chart to chronological order at every viewport width.
  • Preserve explicit persisted Newest first choices and the existing toggle.
  • Add an SSR regression test for the unset chronological default.

Fixes #868

Validation

  • bun run lint -- src/components/profile/ProfileUsageChart.tsx __tests__/components/profileUsageChart.test.tsx
  • bun run typecheck
  • bun run test (601 tests)

Summary by cubic

Default the profile “Usage over time” chart to chronological order on all viewports. Keep the persisted “Newest first” preference and toggle; only an explicit preference reverses the chart. Fixes #868.

  • Bug Fixes
    • Remove viewport-based default; no media-query reversal.
    • Preserve saved newest-first preference; apply only when true after mount.
    • Add SSR test to ensure unset default renders chronologically and avoids hydration mismatches.

Written for commit 88224eb. Summary will update on new commits.

Review in cubic

Usage over time now remains oldest-left unless a visitor explicitly enables the persisted Newest first preference. This removes the viewport-dependent reversal that made the default differ on wide profiles.

Constraint: Existing saved Newest first choices must remain effective after mount
Rejected: Remove the preference toggle | Visitors need to retain their explicit visual-order choice
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep implicit chart order chronological; reverse only for an explicit user preference
Tested: Frontend ESLint and typecheck; frontend Vitest suite (601 tests)
Not-tested: Browser interaction test with real localStorage; SSR regression covers the unset initial render
Related: #868
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tokscale Ready Ready Preview, Comment Jul 13, 2026 4:40am

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@junhoyeo junhoyeo merged commit 0d2f0bb into main Jul 13, 2026
7 checks passed
@junhoyeo junhoyeo deleted the fix/profile-chart-chronological-default branch July 13, 2026 05:18
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.

graphs are backwards

1 participant