Fix and stabilize TextField. - #1022
Conversation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the TextField component to support different variants (shortText, longText, number, and obscured), adds input formatting for numeric inputs, and introduces comprehensive widget tests. Feedback on the changes highlights a syntax error in the test file map literal (?variant), invalid leading dot shorthand syntax for TextInputType members, and an unused validationRegexp property that is defined but not integrated into the validation logic.
| _Json.label: A2uiSchemas.stringReference(), | ||
| _Json.variant: S.string( | ||
| description: | ||
| '''The kind of input the field accepts. ${_Variant.shortText} (the default) is a single line of text, ${_Variant.longText} is multi-line text, ${_Variant.number} only accepts numeric input, and ${_Variant.obscured} hides the typed characters, e.g. for passwords.''', |
There was a problem hiding this comment.
I think we should standardize these descriptions to exactly match central catalog.json document e.g. https://github.com/a2ui-project/a2ui/blob/main/specification/v0_9/catalogs/basic/catalog.json
That way, rather than iterating on the descriptions separately in every codebase, we can iterate on them in one central place, have central evals that show that they work well, and then just copy them everywhere.
So would it work to just copy the description from the central catalog doc e.g. "The type of input field to display."? And if that causes inference performance issues, then send a PR to the JSON file for the basic catalog for 1.0 to improve the description.
There was a problem hiding this comment.
I like this.
But I suggest it to be separate effort.
I do not want to spend more time here now.
I just wanted to try to fix a2ui-project/a2ui#1893, plus fixed what I saw was not working.
Would you mind to file separate issue for description standartization?
There was a problem hiding this comment.
Really, we should be using some tooling to build these schema from the A2UI schema files themselves. They should be identical, not just copied over: copied ones will always be stale.
Contributes to a2ui-project/a2ui#1893