Skip to content

feat(ui): frameless desktop window, color palettes, fading titles - #5312

Merged
kovtcharov-amd merged 21 commits into
amd:mainfrom
kovtcharov:kalin/ui-desktop-palettes
Oct 19, 2026
Merged

kovtcharov-amd merged 21 commits into
amd:mainfrom
kovtcharov:kalin/ui-desktop-palettes

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

The desktop app had a system title bar with a File/Edit/View menu above GAIA's own top row, so the window looked like a web page in a frame. Now the app's top row is the top of the window: the native window controls sit in it (traffic lights on macOS), and the empty part of the row drags the window.

People can also choose their colors. The warm gray look stays the default, and Settings › General › Colors adds eight palettes and a Custom option. The palettes are Stone and ink, Blue marble, Glacier, Forest floor, Sage and mist, Basalt and lichen, Graphite and gold, and Dusk. Custom takes an accent and a background tint and derives every other color from them, so no pick can make text unreadable. Long chat titles in the sidebar now fade out instead of ending in "...". The sidebar can be dragged wider or narrower, and keeps the GAIA icon when collapsed, since there is no title bar to carry it.

The Windows/Linux menu is gone, so zoom (Ctrl +/−/0), reload (Ctrl+R) and, in dev builds, DevTools are wired as plain keys instead.

Stacked on #5290, because the palettes re-tint #5290's tokens. Review the commits after fix(ui): follow the OS theme when none is saved.

Test plan

  • npx vitest run and npx tsc --noEmit -p . in src/gaia/apps/webui pass, including palettes.test.ts: every palette, plus awkward custom picks such as pure white and neon yellow, holds text to 4.5:1 in light and dark
  • npm test in tests/electron passes (868)
  • npm run test:visual in src/gaia/apps/webui: 12 snapshots match (the baselines are updated for the Colors picker and the title fade)
  • Desktop app on Windows: there is no menu bar and no separate title bar; minimize, maximize and close work and follow light and dark; dragging the top row moves the window; header buttons still click. Checked on Windows 11: Windows' own hit test reports resize on every edge and corner, drag on the top band, and the close button where it's drawn
  • Desktop app: Ctrl+= / Ctrl+- / Ctrl+0 zoom in a real window; clicking the Settings backdrop in the top band closes Settings
  • macOS: traffic lights sit over the sidebar's first row and don't overlap the GAIA icon
  • Settings › General › Colors: pick Blue marble, then Custom with a bright accent, in light and dark; text stays readable, and the window controls change with the palette
  • Sidebar: a long chat title fades at the edge, and a short one is untouched
  • Sidebar: drag its edge (200–420px), release below 150px to collapse, double-click to reset; the width survives a reload
🔍 Technical details
  • main.cjs uses titleBarStyle: "hidden" with titleBarOverlay (48px) on Windows and Linux, trafficLightPosition on macOS, and Menu.setApplicationMenu(null) off macOS. The renderer sends the live --bg-primary and --text-primary over window:set-titlebar-colors, validated as #rrggbb.
  • In CSS, :root[data-titlebar] adds an invisible drag band and makes interactive elements no-drag. .task-header pads right by env(titlebar-area-*) to clear the controls.
  • palettes.css is generated by scripts/gen_palettes.py and re-tints only the neutral and accent tokens; status colors, code surfaces and shadows are shared. Custom colors are derived at runtime by deriveCustomTokens() with the same contrast rules.
  • contrast.test.ts treats palettes.css as a token source and allowlists palette.ts. palettes.test.ts checks every palette block and the custom derivation.

GAIA's motion had 84 hand-written timings and gave no sign of life on the newer
pieces. Every animation and transition now takes its duration and easing from
tokens in index.css, and a lint test keeps it that way.

- The live status line sweeps a subtle highlight while the model works and
  stops when GAIA waits on the user.
- Plan steps tick over when done, the side rail slides in, queued messages and
  GPU-queue places ease in. Their selectors apply once those components land.
- Reduced motion also stops script-driven motion: the status typewriter and
  smooth scrolling.
- Every looping animation is tied to live work, so an idle window is still.

Closes amd#5259
The Agent UI now wears the approved redesign's foundation: warm gray
neutrals, muted brass for actions and focus only, Inter in place of DM Sans
and Space Mono, layered elevation that lifts on hover and settles on press,
and a spring for meaningful moments. Every token keeps its name, so the open
feature PRs pick the new look up without edits.

- Tokens: palette in both themes, --accent-solid, --accent-ring,
  --shadow-press, --ease-spring, --duration-spring/-press, type-scale sizes.
- Shared controls: soft-tinted buttons, sentence-case dialog titles, toast,
  badge, and an app notice that draws its warning icon.
- Labels set in uppercase or monospace become sentence-case Inter in the
  stylesheets no other open PR touches; machine text stays monospace.
- Marks that used the accent fill as a solid (switch, progress, count
  badges, suggested permission) move to roles that stay visible.
- ScheduleManager no longer redefines the shared buttons app-wide.
- Spec: "The Agent UI's palette" section; the TUI keeps copper until a
  brass survives 256-colour rounding, and the cross-surface test pins it.
- Visual regression: Playwright snapshots of six screens in both themes
  (npm run test:visual), API answered from fixtures, unknown calls fail.
…cision commit

The next commit re-applies it alone, so the choice between diverging accents
and holding brass for the TUI can be reverted or kept as one unit.
…eeps copper

Decision needed: the Agent UI and TUI accents diverge. On a 256-colour
terminal the light brass #7A5A22 rounds to #875F00, the entry the TUI
already uses for Warning and Selected, so the TUI cannot take brass as is.

This commit is the provisional answer, kept apart so it can be reverted as
one unit: the cross-surface test pins the TUI's copper on its own instead of
requiring equality with the Agent UI, and the spec records the split.

The alternative is to hold the Agent UI on copper until a terminal-safe
brass exists for both surfaces.
A fresh install opened dark on a light-mode PC; the pre-paint and the store both defaulted to dark.
The window had a system title bar and a File/Edit/View menu above the app. The menu is gone on Windows and Linux, the title bar is hidden, and the native window controls sit in the app's top row (traffic lights on macOS), colored from the live theme tokens. The top band drags the window; buttons and fields stay clickable.
The warm gray look stays the default. Settings > General > Colors adds eight palettes (Stone and ink, Blue marble, Glacier, Forest floor, Sage and mist, Basalt and lichen, Graphite and gold, Dusk) and Custom, where an accent and a background tint derive every other color. Each works in light and dark; text is held to 4.5:1 on every surface, for the palettes and for any custom pick, and the desktop window controls follow the palette.
The chat list and the model line at the foot of the sidebar now fade the last few characters of a title that doesn't fit, as the chat header already does; short titles are untouched.
@github-actions github-actions Bot added documentation Documentation changes tests Test changes electron Electron app changes website GAIA website (amd-gaia.ai) labels Oct 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

The code looks right. The desktop app loses its system title bar and menu, Settings gains eight color palettes plus a Custom option that can't produce unreadable text, and long chat titles fade instead of ending in "…". I found no correctness bugs: the color handoff to the native window controls is validated on both ends, and the palette contrast rules are pinned by tests.

Before merge:

  • Show the frameless window working. Nothing in the PR shows the new title bar on a real Windows or macOS window, and that test-plan item is unchecked. Add a screenshot of the top row with the window controls, plus a note that dragging and the header buttons work. Of the whole change, this is the part the code and the browser-based snapshots can't prove.
  • Clicks in the top band. The window-drag band spans the full top of the window. Any clickable thing up there that isn't a button, link, input or dialog, such as the Settings backdrop, becomes a drag handle instead of a click. Worth a quick check while you're on the desktop build.

Real-world evidence

N/A: no evidence bundle was produced for this run, and the PR description shows no screenshots or desktop-app output. The 12 committed visual baselines cover the browser-rendered screens (palette picker, title fade) but only on Windows, and they don't exercise the Electron frame. This verdict rests on static review alone for the frameless window and the native control colors. I couldn't run the vitest suites here (no node_modules), so the test plan's green results are unconfirmed by this review.

🔍 Technical details

Issues

🟡 Missing desktop-frame evidence. main.cjs now uses titleBarStyle: "hidden" + titleBarOverlay, calls Menu.setApplicationMenu(null) off macOS and adds the window:set-titlebar-colors IPC. Those are surfaces only a real Electron window exercises. Per the rubric, attach a before→after screenshot of the desktop window (Windows, and macOS if possible) to the PR description. Removing the app menu also drops the default accelerators (Ctrl+R reload, Ctrl+/- zoom, Ctrl+Shift+I DevTools) on Windows/Linux. If that's intended, a line in the PR saying so is enough.

🟢 Backdrop clicks in the drag band (src/styles/index.css:687-703). Electron computes drag regions regardless of z-index or pointer-events: none, so the fixed body::before band is draggable under every overlay. The no-drag list covers role="dialog", which saves the .modal-overlay modals. But .settings-overlay (SettingsDialog.tsx:72) has no role, so clicking its backdrop in the top 48px drags the window instead of closing Settings. One fix is adding .settings-overlay (or [aria-modal="true"] plus overlay classes) to the no-drag selector.

🟢 Stale comment (index.html:4-5). The default is now "follow the OS", not dark:

    <!-- Canvas color; rewritten per theme and palette by applyTheme() /
         syncTitleBar(). With no saved preference the app follows the OS. -->

🟢 Two IPC round-trips per theme change (utils/theme.ts:602, utils/palette.ts:583). applyTheme calls syncTitleBar() before applyPalette has re-derived the custom tokens, so with Custom active it first sends the previous theme's colors and then the correct ones. Every caller (main.tsx, setThemePreference, syncSystemTheme) already calls applyPalette right after, so the call inside applyTheme can go.

🟢 gen_palettes.py tidy-ups (scripts/gen_palettes.py:591,609,610,649-662):

  • on_solid is computed but never used.
  • mix(bg, "#FFFFFF", 0.0) is dead code.
  • "#FFFFFF" if not dark else "#FFFFFF" is a no-op ternary.
  • The file writes on import, with no if __name__ == "__main__": guard.

The derivation also exists twice, in Python and in deriveCustomTokens in TS. palettes.test.ts holds both to the contrast floor, but nothing pins the two formulas to each other, so a tweak to one silently forks Custom from the presets.

🟢 Visual baselines are Windows-only and not in CI. snapshotPathTemplate includes {platform}, and only -win32 PNGs are committed. So npm run test:visual fails with missing snapshots on Linux and macOS, and no workflow runs it. That's fine as a local tool; a line in the config header saying so would save the next contributor a confusing failure.

Strengths

  • Validation on both ends of the new IPC channel: #rrggbb is checked in the main process (it throws), and isHexColor guards persisted custom colors. A corrupted localStorage value can't reach setTitleBarOverlay or the CSS.
  • deriveCustomTokens pushes text toward black or white until it clears 4.6:1 on every surface. palettes.test.ts checks every palette plus awkward custom picks (pure white, neon yellow), so the "can't make text unreadable" claim is actually tested.
  • --bg-active is back in the contrast SURFACES set instead of carrying a long exemption comment. The new palettes made it fixable, and the test now guards it.

…when collapsed

The sidebar had a fixed width, and with the title bar gone, collapsing it
removed the app's only icon from the window.

- Right-edge handle, 200-420px, release under 150px to collapse,
  double-click resets to 260, arrow/Home/End keys, width remembered.
- Collapsed rail keeps the GAIA icon above the expand button.
Every unit-test job failed because the import-every-module check ran gen_palettes.py, which wrote palettes.css at import time. The work now sits behind main(). Also drops dead code: an unused on_solid, a zero-weight mix and a no-op ternary. The generated CSS is unchanged.
…lose from the top band

Removing the Windows/Linux app menu also removed Ctrl +/-/0 zoom, Ctrl+R
reload and the DevTools keys. They are wired back explicitly; DevTools only
in unpackaged builds.

- Clicking the Settings backdrop in the top 48px dragged the window instead
  of closing Settings; the overlay is now a no-drag region.
- A theme change sent the window-control colors twice, the first time with
  the previous palette; applyPalette is now the only sender.
- index.html's theme-color comment still said the default was dark.
On Linux or macOS the first run reports missing snapshots, which looked like a failure.
@kovtcharov

Copy link
Copy Markdown
Contributor Author

Addressed everything except pinning the two palette formulas to each other. The red unit-test and import checks were one bug: the palette generator wrote a file when imported. Removing the menu had also removed zoom, reload and DevTools keys on Windows and Linux; they're wired back, with DevTools in dev builds only.

  • Frameless window evidence: the Test plan now records a Windows 11 check. Windows' own hit test reports resize on every edge and corner, drag on the top band, and the close button where it's drawn; zoom keys were exercised in a real window. macOS is still unchecked.
  • Settings backdrop in the drag band: fixed; it's a no-drag region now.
  • Two title-bar updates per theme change: fixed; only the palette step sends colors, with a test pinning one call.
  • Stale comment, generator tidy-ups, Windows-only snapshots: fixed, and the visual config now says it's a local tool baselined on Windows.
  • Not changing: pinning the Python presets to the TypeScript Custom derivation. They share rules but not inputs. Presets start from hand-picked canvas, sidebar and text colors; Custom derives those from two picks. A pin test would force one formula onto the other and move pixels in shipped presets. The property users depend on, readable text, is what palettes.test.ts enforces for both.
🔍 Technical details
  • Generator: 7a532710b (work behind main(); the generated CSS is byte-identical).
  • Keys, backdrop, single color update, comment: 8f8dcb7d6 (services/window-keys.cjs + tests/electron/window-keys.test.cjs, titlebar.sync.test.ts).
  • Snapshot note: c015e2c77.
  • One known divergence between the formulas: dark --bg-card is the canvas in presets but a 6% text mix in Custom. Both clear the contrast floor.

# Conflicts:
#	src/gaia/apps/webui/src/components/SettingsModal.css
#	src/gaia/apps/webui/src/styles/index.css
…into wf3-5312

# Conflicts:
#	src/gaia/apps/webui/index.html
# Conflicts:
#	src/gaia/apps/webui/src/styles/index.css
# Conflicts:
#	src/gaia/apps/webui/index.html
#	src/gaia/apps/webui/src/main.tsx
#	src/gaia/apps/webui/src/stores/chatStore.ts
#	src/gaia/apps/webui/visual/__screenshots__/documents-dark-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/documents-light-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/finished-answer-dark-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/finished-answer-light-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/new-chat-dark-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/new-chat-light-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/scheduled-tasks-dark-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/scheduled-tasks-light-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/settings-general-dark-win32.png
#	src/gaia/apps/webui/visual/__screenshots__/settings-general-light-win32.png
#	src/gaia/apps/webui/visual/playwright.config.ts
# Conflicts:
#	docs/guides/agent-ui.mdx
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 19, 2026
Merged via the queue into amd:main with commit d5568b4 Oct 19, 2026
57 of 58 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/ui-desktop-palettes branch October 19, 2026 12:50
kovtcharov-amd pushed a commit to kovtcharov/gaia that referenced this pull request Oct 19, 2026
… install cards (amd#5351)

The home page's two install cards described the desktop app and the
terminal in words only, so a visitor choosing between them couldn't see
either. Each card now opens with a short loop recorded from a real
session: the desktop app answering a question about a document, and the
terminal writing a small function. The site's design is unchanged; the
starfield, type and buttons are untouched. Visitors who prefer reduced
motion see the last frame as a still.

| Desktop app | Terminal |
|---|---|
| ![Desktop
app](https://raw.githubusercontent.com/kovtcharov/gaia/kalin/website-app-previews/website/public/previews/agent-ui.gif)
|
![Terminal](https://raw.githubusercontent.com/kovtcharov/gaia/kalin/website-app-previews/website/public/previews/tui.gif)
|

The desktop loop shows the redesigned Agent UI from amd#5290 and amd#5312, so
it's best merged with or after those.

## Test plan

- [x] `npx vitest run` in `website/` (238 passed) and `astro check` (0
errors)
- [x] Home page at 1440 px and 390 px: both loops sit at the top of
their cards with no horizontal scroll
- [x] With reduced motion on, both cards show the still PNGs instead of
the GIFs
- [ ] On a Windows x64 visitor, the single "GAIA for Windows" card shows
both loops side by side

<details>
<summary>🔍 Technical details</summary>

- New `SurfacePreview.astro`: a `<picture>` with a
`prefers-reduced-motion` source for the still, lazy-loaded at 720×450
and framed with the panel radius and border tokens (no colour literals).
- Assets: 345 KB in total (two GIFs at 184 KB and 66 KB, two PNG
stills). Both are 720 px wide for about 2× density in the ~290 px cards.
- Recorded against a clean demo profile on Fireworks AI; the terminal
clip comes from the TUI's own control-API frame recording.
</details>
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Oct 23, 2026
… platform (amd#5646)

On some Linux setups the Agent UI desktop app either crashes at GPU
startup (amd#999, Fedora Kinoite with ROCm on RDNA4) or opens without
window decorations under GNOME Wayland (amd#1068). Both reporters found a
Chromium flag that fixes it, but GAIA gave them no supported way to set
it. In amd#999 we promised a `GAIA_DISABLE_GPU` switch that never shipped.
Now `GAIA_DISABLE_GPU=1` turns the GPU off, and the troubleshooting page
shows how to pass `--ozone-platform=x11` in a way that sticks. The
forced `ozone-platform-hint=auto` is dropped as dead code: Electron 38+
already defaults to it, and a user's `--ozone-platform` flag wins over
it either way. The Linux troubleshooting page shows both, for the
AppImage and the .deb.

Closes amd#999
Refs amd#1068 (needs a re-test on Wayland: amd#5312 since made the Linux
window frameless, so the original symptom may have changed)

## Test plan
- [x] New `tests/electron/chromium-switches.test.cjs` (16 tests):
per-platform defaults, which `GAIA_DISABLE_GPU` values count as on, no
ozone switch added, and switches applied before `app.whenReady()`
- [x] Launched the pinned Electron (44.x) with the switch module:
`disable-gpu` is applied only when `GAIA_DISABLE_GPU=1`
- [x] `util/check_doc_links.py` reports all links valid
- [ ] On Fedora Kinoite with ROCm, `GAIA_DISABLE_GPU=1` launches the
AppImage without the SIGTRAP
- [ ] On GNOME Wayland, the window shows working controls, with and
without `--ozone-platform=x11`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes electron Electron app changes tests Test changes website GAIA website (amd-gaia.ai)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants