diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 74d2357..fd26e1f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -77,7 +77,10 @@ "label": "main", "dragDropEnabled": false, "backgroundColor": "#08001f", - "transparent": false + "transparent": false, + "titleBarStyle": "Overlay", + "hiddenTitle": true, + "trafficLightPosition": { "x": 18, "y": 31 } } ], "security": { diff --git a/src/components/appBar/appBar.scss b/src/components/appBar/appBar.scss index 2f2024d..300c77e 100644 --- a/src/components/appBar/appBar.scss +++ b/src/components/appBar/appBar.scss @@ -1,50 +1,33 @@ .appBar { - // Limit transitions to cheaper properties; avoid animating box-shadow directly + // Custom titlebar: the app header itself sits at the very top of the window, + // under the native overlay titlebar (no native glass strip, no blur panels). transition: background-color $transition-time-fast; padding: 0.8em ($page-margin - 1.7em); z-index: 999 !important; + top: 0 !important; + + // Keep the left controls clear of the macOS traffic lights. + html.is-macos & { + padding-left: calc(#{$page-margin} - 1.7em + 72px); + } + .flex { // Avoid animating padding; it causes layout reflow on each frame. transition: background-color $transition-time-fast; - // Avoid using will-change: scroll-position; it can degrade performance when misused - // will-change: opacity, transform; border-radius: 1000px; position: relative; - - // Pseudo-element handles elevation shadow; we animate its opacity - &::after { - content: ""; - position: absolute; - inset: -0.35em; - pointer-events: none; - border-radius: inherit; - - @include glass-effect; - - opacity: 0; - z-index: -1; - transition: all $transition-time-fast; - } } - // Inner content wrapper that we can scale without causing layout reflow - .flex-inner { - transform-origin: top center; - transition: transform $transition-time-fast; + // Solid, part-of-the-screen titlebar background once the page scrolls. + &.elevated { + background-color: $clr-background-default !important; + border-bottom: 1px solid rgb(255 255 255 / 0.06); + box-shadow: none !important; + background-image: none !important; + backdrop-filter: none !important; } - &.elevated{ - .flex { - &::after { - opacity: 1; - } - } - // Apply a subtle scale to simulate shrink without layout changes - .flex-inner { - transform: scaleY(0.95); - } - } &-avatar { background: rgb(255 255 255 / 0.1) !important; &-icon { diff --git a/src/components/appBar/appBar.tsx b/src/components/appBar/appBar.tsx index b45f695..4d43c6f 100644 --- a/src/components/appBar/appBar.tsx +++ b/src/components/appBar/appBar.tsx @@ -2,7 +2,7 @@ import MuiAppBar from "@mui/material/AppBar"; import IconButton from "@mui/material/IconButton"; import useScrollTrigger from "@mui/material/useScrollTrigger"; import { useLocation, useNavigate } from "@tanstack/react-router"; -import React, { useCallback, useMemo, useState } from "react"; +import React, { useCallback, useState } from "react"; import "./appBar.scss"; @@ -51,13 +51,6 @@ export const AppBar = () => { const [showDrawer, setShowDrawer] = useState(false); - const appBarStyling = useMemo(() => { - return { - backgroundColor: "transparent", - paddingRight: "0 !important", - }; - }, []); - const _handleNavigateToSearch = useCallback( () => navigate({ to: "/search", search: { query: "" } }), [navigate], @@ -85,7 +78,7 @@ export const AppBar = () => { return ( <> { elevation={0} color="transparent" > -
+
menu @@ -112,7 +105,7 @@ export const AppBar = () => {
-
+
search diff --git a/src/components/libraryHeader/index.tsx b/src/components/libraryHeader/index.tsx index 44a08ec..5a629d9 100644 --- a/src/components/libraryHeader/index.tsx +++ b/src/components/libraryHeader/index.tsx @@ -258,6 +258,7 @@ export const LibraryHeader = () => { return ( <> { elevation={0} color="transparent" > -
+
menu
diff --git a/src/components/libraryHeader/libraryHeader.scss b/src/components/libraryHeader/libraryHeader.scss index a8fab17..d6f7cbc 100644 --- a/src/components/libraryHeader/libraryHeader.scss +++ b/src/components/libraryHeader/libraryHeader.scss @@ -11,6 +11,15 @@ z-index: 10; padding: 0.25em !important; transition: all 0.2s ease-in-out; + + html.is-macos & { + // The window has an overlay titlebar: keep controls clear of the traffic lights + // without pushing the right-hand actions out of the viewport. + padding-left: 72px !important; + width: calc(100vw - 4em - 72px) !important; + left: calc(2em + 72px) !important; + right: 2em !important; + } &::after { content: ""; @@ -18,10 +27,13 @@ inset: -0.35em; pointer-events: none; border-radius: inherit; - @include glass-effect; + // Solid titlebar surface: no glass/blur. + background-color: $clr-background-default; + border: 1px solid rgb(255 255 255 / 0.08); + box-shadow: 0 4px 20px rgb(0 0 0 / 0.4); opacity: 0; z-index: -1; - transition: all 150ms; + transition: opacity 150ms; } &.scrolling { &::after { diff --git a/src/components/loginShell/index.tsx b/src/components/loginShell/index.tsx index c2b40d6..bbb8238 100644 --- a/src/components/loginShell/index.tsx +++ b/src/components/loginShell/index.tsx @@ -51,7 +51,7 @@ const LoginShell = ({ const serverHost = api?.basePath.replace(/^https?:\/\//, ""); return ( -
+
{serverHost && (
diff --git a/src/main.tsx b/src/main.tsx index 053930d..814c794 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -95,6 +95,11 @@ function ProviderWrapper() { } const init = async () => { + // The window is frameless-ish on macOS (overlay titlebar): the app header is the titlebar. + if (navigator.userAgent.includes("Macintosh")) { + document.documentElement.classList.add("is-macos"); + } + const initialApi = await initializeApi(); ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/src/routes/_api/settings.scss b/src/routes/_api/settings.scss index b32faf1..c5106c0 100644 --- a/src/routes/_api/settings.scss +++ b/src/routes/_api/settings.scss @@ -62,6 +62,11 @@ padding: 1.5em 1em; // Reduced padding gap: 1em; // Reduced gap + html.is-macos & { + // Overlay titlebar: leave room for the traffic lights. + padding-top: 2.9em; + } + &-controls { display: flex; align-items: center; diff --git a/src/routes/_api/settings.tsx b/src/routes/_api/settings.tsx index 032f6f9..149ff36 100644 --- a/src/routes/_api/settings.tsx +++ b/src/routes/_api/settings.tsx @@ -26,7 +26,7 @@ function SettingsRoute() { navigate({ to: "/home" }); }, []); return ( -
+