Skip to content

Fix explicit percentages in bounded number fields - #153

Merged
brachy84 merged 3 commits into
masterfrom
fix/percentage-to-long
Jul 26, 2026
Merged

Fix explicit percentages in bounded number fields#153
brachy84 merged 3 commits into
masterfrom
fix/percentage-to-long

Conversation

@Worive

@Worive Worive commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Fixes bounded numeric text fields interpreting 100% as the absolute value 1 instead of the configured maximum.

The original input expression is now preserved during validation, allowing explicit percentages to be distinguished from ordinary numeric values:

  • 1 remains 1
  • 50% resolves to half the maximum
  • 100% resolves to the maximum

Includes regression tests covering absolute, fractional, and explicit percentage inputs.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

Comment thread src/main/java/com/cleanroommc/modularui/widgets/textfield/TextFieldWidget.java Outdated
@Worive
Worive requested a review from brachy84 July 26, 2026 09:44
@brachy84
brachy84 merged commit fd35e07 into master Jul 26, 2026
1 check passed
@brachy84
brachy84 deleted the fix/percentage-to-long branch July 26, 2026 10:21
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