Commit 6897f7e
authored
fix(onboarding): reload after server rename (#1981)
## Summary
This PR improves the onboarding flow when a user changes the Unraid
server name.
A successful hostname change can interrupt the current browser session
and force the user to refresh before continuing. The app cannot bypass
the browser trust / reload interruption itself, but it can choose when
that interruption happens.
Today, the interruption shows up too late in the flow. Users apply
settings successfully, move forward, and only run into the break when
leaving onboarding for the dashboard. This change moves that
interruption to the correct point in the flow. After a successful
server-name change, the Summary step now advances the wizard to
`NEXT_STEPS`, persists that step state, and then reloads the page. Once
the page is back, onboarding can reopen at the persisted next step
instead of forcing the user back through apply.
## Problem
When onboarding applies a server-name change:
- the current browser session can be interrupted
- the current flow waits until the user exits onboarding to surface that
interruption
- this makes the flow feel broken and can lead to confusing re-entry
behavior after refresh
The app cannot automatically bypass the browser interruption, so the
best UX is to make it happen immediately after the rename and before
final completion.
## What Changed
In `OnboardingSummaryStep.vue`:
- widened the `onComplete` prop to allow an async completion path
- added a one-shot `shouldReloadAfterApplyResult` flag
- detect successful server-name changes
- on results dialog confirmation, await the parent completion callback
first
- after step advancement settles, reload the page
This preserves the intended flow:
1. Apply settings
2. Show success dialog
3. User clicks `OK`
4. Advance to `NEXT_STEPS`
5. Reload the page if the successful apply included a server-name change
6. Onboarding resumes from the persisted next step
## Why This Shape
We intentionally reload only after:
- the server-name change succeeded
- the parent `onComplete()` callback has already advanced the step
That keeps the refresh tied to the actual rename, while avoiding a
regression where users would come back to the Summary step and re-run
apply.
## Testing
Added and updated a focused regression test in
`web/__test__/components/Onboarding/OnboardingSummaryStep.test.ts` that
verifies:
- a successful server rename arms the reload behavior
- the Summary step still waits for the user to confirm the result dialog
- `onComplete()` is invoked before the reload happens
- `window.location.reload()` is called exactly once in the rename case
Validated with:
```bash
pnpm test __test__/components/Onboarding/OnboardingSummaryStep.test.ts
```
## Notes
This PR does not attempt to eliminate the browser interruption itself.
That is outside the control of the web app. It only makes the
interruption happen at the right moment and preserves onboarding
progress across that reload.1 parent a78b895 commit 6897f7e
2 files changed
Lines changed: 42 additions & 6 deletions
File tree
- web
- __test__/components/Onboarding
- src/components/Onboarding/steps
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| |||
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
1018 | 1040 | | |
1019 | 1041 | | |
1020 | 1042 | | |
| |||
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| |||
579 | 580 | | |
580 | 581 | | |
581 | 582 | | |
| 583 | + | |
582 | 584 | | |
583 | 585 | | |
584 | 586 | | |
| |||
617 | 619 | | |
618 | 620 | | |
619 | 621 | | |
| 622 | + | |
620 | 623 | | |
621 | 624 | | |
622 | 625 | | |
| |||
657 | 660 | | |
658 | 661 | | |
659 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
660 | 666 | | |
661 | 667 | | |
662 | 668 | | |
| |||
1032 | 1038 | | |
1033 | 1039 | | |
1034 | 1040 | | |
1035 | | - | |
| 1041 | + | |
1036 | 1042 | | |
1037 | | - | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
1038 | 1052 | | |
1039 | 1053 | | |
1040 | 1054 | | |
| |||
0 commit comments