Skip to content

feat(app): use sidebar vibrancy and a unified title bar on macOS - #25

Open
hsusul wants to merge 1 commit into
mainfrom
feat/window-material
Open

hsusul wants to merge 1 commit into
mainfrom
feat/window-material

Conversation

@hsusul

@hsusul hsusul commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Why

The design spec (7.1, 7.4) puts Lore's window chrome on Apple Mail's model. The window gets a 52px unified toolbar with native traffic lights, a sidebar material, and a toolbar you can drag. This PR sets those window values in tauri.conf.json, so the UI PRs can build on them.

What changed

  • trafficLightPosition changes from 16, 11 to 19, 24. Tauri sets the close button's frame x to x. It resizes the titlebar container to the button height plus y, and the button keeps a 6pt bottom margin. So the circle lands at x + 1, y - 4, which is 20, 20. That is the measured native position for a .unified toolbar (appkit-metrics.md, section 5).
  • windowEffects requests the sidebar material and follows the window's active state.
  • app.security.capabilities now lists "default" plus an inline window-drag capability. That capability grants only core:window:allow-start-dragging on window main.

Scope

  • The material does not show yet. Two things outside this file must change first. The tauri dependency in src-tauri/Cargo.toml needs features = ["macos-private-api"]. The config then needs app.macOSPrivateApi: true and transparent: true on the window. Without the Cargo feature, Tauri drops transparent on macOS and the webview paints an opaque background over the effect view. tauri-build also fails the build if macOSPrivateApi is set without the feature. The private API also blocks Mac App Store distribution. That decision belongs to the owner, so this PR leaves it out.
  • To show the material, the UI must also make its sidebar background transparent. A later UI PR does that. Until then, and until the step above lands, the sidebar looks the same as today. Even after transparency is on, the material shows only behind transparent areas.
  • The toolbar's data-tauri-drag-region markup comes in the UI PR. This PR only grants the permission it needs.

Tradeoffs

  • I left transparent: true out for now. Without the Cargo feature it has no effect, and debug builds print a warning on every launch. It belongs in the same change that turns on the private API.
  • Tauri allows only one way to add a capability from config: list it under app.security.capabilities. Once that list is non-empty, Tauri stops loading capabilities/ on its own. So the list names "default" explicitly. A missing reference fails the build, so a renamed file cannot be dropped without notice.

Blast Radius

The change touches only the macOS main window. On screen, the traffic lights move down and right. The IPC surface gains one command, start_dragging, on window main. All default permissions stay in place. Double-click to zoom already worked, because core:default includes internal-toggle-maximize.

Verification

  • cargo build -p lore-app passes.
  • Resolved ACL in the built binary. With main's config, the allowed-command table has no plugin:window|start_dragging. With this config, the table has it, next to plugin:dialog|open, plugin:dialog|save and the core:default commands. src-tauri/gen/schemas/capabilities.json lists only the file scan (default), because Tauri merges the inline capability later, at codegen.
  • I launched the app against synthetic data and captured only the Lore window. The red close circle measures left 20pt, top 20pt, 12pt diameter, center 26pt. That matches native .unified.

Move the traffic lights to the native 52pt unified-toolbar position
(circle at 20, 20), request the sidebar material for the main window,
and grant start-dragging so toolbar drag regions can move the window.

The sidebar material stays hidden until the tauri crate enables the
macos-private-api feature and the window sets transparent: true. Only
tauri.conf.json may change in this PR, so those steps are left out.
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.

1 participant