Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

cua-spaces: the Cua key as the notification icon (#5441)

Francesco Bonacci93159a78509a
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Resources/cua-key.png b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Resources/cua-key.png
new file mode 100644
index 0000000000..52314f94e6
Binary files /dev/null and b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Resources/cua-key.png differ
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AgentsViews.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AgentsViews.swift
index f4170f5eb0..df2017757d 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AgentsViews.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/AgentsViews.swift
@@ -234,7 +234,10 @@ struct NotificationsPageView: View {
Section(v.title) {
if v.rows.isEmpty { Text(v.emptyText).foregroundStyle(.secondary) }
ForEach(v.rows, id: \.id) { l in
- HStack {
+ HStack(spacing: 10) {
+ if let key = CuaKey.image {
+ Image(nsImage: key).resizable().interpolation(.high).frame(width: 20, height: 20).accessibilityHidden(true)
+ }
Text(l.text).lineLimit(1).fontWeight(l.on == true ? .semibold : .regular)
Spacer()
Text(l.trailing).foregroundStyle(.secondary)
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift
index 07638990bf..898b638200 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift
@@ -650,6 +650,16 @@ struct PromptTicker: View {
}
}
+/// The Cua key: the app icon's keycap with the stacked Cua mark, on its own
+/// (apps/cua-spaces-macos/scripts/dmg-art/key.html). The icon of Cua's own
+/// notifications, in place of a colored tile; unread stays with the text.
+public enum CuaKey {
+ public static let image: NSImage? = {
+ guard let url = ModuleResources.url(forResource: "cua-key", withExtension: "png") else { return nil }
+ return NSImage(contentsOf: url)
+ }()
+}
+
/// The stacked Cua mark (generated by apps/cua-spaces/scripts/icons).
public enum StackMark {
public static let image: NSImage? = {
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ResourceLookupTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ResourceLookupTests.swift
index 365d220b25..6c7e513926 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ResourceLookupTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ResourceLookupTests.swift
@@ -13,6 +13,7 @@ struct ResourceLookupTests {
@Test func theResourcesLoad() {
#expect(ModuleResources.bundle != nil)
#expect(StackMark.image != nil)
+ #expect(CuaKey.image != nil)
#expect(ModuleResources.url(forResource: "tray-template@2x", withExtension: "png") != nil)
}
diff --git a/apps/cua-spaces-macos/scripts/dmg-art/key.html b/apps/cua-spaces-macos/scripts/dmg-art/key.html
new file mode 100644
index 0000000000..b20c8d9915
--- /dev/null
+++ b/apps/cua-spaces-macos/scripts/dmg-art/key.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<!-- SPDX-License-Identifier: FSL-1.1-MIT -->
+<!-- Copyright (c) 2026 Cua AI, Inc. -->
+<!--
+ The Cua key on its own: the app icon's key (product-1 with the Spaces stack,
+ the official Cua mark unaltered in the front square, multiplied into the
+ glaze, turned 6 degrees) on a transparent square, the same legend as the app
+ icon in art.html. Notifications use it as their icon, in place of a blue
+ tile. The PNGs are checked in; to redraw them, screenshot this page at
+ 1024 x 1024 with headless Chrome and scale it with sips to 32, 64 and 128.
+-->
+<meta charset="utf-8">
+<style>
+ html, body { margin: 0; background: transparent; overflow: hidden; }
+ .stage { position: relative; width: 1024px; height: 1024px; }
+ .key { position: absolute; left: 62px; top: 74px; width: 900px; height: 870px; transform: rotate(6deg); }
+ .key img.sprite { position: absolute; inset: 0; width: 100%; height: 100%; }
+ .legend { position: absolute; left: 0; top: 0; width: 100px; height: 100px; transform-origin: 0 0; }
+ .legend > img { position: absolute; inset: 24%; width: 52%; height: 52%; object-fit: contain; opacity: .8; mix-blend-mode: multiply; }
+</style>
+<div class="stage"><div class="key" id="key"></div></div>
+<script>
+ // product-1's sprite size and the quad of its top face, as in art.html.
+ const SPR = { w: 486, h: 470, quad: [[105, 78], [325, 22], [415, 215], [165, 268]] };
+ function homography(q, t = 100) {
+ const [[n, r], [i, a], [o, s], [c, l]] = q;
+ const u = i - o, d = c - o, f = a - s, p = l - s, m = n - i + o - c, h = r - a + s - l, g = u * p - d * f;
+ const _ = (m * p - d * h) / g, v = (u * h - m * f) / g;
+ const y = i - n + _ * i, b = c - n + v * c, x = a - r + _ * a, S = l - r + v * l, C = 1 / t, w = 1 / 100;
+ return `matrix3d(${y * C},${x * C},0,${_ * C},${b * w},${S * w},0,${v * w},0,0,1,0,${n},${r},0,1)`;
+ }
+ const k = 900 / SPR.w;
+ document.getElementById("key").innerHTML = `<img class="sprite" src="src/product-1.webp">` +
+ `<div class="legend" style="transform:${homography(SPR.quad.map(([x, y]) => [x * k, y * k]))}"><img src="src/spaces-tray-template.svg"></div>`;
+</script>
diff --git a/apps/cua-spaces-web/public/cua-key-128.png b/apps/cua-spaces-web/public/cua-key-128.png
new file mode 100644
index 0000000000..52314f94e6
Binary files /dev/null and b/apps/cua-spaces-web/public/cua-key-128.png differ
diff --git a/apps/cua-spaces-web/public/cua-key-32.png b/apps/cua-spaces-web/public/cua-key-32.png
new file mode 100644
index 0000000000..b2b75375b8
Binary files /dev/null and b/apps/cua-spaces-web/public/cua-key-32.png differ
diff --git a/apps/cua-spaces-web/public/cua-key-64.png b/apps/cua-spaces-web/public/cua-key-64.png
new file mode 100644
index 0000000000..30c7416cf7
Binary files /dev/null and b/apps/cua-spaces-web/public/cua-key-64.png differ
diff --git a/apps/cua-spaces-web/src/components/cua-key.tsx b/apps/cua-spaces-web/src/components/cua-key.tsx
new file mode 100644
index 0000000000..dae3c07e78
--- /dev/null
+++ b/apps/cua-spaces-web/src/components/cua-key.tsx
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+import { cn } from "@/lib/utils";
+
+/**
+ * The Cua key: the app icon's blue keycap with the stacked Cua mark, on its
+ * own (rendered by apps/cua-spaces-macos/scripts/dmg-art/key.html). It is the
+ * icon of Cua's own notifications, so they read as Cua's in light and dark
+ * without a colored tile. It says who, never what: unread and error stay with
+ * their own dot and color. `size` is in CSS px (16 to 40); the browser picks
+ * the sharpest of the 32, 64 and 128 px files for the display.
+ */
+export function CuaKey({ size = 20, className, label }: { size?: number; className?: string; label?: string }) {
+ return (
+ <img
+ src="/cua-key-64.png"
+ srcSet="/cua-key-32.png 32w, /cua-key-64.png 64w, /cua-key-128.png 128w"
+ sizes={`${size}px`}
+ width={size}
+ height={size}
+ alt={label ?? ""}
+ aria-hidden={label ? undefined : true}
+ draggable={false}
+ className={cn("shrink-0 select-none object-contain", className)}
+ />
+ );
+}
diff --git a/apps/cua-spaces-web/src/components/shell/sidebar.tsx b/apps/cua-spaces-web/src/components/shell/sidebar.tsx
index 524588e7b8..0e7d1dd447 100644
--- a/apps/cua-spaces-web/src/components/shell/sidebar.tsx
+++ b/apps/cua-spaces-web/src/components/shell/sidebar.tsx
@@ -7,6 +7,7 @@ import { useRef, type PointerEvent } from "react";
import { LogOutIcon } from "lucide-react";
import { signInCodeText, useBridge, useMachines, useNotifications, useRelayUsageView, useSession, useSpaces, useTrackPlanClick } from "@/bridge";
+import { CuaKey } from "@/components/cua-key";
import { Button } from "@/components/ui/button";
import { toast } from "@/components/ui/toast";
import { Tooltip } from "@/components/ui/tooltip";
@@ -52,8 +53,10 @@ export function Sidebar() {
<item.icon className={cn("size-4 text-muted-foreground", isActive && "text-brand-strong")} strokeWidth={1.75} />
<span className="flex-1 truncate">{item.label}</span>
{item.to === "/notifications" && unread > 0 ? (
- <span data-unread-badge className="min-w-4 rounded-full bg-brand px-1 text-center text-2xs font-medium tabular-nums text-white" aria-label={`${unread} unread`}>
- {unread}
+ // The Cua key says they're Cua's; the count, in plain text, says how many are unread.
+ <span data-unread-badge className="flex items-center gap-1" aria-label={`${unread} unread`}>
+ <CuaKey size={16} />
+ <span className="text-2xs font-medium tabular-nums text-foreground">{unread}</span>
</span>
) : null}
{counts[item.to] !== undefined ? (
diff --git a/apps/cua-spaces-web/src/components/ui/toast.tsx b/apps/cua-spaces-web/src/components/ui/toast.tsx
index 652c0d4e3f..3fcb3b4882 100644
--- a/apps/cua-spaces-web/src/components/ui/toast.tsx
+++ b/apps/cua-spaces-web/src/components/ui/toast.tsx
@@ -5,6 +5,8 @@ import { Toast } from "@base-ui/react/toast";
import { CircleAlertIcon, CircleCheckIcon, InfoIcon, XIcon } from "lucide-react";
import type { ReactNode } from "react";
+import { CuaKey } from "@/components/cua-key";
+
export const toastManager = Toast.createToastManager();
type ToastType = "info" | "success" | "error";
@@ -23,9 +25,10 @@ const groups = new Map<string, Set<string>>();
/**
* Shows a toast. One with a `group` replaces that group's earlier ones: a
- * create that worked closes the failure of the try before it.
+ * create that worked closes the failure of the try before it. `fromCua` marks
+ * one of Cua's own notifications: it shows the Cua key instead of the info icon.
*/
-export function toast(title: string, options: { description?: string; type?: ToastType; group?: string } = {}) {
+export function toast(title: string, options: { description?: string; type?: ToastType; group?: string; fromCua?: boolean } = {}) {
const type = options.type ?? "info";
const group = options.group;
if (group) {
@@ -35,7 +38,7 @@ export function toast(title: string, options: { description?: string; type?: Toa
// Base UI's own timer pauses while the window is unfocused and resumes on
// focus, which a webview in a native window may never report (an
// "Opening…" toast stayed 10+ min). A plain timer closes it either way.
- const id = toastManager.add({ title, description: options.description, type, timeout: 0 });
+ const id = toastManager.add({ title, description: options.description, type, timeout: 0, data: { fromCua: options.fromCua === true } });
if (group) groups.set(group, new Set([id]));
setTimeout(() => {
toastManager.close(id);
@@ -74,7 +77,11 @@ function ToastList() {
data-video-occluder=""
className="glass flex items-start gap-2.5 rounded-xl border p-3 pr-2 shadow-float transition-[opacity,translate] duration-200 ease-out-soft data-ending-style:translate-y-2 data-ending-style:opacity-0 data-starting-style:translate-y-2 data-starting-style:opacity-0"
>
- <Icon className={t.type === "error" ? "mt-px size-4 text-destructive" : t.type === "success" ? "mt-px size-4 text-success" : "mt-px size-4 text-brand-strong"} />
+ {(t.data as { fromCua?: boolean } | undefined)?.fromCua && t.type !== "error" ? (
+ <CuaKey size={20} className="-my-0.5" />
+ ) : (
+ <Icon className={t.type === "error" ? "mt-px size-4 text-destructive" : t.type === "success" ? "mt-px size-4 text-success" : "mt-px size-4 text-brand-strong"} />
+ )}
<Toast.Content className="min-w-0 flex-1">
<Toast.Title className="text-[13px] font-medium" />
<Toast.Description className="text-xs text-muted-foreground" />
diff --git a/apps/cua-spaces-web/src/hooks/use-notification-toasts.ts b/apps/cua-spaces-web/src/hooks/use-notification-toasts.ts
index 868d96f40a..9d0cfb5f86 100644
--- a/apps/cua-spaces-web/src/hooks/use-notification-toasts.ts
+++ b/apps/cua-spaces-web/src/hooks/use-notification-toasts.ts
@@ -16,7 +16,7 @@ export function useNotificationToasts(): void {
const { mode } = useBridge();
const show = useCallback(
(note: SystemNote) => {
- if (!isNativeHost(mode)) toast(note.title, { description: note.body || undefined });
+ if (!isNativeHost(mode)) toast(note.title, { description: note.body || undefined, fromCua: true });
},
[mode],
);
diff --git a/apps/cua-spaces-web/src/routes/notifications/index.tsx b/apps/cua-spaces-web/src/routes/notifications/index.tsx
index 5eca21b5ef..75fef5443d 100644
--- a/apps/cua-spaces-web/src/routes/notifications/index.tsx
+++ b/apps/cua-spaces-web/src/routes/notifications/index.tsx
@@ -6,6 +6,7 @@ import { BellIcon } from "lucide-react";
import { useState } from "react";
import { useNotifications, type NotificationInput, type NotificationLine } from "@/bridge";
+import { CuaKey } from "@/components/cua-key";
import { EmptyState, Page, PageHeader } from "@/components/page";
import { Button } from "@/components/ui/button";
import { toastError } from "@/components/ui/toast";
@@ -88,6 +89,7 @@ function NotificationRow({ row, entry, open, onToggle }: { row: NotificationLine
data-notification-toggle
>
<span className={cn("size-1.5 shrink-0 rounded-full", row.on ? "bg-brand" : "bg-transparent")} aria-hidden />
+ <CuaKey size={20} />
<span className={cn("min-w-0 flex-1 text-[13px]", open ? "break-words" : "truncate", row.on && "font-semibold")} data-notification-text>
{open ? (entry?.title ?? row.text) : row.text}
</span>
@@ -96,7 +98,7 @@ function NotificationRow({ row, entry, open, onToggle }: { row: NotificationLine
</span>
</button>
{open ? (
- <div id={detailId} className="space-y-2.5 pr-4 pb-3 pl-[2.125rem]" data-notification-detail>
+ <div id={detailId} className="space-y-2.5 pr-4 pb-3 pl-[4.125rem]" data-notification-detail>
{entry && body ? (
<p className="whitespace-pre-wrap break-words text-[13px] text-muted-foreground" data-notification-body>
{body}