fix(onboarding): reset internal boot form on mode switch#1980
Conversation
- Purpose: prevent dedicated-only selections from leaking into hybrid mode. - Before: after #1979 lowered the dedicated minimum to 6 GiB, switching pool modes left the existing form state in place. - Problem: a 6 GiB disk selected in dedicated mode could remain selected after changing to hybrid, even though it is not a valid hybrid device. - Change: switching between dedicated and hybrid now clears the mode-sensitive form state and reapplies the defaults for the new mode. - How: reset the selected devices, slot count, pool name, BIOS update toggle, and boot size defaults inside the poolMode watcher, and add regression coverage for the dedicated-to-hybrid path.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughA test type and its corresponding component were updated to support device selection state management. The Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1980 +/- ##
=======================================
Coverage 52.20% 52.20%
=======================================
Files 1032 1032
Lines 71630 71634 +4
Branches 8131 8141 +10
=======================================
+ Hits 37392 37400 +8
+ Misses 34113 34109 -4
Partials 125 125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87d7daf0f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| slotCount.value = 1; | ||
| selectedDevices.value = [undefined]; | ||
| updateBios.value = templateData.value?.defaultUpdateBios ?? true; | ||
| applyBootSizeSelection(templateData.value?.defaultBootSizeMiB ?? DEFAULT_BOOT_SIZE_MIB); |
There was a problem hiding this comment.
Skip form reset during initial mode hydration
This watcher now unconditionally resets mode-sensitive fields whenever poolMode changes, but initializeForm sets poolMode from draftStore.internalBootSelection on mount. When a saved selection is in hybrid mode, that initial poolMode assignment triggers this reset and wipes hydrated values (selected devices, slot count, boot size, BIOS toggle, and effectively pool name defaults), so users returning to the step lose previously saved hybrid configuration before interacting.
Useful? React with 👍 / 👎.
🤖 I have created a release *beep* *boop* --- ## [4.32.0](v4.31.1...v4.32.0) (2026-03-31) ### Features * **onboarding:** force reboot after internal boot setup and lock down wizard ([#1966](#1966)) ([9323b14](9323b14)) * **web:** add standalone internal boot wizard ([#1956](#1956)) ([ea41225](ea41225)) ### Bug Fixes * **api:** defer docker startup tasks until ready ([#1952](#1952)) ([0e004a7](0e004a7)) * check mdState to determine array stopped during onboarding ([#1969](#1969)) ([abe7283](abe7283)) * **connect:** expose IPv6 FQDN routes ([#1976](#1976)) ([86d31ee](86d31ee)) * **docker:** guard primary container name access ([#1977](#1977)) ([7dadaa2](7dadaa2)) * **onboarding:** fix shutdown/reboot buttons in internal boot wizard ([#1972](#1972)) ([7f04f8e](7f04f8e)) * **onboarding:** hide boot pool info alert when storage boot is unavailable ([#1973](#1973)) ([f82681b](f82681b)) * **onboarding:** lower dedicated boot minimum to 6 GiB ([#1979](#1979)) ([c8773f5](c8773f5)) * **onboarding:** prevent Apply Result dialog from being dismissed ([#1971](#1971)) ([0db1410](0db1410)) * **onboarding:** reload after server rename ([#1981](#1981)) ([6897f7e](6897f7e)) * **onboarding:** reset internal boot form on mode switch ([#1980](#1980)) ([a78b895](a78b895)) * **onboarding:** restore page refresh on Go to Dashboard ([#1967](#1967)) ([29f814b](29f814b)) * **onboarding:** surface drive warnings for internal boot ([#1963](#1963)) ([9e0e89e](9e0e89e)) * Revert "fix(web): avoid legacy dropdown id collisions" ([#1961](#1961)) ([ffeb148](ffeb148)) * **server-identity:** handle onboarding persistence mismatches ([#1974](#1974)) ([8432974](8432974)) * **theme:** remove stale dark root class in light mode ([#1960](#1960)) ([2815f85](2815f85)) * **web:** avoid dropdown id collisions with ZFS Master ([#1958](#1958)) ([98d37bb](98d37bb)) * **web:** include connect metadata in callbacks ([#1957](#1957)) ([c392146](c392146)) * **web:** restore dropdown id compatibility safely ([#1962](#1962)) ([d948b32](d948b32)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
This is a follow-up to #1979.
#1979lowered the dedicated internal boot minimum to6 GiB, but it was merged before the companion mode-switch state reset landed. This PR adds that missed guardrail.The bug is narrow but real: a user can select a
6 GiBdisk inDedicatedmode, switch toHybrid, and keep stale local form state that no longer matches hybrid eligibility. This PR resets the mode-sensitive form values whenever the pool mode changes so the UI always reflects the newly selected mode.Why This Change Was Needed
After
#1979, dedicated mode correctly allows6 GiBdevices while hybrid mode still requires8 GiB-class devices. That introduced a cross-mode edge case in the wizard state:Dedicated6 GiBdiskHybridThat means the form can carry stale selections across a mode change. Even though the disk is no longer valid for hybrid, the UI state can still reflect the old dedicated selection until the user manually changes it.
This PR fixes that by treating a pool mode change as a form reset point.
What Changed
When
poolModechanges, the onboarding step now resets the mode-sensitive form state:slotCountto1selectedDevicesThis keeps the implementation intentionally simple and predictable: switching between
DedicatedandHybridnow starts the user from a clean state for that mode.Behavior Before
6 GiBdisk inDedicatedHybrid, that prior selection could remain in component stateBehavior After
6 GiBdisk chosen inDedicateddoes not carry over intoHybridScope
This PR is intentionally narrow.
It does not change:
6 GiBdedicated eligibility rule from#1979poolBootSizehandlingIt only fixes the local onboarding form state transition between pool modes.
Testing
Ran:
cd web && pnpm exec vitest run __test__/components/Onboarding/OnboardingInternalBootStep.test.ts __test__/components/Onboarding/OnboardingSummaryStep.test.tsAdded regression coverage to verify that:
6 GiBdisk can still be selected inDedicatedHybrid, the stale selected device is clearedSummary by CodeRabbit
Bug Fixes
Tests