Fix advancement percentage slider to skip invalid range below champions minimum#2103
Draft
Fix advancement percentage slider to skip invalid range below champions minimum#2103
Conversation
…rage - Fetch awards per division to count champions awards - Calculate minimum advancement percentage where all champions are covered - Slider snaps over the invalid range (1..minPercent-1): dragging up jumps to minPercent, dragging down jumps to 0 - Add a mark on the slider at the minimum percentage Agent-Logs-Url: https://github.com/FIRSTIsrael/lems/sessions/648015d3-06be-4d5f-90f9-8639b4122137 Co-authored-by: johnmeshulam <55348702+johnmeshulam@users.noreply.github.com>
…ifact Agent-Logs-Url: https://github.com/FIRSTIsrael/lems/sessions/648015d3-06be-4d5f-90f9-8639b4122137 Co-authored-by: johnmeshulam <55348702+johnmeshulam@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix advancement percentage for champions awards
Fix advancement percentage slider to skip invalid range below champions minimum
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Champions award winners always advance, so the slider previously allowed setting percentages that would advance fewer teams than champions awards — an invalid state. The slider now jumps directly from 0 (disabled) to the minimum percentage that covers all champions awards, then slides freely above that.
Changes
apps/admin/.../event-settings-section.tsxminAdvancementPercent: for each division, the smallest integerpwhereMath.round(teamCount × p / 100) ≥ championsCount, taking the max across divisionsMath.ceil((100 × champCount − 50) / teamCount)(derived fromMath.round(x) ≥ c ⟺ x ≥ c − 0.5)onChangesnaps values in(0, minPercent)based on drag direction: dragging up →minPercent, dragging down →0minAdvancementPercent(deduplicated against existing 25/50/75/100 marks)Type of change
Screenshots
UI change: slider now has a visible mark at the minimum valid non-zero percentage and skips over the invalid range.
Checklist