Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

fix(client): reliable desktop glass — own the html.desktop class, stronger backdrop

Tashfeen370f1bab67db
diff --git a/client/src/App.tsx b/client/src/App.tsx
index 5de7b696..ddf54e5f 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -99,6 +99,14 @@ function Brand() {
// padded for the macOS traffic lights, and without the web-only Sign out.
const isDesktopApp = typeof window !== 'undefined' && (window as any).__FREEAPI_DESKTOP__ === true
+// The preload's own early classList.add can be lost (it may run before this
+// document exists), so the client claims the class itself at module load —
+// before the first React paint — keeping html.desktop CSS (transparent body,
+// glass backdrop) reliable.
+if (isDesktopApp) {
+ document.documentElement.classList.add('desktop')
+}
+
function Navbar() {
const { dark, toggle } = useDarkMode()
const location = useLocation()
@@ -110,7 +118,9 @@ function Navbar() {
return (
<header
- className="sticky top-0 z-40 border-b bg-background/80 backdrop-blur"
+ // In the desktop shell the body backdrop is already translucent glass;
+ // a lighter wash keeps the title bar from looking more solid than the page.
+ className={`sticky top-0 z-40 border-b backdrop-blur ${isDesktopApp ? 'bg-background/45' : 'bg-background/80'}`}
style={isDesktopApp ? ({ WebkitAppRegion: 'drag' } as React.CSSProperties) : undefined}
>
<div
diff --git a/client/src/index.css b/client/src/index.css
index 7ff3bb1a..7194ef47 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -137,14 +137,15 @@
font-feature-settings: 'ss01', 'cv11', 'tnum';
}
/* Desktop shell (html.desktop set by the app's preload): let the
- window's vibrancy show through a slightly-translucent backdrop so
- the dashboard picks up the same glass as the tray popover. No effect
- in the browser, where .desktop is never set. */
+ window's vibrancy show through a translucent backdrop so the
+ dashboard reads as real glass, like the tray popover. Cards and
+ popovers stay opaque on top. No effect in the browser, where
+ .desktop is never set. */
html.desktop body {
background-color: transparent;
}
html.desktop .desktop-backdrop {
- background-color: color-mix(in oklab, var(--background) 86%, transparent);
+ background-color: color-mix(in oklab, var(--background) 55%, transparent);
}
code, pre, kbd, samp {
font-family: var(--font-mono);