feat: add shutdown sequence - #4
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new Shutdown overlay has confirmed restart/Enter-key handling bugs that can show incorrect UI state and potentially trigger a double reboot.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds an R5-style Shut Down / Restart flow to BeanWeb: the Deskbar Be menu initiates a confirmation, the store steps through closing windows via requestClose, and the shell renders a dedicated shutdown overlay that either parks the desktop (shutdown) or reboots back to the boot Tracker (restart).
Changes:
- Introduces shutdown state + sequencing APIs in the desktop Zustand store (
beginShutdown,quitNext,reboot). - Adds a new
Shutdownshell overlay component and styling, including z-index layering below alerts. - Adds comprehensive store-level + rendered (timer-driven) shutdown tests, and updates dev tooling dependencies/config accordingly.
File summaries
| File | Description |
|---|---|
| vitest.config.ts | Adjusts Vite config import to ensure test config resolves correctly. |
| tests/shutdown.test.tsx | Adds store and UI tests covering shutdown/restart behavior end-to-end. |
| tests/setup.ts | Resets the new shutdown store slice between tests. |
| src/styles/tokens.css | Adds --z-shutdown token positioned below alerts for close-guard prompts. |
| src/styles/shell.css | Adds shutdown overlay/window replica styling. |
| src/store/desktop.ts | Implements shutdown state machine + reboot semantics in the store. |
| src/shell/Shutdown.tsx | New overlay component that paces shutdown via timers and triggers reboot. |
| src/shell/Desktop.tsx | Renders the new Shutdown overlay in the shell layer stack. |
| src/shell/Deskbar.tsx | Adds “Restart” and “Shut Down” entries to the Be menu. |
| src/lib/types.ts | Adds ShutdownMode/ShutdownState types. |
| package.json | Updates Vite/Vitest and related dev dependencies. |
| package-lock.json | Locks updated dependency graph for the tooling upgrades. |
| CLAUDE.md | Documents the new shutdown behavior and architecture invariants. |
Review details
Suppressed comments (2)
src/shell/Shutdown.tsx:73
Restartcurrently reachesphase === 'down'and then renders the parked shutdown UI ("System is Shut Down" + safe-to-turn-off text + Reboot button). That’s misleading for restart (and contradicts the intent that restart boots again without parking). Make thedownflag depend on both phase and mode so only true shutdown shows the parked screen.
const down = shutdown.phase === 'down'
const title = down
? 'System is Shut Down'
: shutdown.mode === 'restart'
? 'Restarting'
: 'Shutting Down'
src/shell/Shutdown.tsx:111
- When
mode === 'restart'and the store has advanced tophase === 'down', the status line falls back to "Asking applications to quit…" (becauseshutdown.quittingis null). This produces confusing copy during the final restart delay; prefer an explicit "Restarting…" message for that state.
<p className="b-shutdown-text" role="status" aria-live="polite">
{shutdown.quitting
? `Quitting ${shutdown.quitting}…`
: 'Asking applications to quit…'}
</p>
- Files reviewed: 12/13 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hali-coding
force-pushed
the
feat/vite8
branch
from
August 26, 2026 15:54
48d289b to
8532b8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes