Skip to content

Fix backwards custom year range selection on chart page#218

Draft
tika wants to merge 1 commit intomainfrom
cursor/fix-year-range-backwards-8407
Draft

Fix backwards custom year range selection on chart page#218
tika wants to merge 1 commit intomainfrom
cursor/fix-year-range-backwards-8407

Conversation

@tika
Copy link
Copy Markdown
Collaborator

@tika tika commented Apr 16, 2026

Issue

#207 #207

Who worked on this sprint/bug?

Cursor cloud agent

Who did what on this sprint/bug?

Implemented year range normalization logic on the chart page so custom ranges are always valid, and added user feedback when invalid input is auto-corrected.

Features Implemented

  • Prevent invalid custom year ranges from being applied when end year is less than start year.
  • Auto-swap start/end years on Apply for backward ranges.
  • Show a warning toast when an entered backward range is auto-corrected.
  • Normalize startYear/endYear query params loaded from URL so shared links with reversed years still render correctly.
  • Ensure all filtering/title/date calculations use a normalized year range.

New files created

  • None

Existing files modified

  • src/app/chart/page.tsx

Acceptance Criteria

  • Backward year selections are no longer silently accepted. ✅
  • Invalid custom ranges are corrected automatically. ✅
  • User receives clear feedback when correction occurs. ✅

Testing: how did you test?

  • Manual reasoning and code-path verification of custom year range apply flow and URL query normalization flow.
  • Additional lint/build checks to be run in follow-up validation.

Features Not Implemented/Incomplete

  • No dedicated unit tests were added because the repository currently has no test harness configured for this page/component.

Bugs Discovered

  • None beyond the reported issue.

Screenshots:

  • None

Tag Dan and Shayne

@danglorioso @shaynesidman

Open in Web Open in Cursor 

Co-authored-by: tika <tika@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

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

Project Deployment Actions Updated (UTC)
mhd Ready Ready Preview, Comment Apr 16, 2026 1:37am

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