Skip to content

Value buttons for discrete numeric values: Range step, and numeric Values lists - #7

Merged
arithex merged 3 commits into
mainfrom
claude/range-step-buttons
Oct 30, 2026
Merged

arithex merged 3 commits into
mainfrom
claude/range-step-buttons

Conversation

@arithex

@arithex arithex commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

This follows UX feedback. When a param allows only a small set of numbers, the user now picks one from a grid of buttons instead of typing it. Values already in the files that break a param's constraints are now flagged with a warning.

Description syntax

  • Range: [20-120, by 20] allows only 20, 40, 60, 80, 100 and 120. It works for integer and float params, e.g. Range: [0.5-2.0, by 0.25]. A step needs a minimum. A step with no maximum, e.g. [0-, by 5], is still enforced when values are typed, but shows no buttons.
  • Values: [8,9,10,12,16]: when every entry is a number, these are the allowed values themselves, for integer and float params. When the entries are text, e.g. Values: [Low,Medium,High], they still label the values 0, 1 and 2 in the dropdown, as before.

UI

  • When there are 21 or fewer allowed values (ParamConstraints.MaxChoices), the detail pane shows a wrapping row of buttons in place of the text box, as in the mockup. The selected button gets the accent fill. Clicking a button stages the value, and Apply & Save writes it. Fill with default selects the default's button.
  • Button labels are the values as they'll be written: integers as plain numbers, floats with at least one decimal place (1.0, 0.75). A current value that doesn't match any button, e.g. one edited by hand, leaves no button selected.
  • With more than 21 values, the text box is shown, and typed values are checked against the step or the list.
  • The line under the param name lists numeric values (Values: 8, 9, 10, 12, 16) and shows the step in the range (Range: [20 to 120, by 20]).

Warnings for existing values (CLAUDE.md: "highlight that condition")

Values already in the files are never changed. They're flagged when they're:

  • out of range,
  • not on the step grid,
  • not in a numeric Values list,
  • outside an enum's labels, or
  • a feature-flag string that doesn't match its pattern.

How they're shown:

  • List: a warning triangle next to the current value, with a tooltip that says what's wrong.
  • Detail pane: a warning line for each value that breaks the rules: Default, User.cfg and VR.cfg. For example: "User.cfg value 50 is not allowed. Value must be a multiple of 20 from 20. Range: [20 to 120, by 20]".
  • The icon is a vector shape rather than the ⚠ text character, so it doesn't depend on fonts that may be missing under Wine.

Testing

  • 56 unit tests pass: the 51 existing ones plus 5 new.
    • Step grids for integers and floats, including that 0.1 steps survive floating-point rounding.
    • A typed value that's off the grid or out of range is rejected.
    • The 21-value threshold is enforced, and an unbounded step shows no buttons.
    • Numeric Values lists for integers (font sizes) and floats (the mockup's 0.5, 0.75, 1.0, 1.5, 2.0).
    • Existing-value warnings for steps, lists, enum labels and feature flags.
  • The C# compiles against the .NET 4.8 reference assemblies, using stand-ins for the code the XAML generates.
  • Windows CI build.
  • Manual check of the button grid against the mockup, and of the warnings, in both themes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KaEsnLMDyw72GZ8a6ZxAGq

…lues lists

Per UX feedback:
- "Range: [20-120, by 20]" allows only 20,40,...,120 (int or float).
- An all-numeric "Values: [8,9,10,12,16]" lists the allowed values
  themselves (text labels still map to 0,1,2... in a dropdown).
- When there are 21 or fewer allowed values, the detail pane shows a
  wrapping grid of buttons instead of the text box; the selected one is
  highlighted, and Apply & Save writes it. Typed values (when there are
  more than 21) are validated against the step / list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaEsnLMDyw72GZ8a6ZxAGq
Per CLAUDE.md: values already in the cfg files that are out of range, off
the step grid, not in a Values list, or invalid feature-flag strings are
kept as they are, but highlighted: a warning icon (with tooltip) next to
the value in the list, and a warning line per offending value (Default,
User.cfg, VR.cfg) in the detail pane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaEsnLMDyw72GZ8a6ZxAGq
Path has no FillRule property (it belongs to the geometry), so the style
setter failed the XAML compile (MC4005). Use the "F0" (even-odd) prefix in
the path data instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaEsnLMDyw72GZ8a6ZxAGq
@arithex
arithex merged commit 5ae70fb into main Oct 30, 2026
2 checks passed
@arithex
arithex deleted the claude/range-step-buttons branch October 30, 2026 02:04
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