fix: typing decimals with a zero following the decimal point in app number fields - #460
Merged
Merged
Conversation
The number input was controlled by the parsed value, so typing "0.0" on the way to "0.01" parsed to 0 and re-rendered the field as "0", making the value impossible to enter. Keep the raw typed text as a draft and show it while it still parses to the stored value, so external resets still take effect. Add a Playwright test, since jsdom does not reproduce the browser's number-input behavior.
pixi run test-ui runs "npm run test", and npm consumes flags such as --ui, --trace, and -g as its own options unless they follow a "--". The documented single "--" only separates pixi's arguments, so these flags never reached Playwright. Add the second "--" for npm. Also explain how to use UI mode from a remote machine by serving it over HTTP and forwarding the port.
allison-truhlar
marked this pull request as ready for review
October 2, 2026 15:27
krokicki
reviewed
Oct 2, 2026
|
|
||
| ```bash | ||
| pixi run test-ui -- --ui --debug | ||
| pixi run test-ui -- -- --ui --debug |
Member
There was a problem hiding this comment.
Seems like something went wrong here?
Collaborator
Author
There was a problem hiding this comment.
Yes - not directly related to this PR, but I was trying to run the test in the Playwright UI mode and it wasn't working. It turned out npm run was swallowing the extra flags. Adding a double -- -- prior to the flags fixed it.
|
|
||
| ```bash | ||
| pixi run test-ui -- --trace on | ||
| pixi run test-ui -- -- --trace on |
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.
Addresses issue #459.
Number fields on the app launch form reject some decimal values as you type
them. Typing
0.01into a field ends up as1: when you reach0.0, the formparses it to
0and redraws the field as0, which drops the decimal pointbefore you type the last digit. Values with no zero right after the point,
such as
0.3and1.01, aren't affected.This PR keeps the text you type in the field while it still equals the stored
number, so intermediate states like
0.0stay on screen. When the stored valuechanges some other way, for example when saved parameters are loaded, the
field shows the new value.
What changed
frontend/src/components/ui/AppsPage/AppLaunchForm.tsx:ParameterFieldkeeps the raw input text for
numberandintegerfields and shows itwhile it parses to the stored value. The form still stores numbers, so
validation, submission, and relaunch are unchanged.
CLAUDE.mdanddocs/Development.md: thepixi run test-uiexamples nowuse
-- --.test-uirunsnpm run test, and npm takes flags such as--ui,--trace, and-gas its own options, so with a single--theynever reached Playwright.
docs/Development.md: adds instructions for running Playwright UI modeon a remote machine by serving it over HTTP and forwarding the port.
Tests
frontend/ui-tests/tests/apps-launch-form.spec.tsmocks an app manifest withone
numberparameter, types0.01one key at a time, and checks that thefield still shows
0.01. The test fails without the fix: the field shows1. It's a Playwright test because Vitest's jsdom environment doesn'treproduce the browser's number-input behavior.
To test
pixi run test-ui -- -- tests/apps-launch-form.spec.tsand check thatit passes.
type: numberparameter. Theadd-number-parambranch ofallison-truhlar/fileglancer-demo-appadds a--thresholdparameter (default0.05) for this.0.01. Check that thefield shows
0.01.Threshold: 0.01.@krokicki