Skip to content

Remove redundant plate filtering from validPlates memo - #18

Merged
benmosher merged 3 commits into
mainfrom
claude/fix-slider-plate-limits-demmb
Mar 5, 2026
Merged

Remove redundant plate filtering from validPlates memo#18
benmosher merged 3 commits into
mainfrom
claude/fix-slider-plate-limits-demmb

Conversation

@benmosher

Copy link
Copy Markdown
Owner

No description provided.

claude added 3 commits March 4, 2026 16:59
The range slider step was computed from the globally smallest plate,
ignoring per-bar plateThreshold and plateLimits constraints. This caused
the slider to offer unreachable weight values.

Two fixes:
- Filter plates by selected bar's constraints (plateThreshold, plateLimits
  with count 0) when computing the slider step size
- Snap slider onChange to nearest achievable weight via closestTarget

Also extracts selected bars into a shared memo to avoid duplicating the
bar filter logic between possibleWeights and sliderPlates.

https://claude.ai/code/session_011VVJjPYdBePnMQM61MbuY8
Both determineWeightSpace and determinePlates already re-apply bar
constraints internally, so filtering earlier in validPlates is safe
and removes the unnecessary sliderPlates indirection.

https://claude.ai/code/session_011VVJjPYdBePnMQM61MbuY8
determineBarWeightSpace and _greedyPlates already filter plates
per-bar (plateThreshold + plateLimits), so the pre-filter was
redundant and subtly incorrect (applying a union across all bars
rather than per-bar constraints).

https://claude.ai/code/session_011VVJjPYdBePnMQM61MbuY8
@benmosher
benmosher merged commit 4098c99 into main Mar 5, 2026
1 check passed
@benmosher
benmosher deleted the claude/fix-slider-plate-limits-demmb branch March 5, 2026 18:45
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