refactor(web): network connection form UX (part 7)#3363
Merged
dgdavid merged 13 commits intoenhance-network-connection-formfrom Apr 8, 2026
Merged
refactor(web): network connection form UX (part 7)#3363dgdavid merged 13 commits intoenhance-network-connection-formfrom
dgdavid merged 13 commits intoenhance-network-connection-formfrom
Conversation
The new ConnectionForm based on TanStack Form fully replaces the old IpSettingsForm and all its dependencies.
Addresses are optional in advanced mode, but if entered they must still be valid. Previously only manual mode validated them, so invalid entries could silently reach the server.
Replacing useStore + useEffect with TanStack Form's own listener API is the idiomatic way to handle field side effects in this library.
Reusable form-aware components for text inputs and checkboxes, following the same useFieldContext pattern as ChoiceField and ArrayField. Wired into ConnectionForm (name field, DNS toggles) and IpSettings (gateway), replacing the inline field markup in each place.
10d6bb7 to
ac02514
Compare
"ChoiceField" gave no hint that the component renders a dropdown. Also adds a note in its TSDoc block to clarify that the component renders a PatternFly menu-based combobox, not a native select. It explains the keyboard behavior difference, why the two-step interaction is intentional (W3C APG screen reader safety), and includes a TODO for the missing arrow-key-opens-menu behavior.
…state Replace stale notes with accurate descriptions of what is actually implemented. The pattern for conditional rendering consistently uses "not rendered" instead of "hidden" throughout, since fields are conditionally mounted, not CSS-hidden.
Encapsulate submit state handling and cancel navigation so form components do not need to wire them up individually. Both are registered under formComponents and available as form.SubmitButton and form.CancelButton.
Merged
imobachgs
added a commit
that referenced
this pull request
Apr 14, 2026
Prepare to release version 20. * #3294 * #3295 * #3296 * #3297 * #3298 * #3299 * #3300 * #3301 * #3302 * #3303 * #3304 * #3305 * #3306 * #3307 * #3308 * #3309 * #3310 * #3311 * #3312 * #3313 * #3315 * #3316 * #3317 * #3318 * #3319 * #3320 * #3322 * #3323 * #3325 * #3326 * #3327 * #3329 * #3330 * #3331 * #3333 * #3334 * #3336 * #3338 * #3339 * #3342 * #3343 * #3349 * #3351 * #3352 * #3353 * #3354 * #3356 * #3357 * #3358 * #3359 * #3360 * #3361 * #3362 * #3363 * #3364 * #3365 * #3366 * #3367 * #3368 * #3371 * #3372 * #3373 * #3375 * #3376 * #3378 * #3379 * #3380 * #3381 * #3382 * #3385 * #3386
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.
This is the final PR of series of changes for reimplementing the network connection form using TanStack Form. Built on top of #3353, it removes the old IP settings form and its dependencies, completes the field component set, improves the name auto-sync approach, and fixes a validation gap in advanced mode.
Removal of IpSettingsForm
IpSettingsFormand its supporting components (AddressesDataList,DnsDataList,DnsSearchDataList,IpAddressInput,IpPrefixInput, and their tests) are deleted. The newConnectionFormbased on TanStack Form fully replaces them.Bug fix: address validation in advanced mode
Addresses are optional in advanced mode, but if entered they must still be valid. Previously only manual mode validated them, so invalid entries could silently reach the server. The fix ensures to also validate entries when they are present in advanced mode, even though none are required.
generateConnectionNameas a pure functionuseConnectionNamewas a React hook that had no real React dependency: it computed a name from its arguments and returned a string. It has been replaced bygenerateConnectionName, a plain function insrc/utils/network.tsthat is easier to test and works anywhere without a component context.Name auto-sync via form-level listeners
The previous approach used
useStoreto watch binding fields and auseEffectto write the derived name back. Both are replaced by TanStack Form's ownlistenersAPI), which is the idiomatic way to handle field side effects in this library.The listener fires on mount and on every change and, as in previous approach, it skips the update when the name field is already dirty, using
isDirtyrather thanisTouchedso that focusing and blurring the field without typing does not stop auto-generation.dontRunListeners: trueprevents the name write from re-triggering the listener.DropdownField rename
ChoiceFieldwas renamed toDropdownFieldsince the old name gave no hint about what kind of input it renders. The TSDoc now explains that the component uses a PatternFly menu-based combobox rather than a native<select>, why the keyboard interaction differs from what users may expect, and includes a TODO for implementing the W3C-recommended arrow-key compromise.TextField and CheckboxField
Two new field components following the same
useFieldContextpattern asDropdownFieldandArrayField:TextField: a text input that shows validation errors inline below the input.CheckboxField: a checkbox with an optional description.Both are registered in
useAppFormand wired intoConnectionForm(name field, DNS toggles) andIpSettings(gateway field), replacing the inline markup that was previously scattered across those components.A
## Field component conventionssection was added toform-contexts.tsto document the shared contract:onChangeis wired internally,onBluris intentionally not wired (submit-only validation, revisit when a use case arises), and lifecycle events belong onform.AppFieldvialisteners, not on the component itself.Action button form components
Two action button components are registered under
formComponentsso they are available on any typed form instance without form-specific wiring:form.SubmitButton: readsisSubmittingviauseFormContextand renders a submit button that shows a loading indicator and disables itself while the form is submitting.form.CancelButton: encapsulatesnavigate(-1)viauseNavigate, rendering a link button that returns to the previous page.ConnectionForm's action group reduces to:Form conventions update
src/components/form/conventions.mdhas been updated to reflect the implemented state ofConnectionForm. Stale notes are replaced with accurate descriptions, conditional rendering is consistently described as "not rendered" rather than "hidden" throughout, and a new Validation section explains the submit-only approach, the cross-fieldonSubmitAsyncpattern, and thesetErrorMapworkaround needed to re-enable submission after a failed attempt.Notes for reviewers
Changelog entry postponed for the final PR from the feature branch against master.