|
Ran
|
Jobs
3
|
Files
1046
|
Run time
2min
|
Badge
README BADGES
|
push
github
fix(web): prevent storage forms from flickering when changing mount point or filesystem (#3728) ## Summary Changing the mount point or filesystem in the partition and logical volume forms caused the entire form to briefly disappear and show the page loading spinner. This happened because the automatic size hint is backed by a `useSuspenseQuery` whose query key depends on those values. Every key change triggered a new suspension that propagated to the page-level `Suspense` boundary. This PR isolates the solver-dependent UI into its own component and wraps it in a local `Suspense` boundary. The query inputs are deferred using React's `useDeferredValue`, allowing the previous size hint to remain visible while the updated data is fetched. Since the solver is expected to respond quickly and the size hint is read-only guidance rather than editable state, briefly showing the previous value provides a smoother UX without compromising correctness. ## Implementation Initially, it was explored a TanStack Query solution using [`placeholderData`/`keepPreviousData`](https://tanstack.com/query/latest/docs/framework/react/guides/migrating-to-v5#removed-keeppreviousdata-in-favor-of-placeholderdata-identity-function). Unfortunately, this does not work with `useSuspenseQuery`, as `placeholderData` is ignored and the hook still suspends whenever the query key changes. The implementation therefore follows the same approach already used in the Overview page: - Existing pattern: <https://github.com/agama-project/agama/blob/5c4ee6f4c/web/src/components/overview/OverviewPage.tsx#L23> - React documentation for `useDeferredValue`: <https://react.dev/reference/react/useDeferredValue#showing-stale-content-while-fresh-content-is-loading> Specifically, this PR: - Extracts the automatic size note into its own component. - Defers the mount point and filesystem values with `useDeferredValue`. - Wraps only the solver-dependent content in a loca... (continued)
4899 of 6839 branches covered (71.63%)
Branch coverage included in aggregate %.
7 of 7 new or added lines in 1 file covered. (100.0%)
5 existing lines in 3 files now uncovered.25583 of 29835 relevant lines covered (85.75%)
123.84 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 3 |
75.51 |
0.77% | web/web/src/components/storage/shared/SizeFields.tsx |
| 1 |
98.21 |
-1.79% | web/web/src/components/storage/partition-form/transformations.ts |
| 1 |
88.66 |
-4.12% | web/src/components/storage/partition-form/transformations.ts |
| ID | Flag name | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|---|
| 3 | web | 29484988000.3 | 727 |
80.01 |
GitHub Action Run | |
| 1 | rust | 19474749743.1 | 185 |
22.45 |
GitHub Action Run | |
| 3 | service | 29261150940.3 | 319 |
92.41 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|