Skip to content

Fix chart year filter allowing negative values#222

Draft
tika wants to merge 3 commits intomainfrom
cursor/fix-negative-year-filter-117b
Draft

Fix chart year filter allowing negative values#222
tika wants to merge 3 commits intomainfrom
cursor/fix-negative-year-filter-117b

Conversation

@tika
Copy link
Copy Markdown
Collaborator

@tika tika commented Apr 16, 2026

Issue

Who worked on this sprint/bug?

  • Cursor agent

Who did what on this sprint/bug?

  • Implemented year range sanitization and bounds normalization for the chart page custom year filter.

Features Implemented

  • Added centralized year-range normalization utilities in src/app/chart/page.tsx.
  • Clamped custom year input edits so values cannot go below allowed minimum bounds.
  • Normalized query-param-backed startYear/endYear values so invalid negatives cannot persist in URL state or UI.
  • Updated quick range presets (3y, 5y, all) to respect computed year bounds.

New files created

  • None.

Existing files modified

  • src/app/chart/page.tsx

Acceptance Criteria

  • Negative years should not be selectable or should show warning: Completed by preventing negative year selection and display in the chart year filter.

Testing: how did you test?

  • npm run lint
  • npm run build ❌ (fails in this environment due to missing DB env var: No database connection string was provided to neon() while collecting page data)

Features Not Implemented/Incomplete

  • No warning UI was added because invalid negative values are prevented/clamped from being entered or persisted.

Bugs Discovered

  • Build-time environment dependency issue unrelated to this change: missing database connection string in cloud environment.

Screenshots:

  • Not included.

Tag Dan and Shayne

@danglorioso @shaynesidman

Open in Web Open in Cursor 

@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 17, 2026 2:15am

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.

Year filter allows negative year values

2 participants