|
Ran
|
Files
609
|
Run time
1min
|
Badge
README BADGES
|
push
github
refactor(web): standardize form organization (#3521) ## Summary Standardizes all TanStack Form implementations to consistent naming conventions and directory structure, consolidating form concerns (types, defaults, validation) into unified `fields.ts` modules. **Affected forms**: - **connection-form**: Moved into dedicated subdirectory, renamed field group components, consolidated validation - **system-form**: Moved into dedicated subdirectory, consolidated validation - **registration-form**: Moved into dedicated subdirectory, extracted inline validation - **patterns-form**: Moved into dedicated subdirectory ## Background This branch initially explored [Valibot](https://valibot.dev/), a [Standard Schema](https://standardschema.dev/) validation library (~1.5kb), for declarative schema-based validation in the connection-form: ```typescript import * as v from "valibot"; const ipFieldsSchema = v.object({ addresses4: v.pipe( v.array(v.string()), v.check((arr) => arr.every(isValidIPv4)), ), // ... }); ``` After implementation (commit https://github.com/agama-project/agama/pull/3521/commits/8f89746d5) it was found that the abstraction added more overhead than value. Valibot's API is nice, but introduced a learning curve, and imperative validation functions were clearer for the complex field interdependencies present in these forms. The approach was rolled back (commit https://github.com/agama-project/agama/pull/3521/commits/d594ee7f5) in favor of plain TypeScript with reusable helpers. The full reasoning is documented in [`conventions.md`](https://github.com/agama-project/agama/blob/f558792a1/web/src/components/form/conventions.md). ## Motivation After the Valibot rollback, the codebase settled on a clear pattern but it hadn't been applied consistently across all forms: - Connection-form files were flat inside `network/` with no subdirector... (continued)
4199 of 6288 branches covered (66.78%)
Branch coverage included in aggregate %.
15100 of 18856 relevant lines covered (80.08%)
91.05 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|