|
Ran
|
Jobs
3
|
Files
926
|
Run time
3min
|
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 %.
130 of 133 new or added lines in 21 files covered. (97.74%)
23551 of 27996 relevant lines covered (84.12%)
99.04 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 2 |
77.5 |
web/src/components/form/validation-helpers.ts | |
| 1 |
97.14 |
web/src/components/network/connection-form/fields.ts |
| ID | Flag name | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|---|
| 3 | web | 26279477785.3 | 609 |
76.75 |
GitHub Action Run | |
| 1 | rust | 19474749743.1 | 185 |
22.45 |
GitHub Action Run | |
| 3 | service | 26234545328.3 | 317 |
92.46 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|