Skip to content

feat: add shutdown sequence - #4

Merged
hali-coding merged 1 commit into
mainfrom
feat/vite8
Aug 26, 2026
Merged

feat: add shutdown sequence#4
hali-coding merged 1 commit into
mainfrom
feat/vite8

Conversation

@hali-coding

Copy link
Copy Markdown
Owner

Changes

  • feat: add shutdown sequence

Copilot AI lite review requested due to automatic review settings August 26, 2026 14:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 Shutdown shell 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

  • Restart currently reaches phase === '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 the down flag 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 to phase === 'down', the status line falls back to "Asking applications to quit…" (because shutdown.quitting is 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.

Comment thread src/shell/Shutdown.tsx
@hali-coding
hali-coding merged commit 92fd040 into main Aug 26, 2026
@hali-coding
hali-coding deleted the feat/vite8 branch August 26, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants