A personal assistant that lives on your desktop, remembers what matters, and can use your Mac for you.
TypeScript
feat(ui): show yolo mode as an amber rim on the rose
Alan Buscaglia28049af44392
diff --git a/packages/ui/src/components/DotSurface.tsx b/packages/ui/src/components/DotSurface.tsxindex 1b2f278..89abe24 100644--- a/packages/ui/src/components/DotSurface.tsx+++ b/packages/ui/src/components/DotSurface.tsx@@ -80,7 +80,6 @@ export function DotSurface({<span className="dot-disc" aria-hidden="true"><Rose mood={inControl ? "control" : MOODS[state]} /></span>- {yolo ? <span className="dot-yolo-mark" aria-hidden="true" /> : null}{state === "needs_you" ? (<span className="dot-badge" aria-hidden="true">!diff --git a/packages/ui/src/styles.css b/packages/ui/src/styles.cssindex 0c08ce2..0025eb2 100644--- a/packages/ui/src/styles.css+++ b/packages/ui/src/styles.css@@ -271,6 +271,12 @@ textarea:focus {--rim-glow: rgba(240, 149, 200, 0.35);}+/* Yolo mode (S24.9): the rim turns amber while risky actions run unasked; after in-control so it wins. */+.dot-yolo .dot-disc {+ --rim: var(--yellow);+ --rim-glow: rgba(224, 194, 122, 0.45);+}+.rose {position: relative;display: block;@@ -451,20 +457,6 @@ textarea:focus {0 0 4px rgba(245, 165, 36, 0.7);}-/* Yolo mode (S24.9): a yellow mark at the bottom right, over every state, while risky actions run unasked. */-.dot-yolo-mark {- position: absolute;- right: 5px;- bottom: 5px;- width: 10px;- height: 10px;- border-radius: 50%;- background: var(--yellow);- box-shadow:- 0 0 0 1.5px #050506,- 0 0 6px var(--yellow);-}-/* Reduce motion: no traveling light (frozen dashes would look broken); the glow stays, stronger when busy.Glow radii stay small so the glow stays inside the disc. */@media (prefers-reduced-motion: reduce) {diff --git a/packages/ui/test/computer.test.tsx b/packages/ui/test/computer.test.tsxindex 36dc4a9..247b779 100644--- a/packages/ui/test/computer.test.tsx+++ b/packages/ui/test/computer.test.tsx@@ -312,17 +312,16 @@ describe("yolo mode (S24.9)", () => {expect(within(banner).queryByText("Yolo")).toBeNull();});- it("the rose carries a yolo marker while it is on", async () => {+ it("the rose's rim turns amber while yolo mode is on, with no separate mark", async () => {await renderApp("?surface=dot");const dot = screen.getByRole("button");await emitState({ active: true, endsAt: Date.now() + 60_000, yolo: true });expect(dot).toHaveClass("dot-in_control", "dot-yolo");expect(dot).toHaveAccessibleName("Gentle Dot: controlling your Mac, yolo mode on");- expect(dot.querySelector(".dot-yolo-mark")).not.toBeNull();+ expect(dot.querySelector(".dot-yolo-mark")).toBeNull();await emitState({ active: true, endsAt: Date.now() + 60_000, yolo: false });expect(dot).not.toHaveClass("dot-yolo");- expect(dot.querySelector(".dot-yolo-mark")).toBeNull();});it("styles the yolo marker and switch with the site's tokens", () => {@@ -330,7 +329,12 @@ describe("yolo mode (S24.9)", () => {const css = readFileSync(fileURLToPath(new URL(stylesheet, import.meta.url)), "utf8");const rule = (selector: string) =>css.match(new RegExp(`\\n${selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")} \\{([^}]*)\\}`))?.[1] ?? "";- expect(rule(".dot-yolo-mark")).toMatch(/var\(--yellow/);+ expect(rule(".dot-yolo-mark")).toBe("");+ expect(rule(".dot-yolo .dot-disc")).toMatch(/--rim: var\(--yellow\)/);+ // It follows the in-control rim, so it wins while both are on.+ expect(css.indexOf("\n.dot-yolo .dot-disc {")).toBeGreaterThan(+ css.indexOf("\n.dot-in_control .dot-disc {"),+ );expect(rule(".computer-yolo-chip")).toMatch(/var\(--yellow/);expect(rule('.switch[aria-checked="true"]')).toMatch(/var\(--accent/);});