Skip to content

fix(desktop): restore native macOS fullscreen on restart - #10817

Open
andybergon wants to merge 3 commits into
pingdotgg:mainfrom
andybergon:fix/restore-macos-fullscreen
Open

fix(desktop): restore native macOS fullscreen on restart#10817
andybergon wants to merge 3 commits into
pingdotgg:mainfrom
andybergon:fix/restore-macos-fullscreen

Conversation

@andybergon

@andybergon andybergon commented Sep 8, 2026

Copy link
Copy Markdown

What Changed

Restore the saved native macOS full-screen state after an app restart or update relaunch. A separate commit adds Restart T3 Code to the desktop command palette so the restart path can be tested directly.

Why

Window bounds and maximized state are already saved, but native full screen is not. Persist its state and request fullscreen: true when constructing the macOS window. Ignore transient startup bounds until the native transition completes, including when the saved display is disconnected.

The restart command uses the existing graceful relaunch lifecycle, which flushes window state before shutting down the desktop-managed server. It warns that active tasks are interrupted and remains hidden in web clients and older desktop shells.

UI Changes

Verified in an isolated macOS development app: enter native full screen, use Cmd+K > Restart T3 Code, then confirm window.desktopBridge.getWindowFullscreenState() returns true in the relaunched renderer.

Before and after the same restart, captured from the isolated dev window:

Before restart: native fullscreen with the restart command available

After restart: the relaunched main window in native fullscreen

Single-display OBS recording of Cmd+K > Restart T3 Code and the return to native fullscreen: 2560 x 1440, 30 fps, no audio. The idle lead-in is trimmed. A labeled privacy screen covers seven seconds around the relaunch to hide other apps, without changing elapsed time.

t3-fullscreen-restart.mp4
Verification
  • 57 focused desktop tests pass across window state, persisted settings, and restart IPC.
  • Desktop typechecking and targeted lint/format checks pass.
  • Regression tests fail before the review fix and pass afterward: startup resize/flush cannot replace saved bounds while full-screen restoration is pending; disconnected-display bounds survive until a real window-state change.
  • Windows/Linux fullscreen behavior is unchanged. Native runtime testing was on macOS only.
  • Independent Fable 5.1 review found no blockers. Its two startup-persistence findings are resolved in the focused follow-up review.
  • Fresh macOS retest of the final patch: the restart creates a new process and restores native fullscreen; leaving fullscreen restores the saved 1100 x 780 normal bounds and clears the saved fullscreen flag. Maximize/unmaximize changes persist afterward. Re-entering fullscreen saves the flag again.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Implementation: Codex in T3 Code. Independent review: Claude Fable 5.1 via Claude Code.

Summary by CodeRabbit

  • New Features

    • Added a desktop command palette option to restart T3 Code gracefully.
    • Restarting warns that active tasks will be interrupted.
    • macOS fullscreen state is now restored when reopening the desktop app.
  • Bug Fixes

    • Improved persistence and restoration of window fullscreen state, including off-display window bounds.
  • Documentation

    • Documented the new restart command and its behavior.

Persist native fullscreen alongside the existing normal bounds so update and restart relaunches can return to the same macOS window mode. Keep the behavior gated to macOS and cover persistence, restoration, and lifecycle transitions.
Expose the graceful desktop relaunch lifecycle in the command palette so window-state behavior can be exercised without leaving the app.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 8, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes desktop startup and window-state persistence behavior and adds a new command-palette action that can interrupt active tasks and relaunch the app. It also modifies the desktop product defaults, so the combined runtime and user-facing scope warrants human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 60194849-dfaa-451b-94e8-f0f32086e058

📥 Commits

Reviewing files that changed from the base of the PR and between 12391bd and 4c55965.

📒 Files selected for processing (12)
  • apps/desktop/src/ipc/DesktopIpcHandlers.ts
  • apps/desktop/src/ipc/channels.ts
  • apps/desktop/src/ipc/methods/window.test.ts
  • apps/desktop/src/ipc/methods/window.ts
  • apps/desktop/src/preload.ts
  • apps/desktop/src/settings/DesktopAppSettings.test.ts
  • apps/desktop/src/settings/DesktopAppSettings.ts
  • apps/desktop/src/window/DesktopWindow.test.ts
  • apps/desktop/src/window/DesktopWindow.ts
  • apps/web/src/components/CommandPalette.tsx
  • docs/user/keybindings.md
  • packages/contracts/src/ipc.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The desktop now persists native macOS fullscreen state and restores it when opening the main window. It also exposes a desktop-only restart command through IPC, the preload bridge, the command palette, and user documentation.

Changes

Desktop window lifecycle

Layer / File(s) Summary
Fullscreen state persistence and restoration
apps/desktop/src/settings/DesktopAppSettings.ts, apps/desktop/src/window/DesktopWindow.ts
Settings store fullscreen state. macOS window creation restores it, defers bounds persistence during native transitions, and avoids maximizing during fullscreen restoration.
Fullscreen lifecycle validation
apps/desktop/src/settings/DesktopAppSettings.test.ts, apps/desktop/src/window/DesktopWindow.test.ts
Tests cover defaults, normalization, persistence, restoration, off-display bounds, and renderer updates for fullscreen transitions.

Restart IPC flow

Layer / File(s) Summary
Restart IPC contract and handler
packages/contracts/src/ipc.ts, apps/desktop/src/ipc/channels.ts, apps/desktop/src/ipc/methods/window.ts, apps/desktop/src/ipc/DesktopIpcHandlers.ts, apps/desktop/src/preload.ts
The desktop bridge exposes restartApp. The IPC handler calls DesktopLifecycle.relaunch("command-palette").
Restart handler test
apps/desktop/src/ipc/methods/window.test.ts
The test verifies that the handler records the command-palette relaunch reason.

Restart command surface

Layer / File(s) Summary
Command palette and documentation
apps/web/src/components/CommandPalette.tsx, docs/user/keybindings.md
Desktop builds add the Restart T3 Code command. The documentation describes server shutdown, state flushing, and task interruption.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 4c559

This change restores macOS fullscreen state after relaunch and adds a desktop-only restart command that warns users about interrupted tasks. The persistence, IPC, and command availability paths are consistent, with no concrete merge-blocking risk identified.

Sequence Diagram(s)

sequenceDiagram
  participant CommandPalette
  participant DesktopBridge
  participant DesktopIpcHandlers
  participant DesktopLifecycle
  CommandPalette->>DesktopBridge: invoke restartApp
  DesktopBridge->>DesktopIpcHandlers: invoke desktop:restart-app
  DesktopIpcHandlers->>DesktopLifecycle: relaunch("command-palette")
Loading

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 11 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: restoring native macOS fullscreen state after restart.
Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the implementation, testing, platform scope, and UI evidence in sufficient detail.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 11 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant