Skip to content

fix(templates): give Sponsors Goal and Milestone number fields a slider range - #305

Merged
anurag629 merged 1 commit into
codercops:devfrom
prakashNalla:fix/editor-number-slider-range
Oct 28, 2026
Merged

anurag629 merged 1 commit into
codercops:devfrom
prakashNalla:fix/editor-number-slider-range

Conversation

@prakashNalla

Copy link
Copy Markdown
Contributor

Description

Raised and Goal on Sponsors Goal and Closed and Total on Milestone had no min/max, so the editor's SliderControl gave them its 0 to 100 default and both Sponsors Goal defaults (420 and 1000) started out of range. They now have min: 0 with max: 10000 for Raised and Goal and max: 1000 for Closed and Total.

I also added a registry test that every number field's default sits inside its slider range, using the same 0/100 fallback as SliderControl, so a new template can't ship with the same problem. These were the only 4 of the 17 number fields without a max.

Closes #302

How I Tested This

On npm run dev, /create/github?template=github-sponsors-goal, Customize tab:

  • Before: Goal showed 1000 with the range input at 100 (its max), Raised showed 420 with the input at 100, and one left arrow on Goal set it to 99
  • After: Raised is at 420 and Goal at 1000 with max=10000, and one left arrow on Goal sets it to 999

The new test in tests/templates/registry.test.ts fails without the template changes (github-sponsors-goal.raised: expected 420 to be less than or equal to 100) and passes with them.

npm run check: 0 errors, 0 warnings. npm run test: 77 files, 1539 tests pass. agenda.test.ts timed out once at 5000ms ("renders valid SVG and PNG for 2, 3, and 4 sessions") in the full run and passes on its own. npm run build: passes.

AI Assistance

Claude helped me w/ understand the issue

Type of Change

  • Bug fix

Screenshots

N/A, the rendered images don't change. The fix is the slider range in the editor, and the before and after values are above.

Checklist

  • This PR targets dev
  • I was assigned the linked issue
  • npm run check passes
  • npm run test passes
  • For a bug fix: the new test fails without my change
  • Tested locally with npm run dev
  • Screenshots included for visual changes
  • New templates follow the Template Guidelines

@anurag629 anurag629 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @prakashNalla, small and right. Check (0 errors), all 1539 tests and the build pass on top of dev. The editor passes min/max straight to SliderControl, so Raised and Goal now go to 10,000 and Closed and Total to 1,000 with every default inside its range, and the new registry test will catch the next template that ships a default outside its slider.

@anurag629 anurag629 added the hacktoberfest-accepted PR counts for Hacktoberfest label Oct 28, 2026
@anurag629
anurag629 merged commit a530dbf into codercops:dev Oct 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted PR counts for Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: the Sponsors Goal and Milestone sliders can't go above 100

2 participants