• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agama-project / agama / 23806851640

31 Mar 2026 03:57PM UTC coverage: 77.453% (+0.2%) from 77.261%
23806851640

push

github

web-flow
refactor(web): network connection form UX (part 3)  (#3349)

This PR continues the network connection form reimplementation, built on
top of https://github.com/agama-project/agama/pull/3338. It introduces a
reusable array input component, wires it into the form for addresses,
DNS servers, and DNS search domains, and adds comprehensive client-side
validation.

### ArrayField component

A new `ArrayField` component handles list-valued fields. It accepts
multiple entries via a text input, , one at a time, and displays them as
editable/removable PF/Label. It also supports pasting multiple values at
once and the ability to optionally skip duplicated entries. The
component is registered in `AppField` alongside previous added
`ChoiceField` (which probably deserves a better name).

### Addresses, DNS servers, and DNS search domains

All three field types now use `ArrayField` with per-entry format
validation: IPv4 and IPv6 addresses accept optional CIDR notation, DNS
servers accept bare IPv4 or IPv6, and DNS search domains follow RFC
952/1123 label rules.

### Client-side validation

Validation runs on submission rather than on each keystroke or focus
change, so users are not interrupted while filling in the form. All
rules live in a single `validateConnectionForm` helper:

 - name is required
- addresses are required in manual mode and must all be valid when given
- gateways are validated only when present and mode manual, ignored if
mode auto and no IP address (optional in that mode) is given
- DNS and search domain lists must have at least one valid entry when
their toggle is on.

IPv4 validation was also tightened to require standard four-part decimal
notation, rejecting values like `1111` that the underlying library would
otherwise accept.

A secondary fix ensures re-submission works after a failed attempt:
TanStack Form keeps `canSubmit` false once field errors are set by
`onSubmitAsync`, since there are no per-field validators to clear them.
The form no... (continued)

3488 of 5508 branches covered (63.33%)

Branch coverage included in aggregate %.

191 of 198 new or added lines in 5 files covered. (96.46%)

21 existing lines in 5 files now uncovered.

21287 of 26479 relevant lines covered (80.39%)

88.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.24
/web/src/components/form/ArrayField.tsx


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc