@amd-gaia/agent-ui 0.25.1 → 0.25.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <meta name="theme-color" content="#1A1917" />
9
9
  <link rel="icon" type="image/png" href="./favicon.png" />
10
10
  <title>GAIA Agent UI</title>
11
- <script type="module" crossorigin src="./assets/index-D-noqAc3.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-BC-t_v_0.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
13
13
  <link rel="modulepreload" crossorigin href="./assets/apiBase-BmPG2Rib.js">
14
14
  <link rel="stylesheet" crossorigin href="./assets/index-CtsaRdvF.css">
package/main.cjs CHANGED
@@ -106,6 +106,7 @@ const { createStartupDeepLinkQueue } = require("./services/deep-link-queue.cjs")
106
106
  const { installWindowKeys } = require("./services/window-keys.cjs");
107
107
  const { installQuitCleanup } = require("./services/quit-cleanup.cjs");
108
108
  const { chromiumSwitches } = require("./services/chromium-switches.cjs");
109
+ const { titleBarKind, titleBarOptions } = require("./services/window-frame.cjs");
109
110
 
110
111
  // No ozone switch: Electron 38+ already picks Wayland or X11, and users override with --ozone-platform=x11.
111
112
  for (const [name, value] of chromiumSwitches({ platform: process.platform, env: process.env })) {
@@ -523,32 +524,18 @@ function reportBlockedLink(url) {
523
524
  );
524
525
  }
525
526
 
526
- // No system title bar: the app's own top row is the window's top edge, and
527
- // the native window controls are drawn into it (traffic lights on macOS).
528
- // Keep the height in sync with --titlebar-h in src/styles/index.css. The
529
- // renderer sends its canvas and text colors once it paints; until then the
530
- // controls use the dark canvas, like the window background.
531
- const TITLE_BAR_HEIGHT = 48;
532
- const TITLE_BAR_INITIAL = { color: "#1A1917", symbolColor: "#EFECE6" };
533
- const IS_MAC = process.platform === "darwin";
527
+ // Windows and macOS draw the native controls into the app's own top row; Linux
528
+ // keeps the system frame (services/window-frame.cjs).
529
+ const TITLE_BAR_KIND = titleBarKind(process.platform);
534
530
  const HEX_COLOR = /^#[0-9a-fA-F]{6}$/;
535
531
 
536
- function titleBarOptions() {
537
- return IS_MAC
538
- ? { titleBarStyle: "hidden", trafficLightPosition: { x: 16, y: 16 } }
539
- : {
540
- titleBarStyle: "hidden",
541
- titleBarOverlay: { ...TITLE_BAR_INITIAL, height: TITLE_BAR_HEIGHT },
542
- };
543
- }
544
-
545
532
  // The renderer sends its canvas and text colors so the controls match the theme.
546
533
  ipcMain.handle("window:set-titlebar-colors", (_event, colors) => {
547
534
  const { color, symbolColor } = colors || {};
548
535
  if (!HEX_COLOR.test(color) || !HEX_COLOR.test(symbolColor)) {
549
536
  throw new Error(`Title bar colors must be #rrggbb, got ${JSON.stringify(colors)}`);
550
537
  }
551
- if (!IS_MAC && mainWindow && !mainWindow.isDestroyed()) {
538
+ if (TITLE_BAR_KIND === "overlay" && mainWindow && !mainWindow.isDestroyed()) {
552
539
  mainWindow.setTitleBarOverlay({ color, symbolColor });
553
540
  }
554
541
  return true;
@@ -567,7 +554,7 @@ function titleDownloadSaveDialogs() {
567
554
 
568
555
  function createWindow() {
569
556
  mainWindow = new BrowserWindow({
570
- ...titleBarOptions(),
557
+ ...titleBarOptions(process.platform),
571
558
  width: windowConfig.width,
572
559
  height: windowConfig.height,
573
560
  minWidth: windowConfig.minWidth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amd-gaia/agent-ui",
3
- "version": "0.25.1",
3
+ "version": "0.25.2-rc.1",
4
4
  "type": "module",
5
5
  "productName": "GAIA Agent UI",
6
6
  "description": "Chat with the GAIA agent - local and private by default on AMD Ryzen AI, cloud models when you choose them",
@@ -73,7 +73,7 @@
73
73
  "@types/react": "^19.2.17",
74
74
  "@types/react-dom": "^19.2.3",
75
75
  "@vitejs/plugin-react": "^6.0.2",
76
- "electron": "^44.5.1",
76
+ "electron": "^45.0.0",
77
77
  "electron-builder": "^26.8.1",
78
78
  "jsdom": "^30.0.1",
79
79
  "json-schema-to-typescript": "16.0.0",
package/preload.cjs CHANGED
@@ -87,10 +87,14 @@ contextBridge.exposeInMainWorld("gaiaAPI", {
87
87
  });
88
88
 
89
89
  // ── Window frame ─────────────────────────────────────────────────────────
90
- // The app draws its own top row; this says how the native controls sit in it.
90
+ // Says whether the app draws its own top row and where the native controls sit in it.
91
91
  contextBridge.exposeInMainWorld("gaiaWindow", {
92
- /** "mac": traffic lights at the top left; "overlay": controls at the top right. */
93
- titleBar: process.platform === "darwin" ? "mac" : "overlay",
92
+ /**
93
+ * "mac": traffic lights at the top left; "overlay": controls at the top right;
94
+ * "native": the system frame. Must match titleBarKind in services/window-frame.cjs
95
+ * (a sandboxed preload can't require it).
96
+ */
97
+ titleBar: { darwin: "mac", win32: "overlay" }[process.platform] || "native",
94
98
  /** Match the native window controls to the app: { color, symbolColor } as #rrggbb. */
95
99
  setColors: (colors) => ipcRenderer.invoke("window:set-titlebar-colors", colors),
96
100
  });
@@ -0,0 +1,41 @@
1
+ // Copyright(C) 2026 Advanced Micro Devices, Inc. All rights reserved.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ /**
5
+ * How the main window's frame is drawn on each platform. Pure so the
6
+ * BrowserWindow options are testable without launching Electron.
7
+ *
8
+ * - "mac": no title bar; the traffic lights sit over the app's top row.
9
+ * - "overlay" (Windows): no title bar; Chromium draws the controls over it.
10
+ * - "native" (Linux): the system frame. GNOME Wayland has no server-side
11
+ * decorations, so a hidden title bar there loses its controls.
12
+ */
13
+
14
+ // Keep in sync with --titlebar-h in src/styles/index.css.
15
+ const TITLE_BAR_HEIGHT = 48;
16
+ // Until the renderer sends its theme colors, the controls use the dark canvas.
17
+ const TITLE_BAR_INITIAL = { color: "#1A1917", symbolColor: "#EFECE6" };
18
+
19
+ /** @returns {"mac" | "overlay" | "native"} */
20
+ function titleBarKind(platform) {
21
+ if (platform === "darwin") return "mac";
22
+ if (platform === "win32") return "overlay";
23
+ return "native";
24
+ }
25
+
26
+ /** BrowserWindow options that set up the frame, spread into the constructor. */
27
+ function titleBarOptions(platform) {
28
+ switch (titleBarKind(platform)) {
29
+ case "mac":
30
+ return { titleBarStyle: "hidden", trafficLightPosition: { x: 16, y: 16 } };
31
+ case "overlay":
32
+ return {
33
+ titleBarStyle: "hidden",
34
+ titleBarOverlay: { ...TITLE_BAR_INITIAL, height: TITLE_BAR_HEIGHT },
35
+ };
36
+ default:
37
+ return {};
38
+ }
39
+ }
40
+
41
+ module.exports = { TITLE_BAR_HEIGHT, titleBarKind, titleBarOptions };