fix(onboarding): fix shutdown/reboot buttons in internal boot wizard#1972
fix(onboarding): fix shutdown/reboot buttons in internal boot wizard#1972
Conversation
…wizard - The shutdown and reboot buttons in the standalone internal boot wizard were non-functional because the InternalBootConfirmDialog (UModal with z-50) was rendered as a sibling to the full-screen Dialog component, causing z-index stacking issues that blocked interaction with the modal - Removed the InternalBootConfirmDialog from the standalone wizard so reboot/shutdown buttons now trigger the power actions directly - The confirmation dialog is preserved in the onboarding flow (OnboardingNextStepsStep) where it works correctly - Updated tests to reflect the simplified direct-action flow
WalkthroughThe changes simplify the onboarding internal boot workflow by removing an intermediate confirmation dialog. The component and its tests are updated to perform power actions (reboot/shutdown) directly upon button click, eliminating the pending state and confirm-dialog interaction pattern. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1972 +/- ##
==========================================
- Coverage 52.09% 52.08% -0.01%
==========================================
Files 1031 1031
Lines 71573 71564 -9
Branches 8093 8090 -3
==========================================
- Hits 37284 37275 -9
Misses 34164 34164
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.
🧹 Nitpick comments (1)
web/__test__/components/Onboarding/OnboardingInternalBootStandalone.test.ts (1)
573-617: Consider adding cleanup verification for completeness.The tests verify that the submit functions are called directly, which is the primary behavior change. For additional coverage, you could assert that
cleanupOnboardingStorageMockis called before the power action, but this is optional since the cleanup call is already tested elsewhere in this file (e.g., line 459).📝 Optional: Add cleanup assertions
await wrapper.get('[data-testid="internal-boot-standalone-reboot"]').trigger('click'); await flushPromises(); + expect(cleanupOnboardingStorageMock).toHaveBeenCalledTimes(1); expect(submitInternalBootRebootMock).toHaveBeenCalledTimes(1);await shutdownButton.trigger('click'); await flushPromises(); + expect(cleanupOnboardingStorageMock).toHaveBeenCalledTimes(1); expect(submitInternalBootShutdownMock).toHaveBeenCalledTimes(1);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/__test__/components/Onboarding/OnboardingInternalBootStandalone.test.ts` around lines 573 - 617, Add assertions to each test to verify cleanupOnboardingStorageMock is called before the power action: after triggering the step completion (the click on '[data-testid="internal-boot-step-complete"]') assert cleanupOnboardingStorageMock was invoked, then trigger the reboot ('[data-testid="internal-boot-standalone-reboot"]') or shutdown (shutdownButton) and assert submitInternalBootRebootMock or submitInternalBootShutdownMock was called; reference the existing mocks submitInternalBootRebootMock, submitInternalBootShutdownMock and cleanupOnboardingStorageMock and the wrapper interactions used in the tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@web/__test__/components/Onboarding/OnboardingInternalBootStandalone.test.ts`:
- Around line 573-617: Add assertions to each test to verify
cleanupOnboardingStorageMock is called before the power action: after triggering
the step completion (the click on '[data-testid="internal-boot-step-complete"]')
assert cleanupOnboardingStorageMock was invoked, then trigger the reboot
('[data-testid="internal-boot-standalone-reboot"]') or shutdown (shutdownButton)
and assert submitInternalBootRebootMock or submitInternalBootShutdownMock was
called; reference the existing mocks submitInternalBootRebootMock,
submitInternalBootShutdownMock and cleanupOnboardingStorageMock and the wrapper
interactions used in the tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0b4c165d-ded5-4b73-a90b-a583b0693208
📒 Files selected for processing (2)
web/__test__/components/Onboarding/OnboardingInternalBootStandalone.test.tsweb/src/components/Onboarding/standalone/OnboardingInternalBoot.standalone.vue
Summary
InternalBootConfirmDialogfrom the standalone internal boot wizard to fix non-functional shutdown/reboot buttonsUModal(z-50) was rendered as a sibling to the full-screenDialog, causing z-index stacking issues that blocked interaction with the confirmation modalOnboardingNextStepsStep) where it works correctlyTest plan
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests