Repository navigation
feat(desktop): a native macOS window: traffic lights, rounded corners, native full screen - #26
Merged
Merged
Conversation
…, native full screen On macOS the window now keeps the system's own frame, as Mac apps do: the traffic lights at the top left, rounded corners and the window shadow, and native full screen (the green button, ⌃⌘F, its own Space). Windows and Linux are unchanged. - src-tauri/tauri.macos.conf.json: decorations with an Overlay title bar, the lights placed in the app's 36 pt bar, first-click drag. Tauri merges it as a JSON merge patch, which replaces the window list whole, so it repeats the window entry (a test keeps the two in step). - The Mac title bar is a drag strip with the title in the middle and room for the lights; it keeps its size in window points at any interface size. Double-click zooms. - The red button and ⌘W follow "Keep running in the menu bar": hide (out of full screen first, in one go) or close. A click on the Dock icon brings a hidden window back. - The window-state plugin no longer restores decorations, so installs that saved the old frameless window get the frame. - The frame follows the app's light or dark theme. On a Mac, shortcuts read ⌘K, ⌘+ / ⌘−, ⌘0, ⇧⌘L and ⌃⌘F (F11 is Show Desktop there), and Esc no longer leaves full screen. - Full screen is followed on the welcome and set-up pages too. - A right-click just after closing a dialog drew its menu inside the closed dialog, out of sight: only dialogs still open count now. Tests: desktopOs and IS_MAC, the Mac title bar, closing, the zoom variable, the theme, the config files, the dialog fix, and e2e/macos.spec.ts against a fake Mac desktop. What only a real Mac can show (the corners with a see-through window, where the lights sit, the shadow) is listed in the pull request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCk6t7edJdscNtTSeFmyQN
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCk6t7edJdscNtTSeFmyQN
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.
What and why
On macOS, Statsify now uses the system's own window frame, like a native Mac app. Windows and Linux are unchanged.
How it's done:
src-tauri/tauri.macos.conf.jsonis merged only into macOS builds: decorations,titleBarStyle: Overlay, a hidden title, the traffic-light position and first-click drag. Tauri merges it as a JSON merge patch, which replaces the window list whole, so the file repeats the window entry.scripts/tauri-config.test.tskeeps the two in step.capabilities/macos.json(macOS only) allowsdestroyfor the close path.app/lib/env.tshasdesktopOs()andIS_MAC;TAURI_ENV_PLATFORMisdarwinon macOS.RunEvent::Reopenhandles the Dock click, andlib.rssets the window-state flags.Trade-off:
acceptFirstMouseis on, so an inactive window can be dragged by its title bar in one go. The side effect is that the first click on an inactive window also acts on the page, as it does on Windows. This is documented in AGENTS.md.Version: 1.2.2, as asked. By
docs/RELEASING.md, a new feature or improvement is a minor version (1.3.0); change it withnpm run version:set -- 1.3.0before merging if you'd rather follow that.Merging releases it. The Desktop app run on this pull request builds the macOS
.dmg(thestatsify-macOSartifact). Please try it on a Mac first. Only a real Mac can show:trafficLightPositiony: 18);Follow-ups (not in this pull request):
How it was tested
npm run check: typecheck, lint, 595 unit tests (new:env,TitleBar,useMacWindowClose,applyzoom, the theme on each system,openDialogs,tauri-config) and the build.src-tauri/:cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo test, including a test of the window-state flags.RunEvent::Reopen) can't compile on Linux. It was read against the tauri 2.13 source by a separate reviewer, and the macOS desktop build on this pull request compiles it.e2e/macos.spec.tsruns against a fake Mac desktop (fakeDesktop(page, { os: "macos" })). It covers the bar, the lights area, the zoom, full screen on every page, closing (including a repeated press), Mac shortcut labels, Esc, Settings text and axe. It passed 35 of 35 runs with--repeat-each 5.shell,window-material,window-states,fullscreen,a11yanddevlogpass at every size (Windows layout unchanged).Checklist
feature/<name>and the commits follow the commit style.npm run checkpasses (typecheck, lint, unit tests, build).npm run e2epasses, or the change can't affect the UI. The affected specs pass, and CI runs the full suite.cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo testpass insrc-tauri/.docs/,AGENTS.md) where behaviour, commands or architecture changed.Generated by Claude Code