{leftOrganizationSaid(left)}
diff --git a/app/src/components/settings/settings-sidebar.tsx b/app/src/components/settings/settings-sidebar.tsx
index f3c6c9ce7a..2c017dc050 100644
--- a/app/src/components/settings/settings-sidebar.tsx
+++ b/app/src/components/settings/settings-sidebar.tsx
@@ -1,5 +1,4 @@
import {
- IconArrowLeft,
IconBell,
IconBrain,
IconBuilding,
@@ -12,6 +11,16 @@ import {
import { useQuery } from "@tanstack/react-query";
import { Link, type LinkOptions } from "@tanstack/react-router";
import type * as React from "react";
+import {
+ MenuSidebarBack,
+ MenuSidebarNotch,
+ MenuSidebarPanel,
+ menuSidebarActiveProps,
+ menuSidebarButtonClassName,
+ menuSidebarGroupClassName,
+ menuSidebarLabelClassName,
+} from "@/components/layout/menu-sidebar";
+import { SIDEBAR_SLAB } from "@/components/layout/sidebar-shell";
import {
Sidebar,
SidebarContent,
@@ -215,70 +224,80 @@ export function SettingsSidebar({
(!option.setup || canSetUp) && (!option.organization || hasOrganization),
);
return (
-
- {/* Matched to the app sidebar's header, as Admin's is. See admin-sidebar.tsx. */}
+ // A slab on the window, as the app's sidebar is.
+
+ {/* On the slab's top row, as Admin's is. See admin-sidebar.tsx. */}
(
-
- Back to app
+
)}
/>
-
- {/*
- * Group outside menu, as Admin has it. The other way round nests a list item inside a div
- * inside the `ul`, which is not markup a list is allowed to be made of.
- */}
- {SETTINGS_GROUPS.map((group) => {
- const entries = items.filter((option) => option.group === group.id);
- if (entries.length === 0) return null;
- return (
-
- {group.label}
-
- {entries.map((option) => (
-
- (
-
-
- {/* Cut short on one line in a narrow sidebar, never wrapped out of the row. */}
-
- {option.title}
-
- {option.setup && toFix > 0 ? (
-
- , {toFix} {toFix === 1 ? "needs" : "need"} setup
+
+
+ {/*
+ * Group outside menu, as Admin has it. The other way round nests a list item inside a div
+ * inside the `ul`, which is not markup a list is allowed to be made of.
+ */}
+ {SETTINGS_GROUPS.map((group) => {
+ const entries = items.filter((option) => option.group === group.id);
+ if (entries.length === 0) return null;
+ return (
+
+
+ {group.label}
+
+
+ {entries.map((option) => (
+
+
+ (
+
+
+ {/* Cut short on one line in a narrow sidebar, never wrapped out of the row. */}
+
+ {option.title}
- ) : null}
-
- )}
- />
- {option.setup && toFix > 0 ? (
-
- {toFix}
-
- ) : null}
-
- ))}
-
-
- );
- })}
-
+ {option.setup && toFix > 0 ? (
+
+ , {toFix} {toFix === 1 ? "needs" : "need"} setup
+
+ ) : null}
+
+ )}
+ />
+ {option.setup && toFix > 0 ? (
+
+ {toFix}
+
+ ) : null}
+
+ ))}
+
+
+ );
+ })}
+
+
);
diff --git a/app/src/lib/artifacts/bridge/wire.ts b/app/src/lib/artifacts/bridge/wire.ts
index e81e135d82..f5c39f0006 100644
--- a/app/src/lib/artifacts/bridge/wire.ts
+++ b/app/src/lib/artifacts/bridge/wire.ts
@@ -44,6 +44,8 @@ export const THEME_TOKENS = [
"chart-4",
"chart-5",
"empty-pattern-color",
+ "window",
+ "window-foreground",
"sidebar",
"sidebar-foreground",
"sidebar-primary",
diff --git a/app/src/lib/artifacts/tokens.css b/app/src/lib/artifacts/tokens.css
index 1c1d3ce30e..b0bd50c47e 100644
--- a/app/src/lib/artifacts/tokens.css
+++ b/app/src/lib/artifacts/tokens.css
@@ -28,6 +28,8 @@
--chart-4: oklch(0.5 0.2 18);
--chart-5: oklch(0.6 0.2 286);
--empty-pattern-color: oklch(0.746 0.117 279.9);
+ --window: oklch(0.179 0.02 252.2);
+ --window-foreground: oklch(1 0 0);
--sidebar: oklch(0.948 0.01 251.8);
--sidebar-foreground: oklch(0.108 0.042 264.7);
--sidebar-primary: oklch(0.108 0.042 264.7);
@@ -67,6 +69,8 @@
--chart-4: oklch(0.6 0.2 18);
--chart-5: oklch(0.76 0.128 286);
--empty-pattern-color: oklch(0.832 0.085 281.4);
+ --window: oklch(0.43 0.04 277.2);
+ --window-foreground: oklch(0.956 0.004 252);
--sidebar: oklch(0.156 0.017 252);
--sidebar-foreground: oklch(0.956 0.004 252);
--sidebar-primary: oklch(0.956 0.004 252);
diff --git a/app/src/lib/sidebar.ts b/app/src/lib/sidebar.ts
index bab6d89efb..2821b55a2f 100644
--- a/app/src/lib/sidebar.ts
+++ b/app/src/lib/sidebar.ts
@@ -36,15 +36,15 @@ export function applySidebarOpen(open: boolean, effects: SidebarEffects) {
/**
* The sidebar's width, one for every shell (app, admin, settings) and remembered across reloads, so
- * going from a conversation to Settings never moves the edge of the page. 360px before anybody drags
- * it: the app's roster needs that for its two-line message previews beside the strip's labelled
- * icons, and the other shells match it.
+ * going from a conversation to Settings never moves the edge of the page. 308px before anybody drags
+ * it: the design's 300px sidebar (the strip and a 244px panel, or Settings' menu) and the window's
+ * 8px beside it, which this width includes. The other shells match it.
*
* Dragged on the sidebar's edge (`SidebarRail`). Never narrower than `SIDEBAR_MIN_WIDTH` (plus the
* strip beside one); never wider than `SIDEBAR_MAX_WIDTH`, past which a roster stops being a column
* beside the work and becomes the work, nor than `SIDEBAR_MAX_SHARE` of the window.
*/
-export const SIDEBAR_WIDTH = "360px";
+export const SIDEBAR_WIDTH = "308px";
export const SIDEBAR_WIDTH_STORAGE_KEY = "openbot-sidebar-width";
/**
* Where the app's own width was kept when each shell had one. Read when the shared width was never
diff --git a/app/src/routes/_authed/_app.tsx b/app/src/routes/_authed/_app.tsx
index 62256138f4..b75d287089 100644
--- a/app/src/routes/_authed/_app.tsx
+++ b/app/src/routes/_authed/_app.tsx
@@ -51,9 +51,9 @@ function AppFrame() {
const { section, show } = useOpenSection();
return (
/*
- * The content sits in a panel inset from the window, on the sidebar's tint, so the sidebar and
- * the window's edge read as one frame and the page as the thing inside it. Before, the sidebar,
- * the page and the cards on it were three near-identical whites told apart only by hairlines.
+ * The sidebar and the page are two slabs on the window (`SidebarShell`), which shows at the
+ * window's edges and in the seam between them. Before, the sidebar, the page and the cards on it
+ * were three near-identical whites told apart only by hairlines.
*
* One viewport, never scrolls: panes scroll inside the panel, which is also what keeps its
* rounded corners on screen. A growable shell lets the transcript's scroller size against the
diff --git a/app/src/styles.css b/app/src/styles.css
index 6313565694..d8d5fc2196 100644
--- a/app/src/styles.css
+++ b/app/src/styles.css
@@ -240,8 +240,9 @@
* desktop marks the page (`data-desktop-titlebar`) and makes the sidebar's header the drag handle.
* It draws the buttons 20px in, on the middle of the header's row (`TRAFFIC_LIGHTS` in the
* desktop's main.rs), so in Admin and Settings the row starts to their right: Back to app shares
- * one line with them. The app's sidebar has no such header: its strip and panel start below the
- * buttons instead (`Strip`, `SectionPanel`). With the sidebar collapsed, or in a window too narrow
+ * one line with them. The app's sidebar has no such header: the buttons have a row of their own
+ * across its top, which its strip and panel start below (`Strip`, `SectionPanel`). With the sidebar
+ * collapsed, or in a window too narrow
* for one beside the page (where it is a sheet over the page), the buttons are over the main column,
* so that moves down below them. The main column is the shell's own ``; the primitive's
* `SidebarInset`, which an earlier rule aimed at, is used by no shell. Outside the desktop nothing
@@ -662,6 +663,166 @@
opacity: calc(var(--empty-pattern-opacity) * 0.6);
}
+/*
+ * The window the shells (the app's, Settings', Admin's) lay the sidebar and the page on, under
+ * `SidebarShell`: `--window`, set by its class there, with dots over it. The dots are read entirely
+ * from the `--window-pattern*` tokens in theme.css, as the empty-state pattern is: the tile is a
+ * mask over a flat fill of `--window-foreground`, at `--window-pattern-opacity`. They sit under
+ * everything in the shell, and show at the window's edges and in the seam between the two.
+ */
+.window-pattern {
+ position: relative;
+ isolation: isolate;
+}
+.window-pattern::before {
+ content: "";
+ position: absolute;
+ inset: 0;
+ z-index: -1;
+ pointer-events: none;
+ background-color: var(--window-foreground);
+ opacity: var(--window-pattern-opacity);
+ mask-image: var(--window-pattern);
+ mask-repeat: repeat;
+}
+/*
+ * The notch beside what is open in a sidebar (`SelectionNotch`): the window bulging into the
+ * sidebar's slab, cut to the design's outline (a bell 14 by 52, each half one curve, traced from
+ * Figma's Navigation item) and filled as the window is, with its dots. The dots start 2px left of the
+ * notch: the slab starts 8px in from the window's corner, where the window's own dots start, so the
+ * notch's fall on the same columns as the window's beside it; the strip's rows sit on the same 6px
+ * steps, so they fall on the same rows too.
+ */
+.selection-notch {
+ background-color: var(--window);
+ clip-path: path("M0 0C0 11.9 14 17.3 14 26C14 34.7 0 40.1 0 52Z");
+}
+.selection-notch::before {
+ content: "";
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ background-color: var(--window-foreground);
+ opacity: var(--window-pattern-opacity);
+ mask-image: var(--window-pattern);
+ mask-position: -2px 0;
+ mask-repeat: repeat;
+}
+
+/*
+ * Where the sidebar meets the page the two slabs touch, the page's edge the line between them, and
+ * the window dips between their corners at the top and the bottom: the design's window decoration,
+ * a gentle curve 30 by 16 on each side while the sidebar is open, a sharper one 30 by 12 while it
+ * is folded down to the strip. Each slab's corners there are cut by a mask, so the window shows in
+ * the cut as it does everywhere else, dots and all. Only a sidebar laid on the window as a slab
+ * (`SIDEBAR_SLAB`, which marks its container `sidebar-slab`) meets the page so; one folded away
+ * (Settings, Admin) leaves the page its own corners. On a narrow window the sidebar is a sheet, and
+ * none of this applies.
+ */
+.window-pattern > [data-slot="sidebar-inset"] {
+ border-width: 0;
+}
+@media (width >= 48rem) {
+ .window-pattern {
+ --ear-gentle-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 16'%3E%3Cpath d='M30 0C18.9418 0 9.259 5.86532 3.9089 14.5665C3.32283 15.5196 1.66142 15.9961 0 15.9961V16H30Z'/%3E%3C/svg%3E");
+ --ear-gentle-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 16'%3E%3Cpath transform='matrix%281 0 0 -1 0 16%29' d='M30 0C18.9418 0 9.259 5.86532 3.9089 14.5665C3.32283 15.5196 1.66142 15.9961 0 15.9961V16H30Z'/%3E%3C/svg%3E");
+ --ear-gentle-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 16'%3E%3Cpath transform='matrix%28-1 0 0 1 30 0%29' d='M30 0C18.9418 0 9.259 5.86532 3.9089 14.5665C3.32283 15.5196 1.66142 15.9961 0 15.9961V16H30Z'/%3E%3C/svg%3E");
+ --ear-gentle-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 16'%3E%3Cpath transform='matrix%28-1 0 0 -1 30 16%29' d='M30 0C18.9418 0 9.259 5.86532 3.9089 14.5665C3.32283 15.5196 1.66142 15.9961 0 15.9961V16H30Z'/%3E%3C/svg%3E");
+ --ear-sharp-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29.9401 11.6037'%3E%3Cpath d='M19.7194 0C11.9735 0 5.2571 4.40363 1.93518 10.8438C1.67755 11.3432 0.843084 11.5965 0 11.6037H29.9401V0Z'/%3E%3C/svg%3E");
+ --ear-sharp-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29.9401 11.6037'%3E%3Cpath transform='matrix%281 0 0 -1 0 11.6037%29' d='M19.7194 0C11.9735 0 5.2571 4.40363 1.93518 10.8438C1.67755 11.3432 0.843084 11.5965 0 11.6037H29.9401V0Z'/%3E%3C/svg%3E");
+ --ear-sharp-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29.9401 11.6037'%3E%3Cpath transform='matrix%28-1 0 0 1 29.9401 0%29' d='M19.7194 0C11.9735 0 5.2571 4.40363 1.93518 10.8438C1.67755 11.3432 0.843084 11.5965 0 11.6037H29.9401V0Z'/%3E%3C/svg%3E");
+ --ear-sharp-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29.9401 11.6037'%3E%3Cpath transform='matrix%28-1 0 0 -1 29.9401 11.6037%29' d='M19.7194 0C11.9735 0 5.2571 4.40363 1.93518 10.8438C1.67755 11.3432 0.843084 11.5965 0 11.6037H29.9401V0Z'/%3E%3C/svg%3E");
+ }
+ .window-pattern
+ > .peer[data-state="expanded"]:has(> .sidebar-slab)
+ ~ [data-slot="sidebar-inset"],
+ .window-pattern
+ > .peer[data-state="expanded"]
+ > .sidebar-slab
+ > [data-slot="sidebar-inner"] {
+ --ear-w: 30px;
+ --ear-h: 16px;
+ --ear-tl: var(--ear-gentle-tl);
+ --ear-bl: var(--ear-gentle-bl);
+ --ear-tr: var(--ear-gentle-tr);
+ --ear-br: var(--ear-gentle-br);
+ }
+ .window-pattern
+ > .peer[data-collapsible="icon"]:has(> .sidebar-slab)
+ ~ [data-slot="sidebar-inset"],
+ .window-pattern
+ > .peer[data-collapsible="icon"]
+ > .sidebar-slab
+ > [data-slot="sidebar-inner"] {
+ --ear-w: 29.94px;
+ --ear-h: 11.6px;
+ --ear-tl: var(--ear-sharp-tl);
+ --ear-bl: var(--ear-sharp-bl);
+ --ear-tr: var(--ear-sharp-tr);
+ --ear-br: var(--ear-sharp-br);
+ }
+ /*
+ * Folded down to the strip, the slab is the strip's width and the page meets it, as it does the
+ * open sidebar: the primitive leaves room for a margin on both sides of an inset strip.
+ */
+ .window-pattern
+ > .peer[data-collapsible="icon"]:has(> .sidebar-slab)
+ > [data-slot="sidebar-gap"],
+ .window-pattern > .peer[data-collapsible="icon"] > .sidebar-slab {
+ width: calc(var(--sidebar-width-icon) + 8px);
+ }
+ .window-pattern
+ > .peer[data-collapsible="icon"]:has(> .sidebar-slab)
+ ~ [data-slot="sidebar-inset"] {
+ margin-left: 0;
+ }
+ .window-pattern
+ > .peer[data-state="expanded"]:has(> .sidebar-slab)
+ ~ [data-slot="sidebar-inset"],
+ .window-pattern
+ > .peer[data-collapsible="icon"]:has(> .sidebar-slab)
+ ~ [data-slot="sidebar-inset"] {
+ border-left-width: 1px;
+ mask-image:
+ var(--ear-tl), var(--ear-bl), linear-gradient(#000 0 0),
+ linear-gradient(#000 0 0);
+ mask-position:
+ 0 0,
+ 0 100%,
+ 100% 0,
+ 0 var(--ear-h);
+ mask-size:
+ var(--ear-w) var(--ear-h),
+ var(--ear-w) var(--ear-h),
+ calc(100% - var(--ear-w)) 100%,
+ var(--ear-w) calc(100% - 2 * var(--ear-h));
+ mask-repeat: no-repeat;
+ }
+ .window-pattern
+ > .peer[data-state="expanded"]
+ > .sidebar-slab
+ > [data-slot="sidebar-inner"],
+ .window-pattern
+ > .peer[data-collapsible="icon"]
+ > .sidebar-slab
+ > [data-slot="sidebar-inner"] {
+ mask-image:
+ var(--ear-tr), var(--ear-br), linear-gradient(#000 0 0),
+ linear-gradient(#000 0 0);
+ mask-position:
+ 100% 0,
+ 100% 100%,
+ 0 0,
+ 100% var(--ear-h);
+ mask-size:
+ var(--ear-w) var(--ear-h),
+ var(--ear-w) var(--ear-h),
+ calc(100% - var(--ear-w)) 100%,
+ var(--ear-w) calc(100% - 2 * var(--ear-h));
+ mask-repeat: no-repeat;
+ }
+}
+
/*
* A Bot's orb (`BotOrb` in components/agents/bot-orb.tsx), drawn in SVG from its seed. It stands
* still at rest and while it waits on someone. While its Bot works it is live: it breathes, a slow,
diff --git a/app/src/theme.css b/app/src/theme.css
index 6bc3c73c7a..526a0fc370 100644
--- a/app/src/theme.css
+++ b/app/src/theme.css
@@ -40,6 +40,8 @@
--chart-4: oklch(0.5 0.2 18);
--chart-5: oklch(0.6 0.2 286);
--empty-pattern-color: oklch(0.746 0.117 279.9);
+ --window: oklch(0.179 0.02 252.2);
+ --window-foreground: oklch(1 0 0);
--sidebar: oklch(0.948 0.01 251.8);
--sidebar-foreground: oklch(0.108 0.042 264.7);
--sidebar-primary: oklch(0.108 0.042 264.7);
@@ -62,6 +64,14 @@
*/
--empty-pattern: url("./assets/patterns/dot-matrix.svg");
--empty-pattern-opacity: 0.25;
+ /*
+ * The dots on the window the sidebar and the page lie on, in two parts as the empty-state pattern
+ * is: the tile (an SVG used as a mask, so only its squares' opacity matters), drawn in
+ * `--window-foreground` (in the scheme), and how strongly it shows. Turn it off with
+ * `--window-pattern-opacity: 0`.
+ */
+ --window-pattern: url("./assets/patterns/window-matrix.svg");
+ --window-pattern-opacity: 0.11;
}
.dark {
@@ -93,6 +103,8 @@
--chart-4: oklch(0.6 0.2 18);
--chart-5: oklch(0.76 0.128 286);
--empty-pattern-color: oklch(0.832 0.085 281.4);
+ --window: oklch(0.43 0.04 277.2);
+ --window-foreground: oklch(0.956 0.004 252);
--sidebar: oklch(0.156 0.017 252);
--sidebar-foreground: oklch(0.956 0.004 252);
--sidebar-primary: oklch(0.956 0.004 252);
@@ -103,6 +115,7 @@
--sidebar-ring: oklch(0.713 0.151 277.7);
/* end of tokens/src/scheme.ts */
--empty-pattern-opacity: 0.15;
+ --window-pattern-opacity: 0.1;
}
* {
@@ -165,6 +178,8 @@ body {
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar: var(--sidebar);
+ --color-window-foreground: var(--window-foreground);
+ --color-window: var(--window);
--color-chart-5: var(--chart-5);
--color-chart-4: var(--chart-4);
--color-chart-3: var(--chart-3);
diff --git a/app/tests/app-navigation.test.tsx b/app/tests/app-navigation.test.tsx
index a9f1e05648..cf452a62ac 100644
--- a/app/tests/app-navigation.test.tsx
+++ b/app/tests/app-navigation.test.tsx
@@ -209,9 +209,9 @@ test.each(["user", "admin"] as const)(
].map(
(item) => item.querySelector('[data-slot="strip-label"]')?.textContent,
);
- // The strip's one short name, Chats for Conversations; the rest as listed, Apps included.
+ // Conversations, then the rest as listed, Apps included.
expect(names).toEqual([
- "Chats",
+ "Conversations",
...expected(role, "primary").map((item) => item.label),
]);
expect(names).toContain("Apps");
diff --git a/app/tests/bots-panel.test.tsx b/app/tests/bots-panel.test.tsx
index 01a58c9dbf..35b0d4cb54 100644
--- a/app/tests/bots-panel.test.tsx
+++ b/app/tests/bots-panel.test.tsx
@@ -572,7 +572,7 @@ test("after switching to Conversations, a conversation opened there keeps Conver
await waitFor(() =>
expect(router.state.location.pathname).toBe("/channel/i1"),
);
- await user.click(view.getByRole("button", { name: "Chats" }));
+ await user.click(view.getByRole("button", { name: "Conversations" }));
await view.findByRole("heading", { level: 2, name: "Conversations" });
await router.navigate({
to: "/channel/$channelId",
diff --git a/app/tests/browser-nav-item.test.tsx b/app/tests/browser-nav-item.test.tsx
index 7631b5f010..7411084a64 100644
--- a/app/tests/browser-nav-item.test.tsx
+++ b/app/tests/browser-nav-item.test.tsx
@@ -207,7 +207,8 @@ test("a recording puts a red dot named for it on Skills, ticking while it record
expect(skills.contains(dot)).toBe(true);
expect(dots(footer)).toHaveLength(1);
- // Hovered, the tooltip says what the dot's name says, even with the sidebar open.
+ // Hovered, the tooltip names the section and, under it, says what the dot's name says, even with
+ // the sidebar open.
const user = userEvent.setup({ document });
await user.hover(skills);
await waitFor(() =>
@@ -216,7 +217,7 @@ test("a recording puts a red dot named for it on Skills, ticking while it record
(tooltip) => tooltip.textContent,
),
).toEqual([
- expect.stringMatching(/^Recording: Submit the receipt, 1:2\d$/),
+ expect.stringMatching(/^SkillsRecording: Submit the receipt, 1:2\d$/),
]),
);
await user.unhover(skills);
diff --git a/app/tests/channel-item-working.test.tsx b/app/tests/channel-item-working.test.tsx
index 0aef28835e..bd3d1af2d3 100644
--- a/app/tests/channel-item-working.test.tsx
+++ b/app/tests/channel-item-working.test.tsx
@@ -76,12 +76,9 @@ test("once the Bot is done, the age comes back and the status goes", () => {
expect(view.getByText("2m")).toBeTruthy();
});
-test("the age shows on hover or focus with a mouse, and at rest on touch and in the narrow sheet", () => {
+test("the age is always shown, at rest as on hover", () => {
const view = row(false);
const names = view.getByText("2m").className.split(" ");
- expect(names).toContain("sr-only");
- expect(names).toContain("group-hover/row:not-sr-only");
- expect(names).toContain("group-focus-visible/row:not-sr-only");
- expect(names).toContain("pointer-coarse:not-sr-only");
- expect(names).toContain("max-md:not-sr-only");
+ expect(names).not.toContain("sr-only");
+ expect(names).toContain("text-muted-foreground");
});
diff --git a/app/tests/design-tokens.test.ts b/app/tests/design-tokens.test.ts
index 92188c903a..89cf91d085 100644
--- a/app/tests/design-tokens.test.ts
+++ b/app/tests/design-tokens.test.ts
@@ -50,8 +50,8 @@ describe("default look tokens", () => {
});
/*
- * Three surfaces, darkest to lightest: the frame the sidebar shares with the window's edge, the
- * panel the page sits in, and the cards on it. Equal neighbors would merge into one.
+ * Three surfaces, darkest to lightest: the frame (the sidebar's slab), the panel the page sits in,
+ * and the cards on it. Equal neighbors would merge into one.
*/
test.each(THEMES)(
"%s: the frame is darker than the panel, the panel darker than cards",
@@ -64,6 +64,20 @@ describe("default look tokens", () => {
},
);
+ /*
+ * The window the slabs lie on never matches one of them: the darkest surface in light, and in
+ * dark lifted above them all, as the design draws it, so the dark slabs stand out on it.
+ */
+ test("the window is below every slab in light and above every slab in dark", () => {
+ const [[, light], [, dark]] = THEMES;
+ const level = (tokens: Map, name: string) =>
+ lightness(tokens.get(name));
+ for (const slab of ["--sidebar", "--background", "--card"]) {
+ expect(level(light, "--window")).toBeLessThan(level(light, slab));
+ expect(level(dark, "--window")).toBeGreaterThan(level(dark, slab));
+ }
+ });
+
/*
* Menus, pickers and comboboxes mark the highlighted row with `--accent` on `--popover`, and some
* rows sit straight on `--background`. When the accent equals either surface the highlight
@@ -79,15 +93,16 @@ describe("default look tokens", () => {
},
);
- // A stock shadcn theme drops in: no token beyond shadcn's own, the success and warning colors and the
- // empty-state pattern's.
+ // A stock shadcn theme drops in: no token beyond shadcn's own, the success and warning colors, the
+ // empty-state pattern's and the window's.
test.each(THEMES)("%s: declares only shadcn's tokens", (_, tokens) => {
const extra = [...tokens.keys()].filter(
(token) =>
!SHADCN_TOKEN.test(token) &&
token !== "--success" &&
token !== "--warning" &&
- !token.startsWith("--empty-pattern"),
+ !token.startsWith("--empty-pattern") &&
+ !token.startsWith("--window"),
);
expect(extra).toEqual([]);
});
diff --git a/app/tests/icon-set.test.ts b/app/tests/icon-set.test.ts
index cfb21e0693..7ff4376d58 100644
--- a/app/tests/icon-set.test.ts
+++ b/app/tests/icon-set.test.ts
@@ -91,6 +91,30 @@ describe("one icon set", () => {
}
});
+ /*
+ * The one exception (docs/design-system.md): the sidebar strip's five section icons are the
+ * design's own drawings, an outline and a filled face each. They live in one file beside the
+ * set's module, and nothing joins them there unagreed.
+ */
+ test("the strip's five drawings are the only glyphs drawn beside the set", () => {
+ const dir = join(ROOT, "app/src/components/icons");
+ expect(readdirSync(dir).sort()).toEqual([
+ "index.tsx",
+ "strip.tsx",
+ "waveform.tsx",
+ ]);
+ const exported = [
+ ...readFileSync(join(dir, "strip.tsx"), "utf8").matchAll(
+ /export const (\w+)/g,
+ ),
+ ].map((match) => match[1]);
+ expect(exported.sort()).toEqual(
+ ["Apps", "Bots", "Conversations", "Routines", "Skills"]
+ .flatMap((name) => [`IconStrip${name}`, `IconStrip${name}Open`])
+ .sort(),
+ );
+ });
+
/*
* Desktop can't import the web app's module, so it keeps its own. An icon both draw is the same
* glyph in both, so a Bot or a cloud looks the same in the Mac app's setup window and in the app.
diff --git a/app/tests/section-strip-routines.test.tsx b/app/tests/section-strip-routines.test.tsx
index 1e421b8239..52cf81f7cb 100644
--- a/app/tests/section-strip-routines.test.tsx
+++ b/app/tests/section-strip-routines.test.tsx
@@ -246,7 +246,7 @@ function strip(page: Page) {
}
/** Click a section's icon on the strip, then move the pointer off it so no tooltip stays. */
-async function choose(page: Page, name: "Chats" | "Bots" | "Routines") {
+async function choose(page: Page, name: "Conversations" | "Bots" | "Routines") {
const item =
name === "Routines"
? strip(page).getByRole("link", { name, exact: true })
@@ -391,7 +391,7 @@ describe.skipIf(!asked)("Routines on the strip", () => {
for (const [engine, browser] of engines) {
const page = await open(browser, "/routines");
try {
- await choose(page, "Chats");
+ await choose(page, "Conversations");
await choose(page, "Bots");
expect({
engine,
@@ -436,7 +436,7 @@ describe.skipIf(!asked)("Routines on the strip", () => {
for (const theme of ["light", "dark"] as const) {
const page = await open(browser, "/routines", theme);
try {
- await choose(page, "Chats");
+ await choose(page, "Conversations");
await choose(page, "Bots");
await choose(page, "Routines");
await still(page);
diff --git a/app/tests/section-strip.test.tsx b/app/tests/section-strip.test.tsx
index a451aec3dc..dbdc28f5a2 100644
--- a/app/tests/section-strip.test.tsx
+++ b/app/tests/section-strip.test.tsx
@@ -184,11 +184,13 @@ test("on a page whose section has no panel, that section is current and the pane
test("Conversations brings its panel back without leaving the page", async () => {
const { view, router, user } = renderApp("/routines");
- await user.click(await view.findByRole("button", { name: "Chats" }));
+ await user.click(await view.findByRole("button", { name: "Conversations" }));
expect(sidebarState(view)).toBe("expanded");
expect(router.state.location.pathname).toBe("/routines");
expect(
- view.getByRole("button", { name: "Chats" }).getAttribute("aria-pressed"),
+ view
+ .getByRole("button", { name: "Conversations" })
+ .getAttribute("aria-pressed"),
).toBe("true");
});
@@ -198,7 +200,9 @@ test("⌘B on a page with no panel opens Conversations' panel", async () => {
await user.keyboard("{Meta>}b{/Meta}");
expect(sidebarState(view)).toBe("expanded");
expect(
- view.getByRole("button", { name: "Chats" }).getAttribute("aria-pressed"),
+ view
+ .getByRole("button", { name: "Conversations" })
+ .getAttribute("aria-pressed"),
).toBe("true");
});
@@ -224,11 +228,13 @@ test("a page no section owns keeps the section that was open", async () => {
test("a page no section owns keeps a panel opened from the strip", async () => {
const { view, router, user } = renderApp("/bots");
await view.findByRole("heading", { level: 2, name: "Bots" });
- await user.click(view.getByRole("button", { name: "Chats" }));
+ await user.click(view.getByRole("button", { name: "Conversations" }));
await view.findByRole("heading", { level: 2, name: "Conversations" });
await act(() => router.navigate({ to: "/teams" }));
expect(
- view.getByRole("button", { name: "Chats" }).getAttribute("aria-pressed"),
+ view
+ .getByRole("button", { name: "Conversations" })
+ .getAttribute("aria-pressed"),
).toBe("true");
expect(
view.getByRole("heading", { level: 2, name: "Conversations" }),
@@ -252,7 +258,7 @@ test("going to the Bots panel and back finds the Conversations panel as it was l
expect(
view.queryByRole("heading", { level: 2, name: "Conversations" }),
).toBeNull();
- await user.click(view.getByRole("button", { name: "Chats" }));
+ await user.click(view.getByRole("button", { name: "Conversations" }));
const back = await view.findByRole("heading", {
level: 2,
name: "Conversations",
@@ -265,7 +271,7 @@ test("going to the Bots panel and back finds the Conversations panel as it was l
test("a panel the person closed stays closed, in storage too, after a page with no panel", async () => {
window.localStorage.setItem(SIDEBAR_STORAGE_KEY, "collapsed");
const { view, router } = renderApp("/");
- await view.findByRole("button", { name: "Chats" });
+ await view.findByRole("button", { name: "Conversations" });
expect(sidebarState(view)).toBe("collapsed");
await act(() => router.navigate({ to: "/bots" }));
await act(() => router.navigate({ to: "/" }));
@@ -273,11 +279,11 @@ test("a panel the person closed stays closed, in storage too, after a page with
expect(window.localStorage.getItem(SIDEBAR_STORAGE_KEY)).toBe("collapsed");
});
-test("one open bar, beside the open section, and it goes with the section opened next", async () => {
+test("one open notch, beside the open section, and it goes with the section opened next", async () => {
const { view, user } = renderApp("/routines");
const routines = await view.findByRole("link", { name: "Routines" });
const bars = () => [
- ...view.container.querySelectorAll('[data-slot="strip-open-bar"]'),
+ ...view.container.querySelectorAll('[data-slot="strip-open-notch"]'),
];
expect(bars()).toHaveLength(1);
expect(routines.contains(bars()[0] ?? null)).toBe(true);
@@ -293,7 +299,9 @@ test("one open bar, beside the open section, and it goes with the section opened
test("clicking the open Conversations icon hides its panel, and clicking it again shows it", async () => {
const { view, user } = renderApp("/");
- const conversations = await view.findByRole("button", { name: "Chats" });
+ const conversations = await view.findByRole("button", {
+ name: "Conversations",
+ });
expect(sidebarState(view)).toBe("expanded");
await user.click(conversations);
expect(sidebarState(view)).toBe("collapsed");
@@ -334,7 +342,7 @@ test("on Routines, Bots and then Routines lights Routines and folds the panel aw
test("on Routines, with Bots opened by way of Conversations, Routines lights Routines again", async () => {
const { view, user } = renderApp("/routines");
- await user.click(await view.findByRole("button", { name: "Chats" }));
+ await user.click(await view.findByRole("button", { name: "Conversations" }));
await user.click(view.getByRole("button", { name: "Bots" }));
await view.findByRole("heading", { level: 2, name: "Bots" });
await user.click(view.getByRole("link", { name: "Routines" }));
@@ -379,7 +387,7 @@ test("on OpenBot Cloud the strip shows the release the server runs, with no menu
deployment: { hostedSignIn: true },
openbotVersion: "main-20261113-9",
});
- await view.findByRole("button", { name: "Chats" });
+ await view.findByRole("button", { name: "Conversations" });
await waitFor(() => expect(stripVersion(view)).toBe("main-20261113-9"));
expect(view.queryByRole("menu")).toBeNull();
// The account menu still says it too, under Help.
@@ -413,7 +421,7 @@ test("an OpenBot a company runs itself, and the personal edition, keep the versi
deployment,
openbotVersion: "1.2.0",
});
- await view.findByRole("button", { name: "Chats" });
+ await view.findByRole("button", { name: "Conversations" });
expect(stripVersion(view)).toBeNull();
cleanup();
}
@@ -421,6 +429,6 @@ test("an OpenBot a company runs itself, and the personal edition, keep the versi
test("on OpenBot Cloud, a server with no version to give shows none on the strip", async () => {
const { view } = renderApp("/", { deployment: { hostedSignIn: true } });
- await view.findByRole("button", { name: "Chats" });
+ await view.findByRole("button", { name: "Conversations" });
expect(stripVersion(view)).toBeNull();
});
diff --git a/app/tests/sidebar-preference.test.ts b/app/tests/sidebar-preference.test.ts
index bdfc5524ca..413be0f1fb 100644
--- a/app/tests/sidebar-preference.test.ts
+++ b/app/tests/sidebar-preference.test.ts
@@ -69,8 +69,8 @@ describe("sidebar width", () => {
entries[key] ?? null;
test("every shell starts at the app's width until somebody drags one", () => {
- expect(SIDEBAR_WIDTH).toBe("360px");
- expect(storedSidebarWidth(storage({}))).toBe("360px");
+ expect(SIDEBAR_WIDTH).toBe("308px");
+ expect(storedSidebarWidth(storage({}))).toBe("308px");
});
test("a dragged width is shared, ahead of the app's old one", () => {
@@ -95,13 +95,13 @@ describe("sidebar width", () => {
"openbot-sidebar-width:admin": "260",
}),
),
- ).toBe("360px");
+ ).toBe("308px");
});
test("a width out of bounds falls back to the default", () => {
expect(
storedSidebarWidth(storage({ [SIDEBAR_WIDTH_STORAGE_KEY]: "9000" })),
- ).toBe("360px");
+ ).toBe("308px");
});
});
diff --git a/app/tests/sidebar-window-buttons.test.tsx b/app/tests/sidebar-window-buttons.test.tsx
index f6ca1986ba..6dddd67390 100644
--- a/app/tests/sidebar-window-buttons.test.tsx
+++ b/app/tests/sidebar-window-buttons.test.tsx
@@ -986,12 +986,15 @@ describe.skipIf(!asked)("the sidebar and the window's buttons", () => {
// Measured on main without the mark, so a sidebar that moves outside the desktop fails. Measured
// again after the strip was redrawn wider (#2124), which moved its pieces on purpose, and again
// when this test first ran in CI: the strip's orb is an `AgentOrb` now, whose sphere sits a pixel
- // inside its box, and the panel's heading had come to sit a pixel higher on main by then.
+ // inside its box, and the panel's heading had come to sit a pixel higher on main by then. And
+ // again when the sidebar was redrawn to the design (icons alone in 40px circles, the panel laid
+ // into the sidebar's slab with no edge of its own, a 36px title row and a 12px gutter), which
+ // moved them on purpose.
const before: Record>> = {
"app-conversations": {
- orb: { x: 23, y: 23 },
- firstSection: { x: 8, y: 64 },
- heading: { x: 80, y: 20 },
+ orb: { x: 23, y: 21 },
+ firstSection: { x: 8, y: 66 },
+ heading: { x: 76, y: 20 },
back: null,
},
admin: {
diff --git a/app/tests/sidebar-zoom-drag.fixture.tsx b/app/tests/sidebar-zoom-drag.fixture.tsx
index 35e61dce40..da115edef2 100644
--- a/app/tests/sidebar-zoom-drag.fixture.tsx
+++ b/app/tests/sidebar-zoom-drag.fixture.tsx
@@ -12,7 +12,7 @@ import { AdminSidebar } from "@/components/admin/admin-sidebar";
import { BotsPanel } from "@/components/app-sidebar/bots-panel";
import { ConversationsPanel } from "@/components/app-sidebar/conversations-panel";
import { SectionPanel } from "@/components/layout/section-panel";
-import { SidebarShell } from "@/components/layout/sidebar-shell";
+import { SIDEBAR_SLAB, SidebarShell } from "@/components/layout/sidebar-shell";
import { Strip, StripItem } from "@/components/layout/strip";
import { SettingsSidebar } from "@/components/settings/settings-sidebar";
import {
@@ -26,6 +26,7 @@ import {
} from "@/components/ui/sidebar";
import { TooltipProvider } from "@/components/ui/tooltip";
import { setCurrentOrganization } from "@/lib/organizations/current";
+import { cn } from "@/lib/utils";
import { queryClient } from "@/query-client";
/**
@@ -73,7 +74,11 @@ function AppShaped({ panel }: { panel: ReactNode }) {
className="h-svh overflow-hidden"
panel={{ available: true, reveal: () => {} }}
>
-
+
@@ -94,7 +99,7 @@ function OnePanel({ sidebar }: { sidebar?: ReactNode }) {
return (
{sidebar ?? (
-
+
diff --git a/app/tests/sidebar-zoom-drag.test.tsx b/app/tests/sidebar-zoom-drag.test.tsx
index 4f84b9e62c..b815fec778 100644
--- a/app/tests/sidebar-zoom-drag.test.tsx
+++ b/app/tests/sidebar-zoom-drag.test.tsx
@@ -396,9 +396,10 @@ describe.skipIf(!asked)("the sidebar's edge at any zoom", () => {
for (const [engine, browser] of engines) {
const page = await open(browser, shape, ZOOMED);
try {
- // 360px by default, which is more than two-fifths of the zoomed window.
+ // 308px by default, which fits in two-fifths of the zoomed window (dragged out, below, it
+ // stops at two-fifths).
expect(await measured(page)).toMatchObject({
- width: ZOOMED_MOST,
+ width: Math.min(308, ZOOMED_MOST),
window: ZOOMED.width,
});
await shot(page, `${engine}-${shape.name}-zoomed`);
diff --git a/app/tests/skins-window-buttons.test.tsx b/app/tests/skins-window-buttons.test.tsx
index bf06391096..1e5865bd28 100644
--- a/app/tests/skins-window-buttons.test.tsx
+++ b/app/tests/skins-window-buttons.test.tsx
@@ -494,10 +494,11 @@ describe.skipIf(!asked)("the skins and the window's buttons", () => {
},
"openduet-pane": { 'button[aria-label="Menu"]': { x: 16, y: 20 } },
// The banner's line is text-sm, centred in its 28px row. On the whole-pixel type scale it
- // is 14px on a 20px line (was 13.125px on 18.75px), so its top is 1px higher. The row and
- // the banner have not moved.
+ // is 14px on a 20px line (was 13.125px on 18.75px), so its top was 1px higher. The banners
+ // are 48px tall since the sidebar's redraw (was 40), the row centred in them, so it is 4px
+ // lower.
"openduet-update": {
- '[aria-label="OpenBot update"] p': { x: 16, y: 10 },
+ '[aria-label="OpenBot update"] p': { x: 16, y: 14 },
},
opendots: {
'nav[aria-label="Workspace navigation"] a': { x: 6, y: 16 },
@@ -517,7 +518,7 @@ describe.skipIf(!asked)("the skins and the window's buttons", () => {
'button[aria-label="Open conversations and menu"]': { x: 20, y: 16 },
},
"openfuse-update": {
- '[aria-label="OpenBot update"] p': { x: 16, y: 10 },
+ '[aria-label="OpenBot update"] p': { x: 16, y: 14 },
},
};
const seen: Record>> = {};
diff --git a/app/tests/strip.test.tsx b/app/tests/strip.test.tsx
index cf04f5b1dc..9971a61f16 100644
--- a/app/tests/strip.test.tsx
+++ b/app/tests/strip.test.tsx
@@ -108,7 +108,7 @@ test("a section's panel has its title as a heading, with its actions beside it",
expect(view.getByText("rows")).toBeTruthy();
});
-test("each section's name is written under its icon, and read out once", () => {
+test("each section's name is read out once and shown in a tooltip, not under its icon", () => {
const view = inSidebar(
@@ -117,24 +117,25 @@ test("each section's name is written under its icon, and read out once", () => {
const button = view.getByRole("button", { name: "Conversations" });
const label = button.querySelector('[data-slot="strip-label"]');
expect(label?.textContent).toBe("Conversations");
- expect(label?.className).not.toContain("sr-only");
- expect(label?.className).toContain("text-xs");
- expect(button.querySelector(".sr-only")).toBeNull();
+ expect(label?.className).toContain("sr-only");
+ expect(button.querySelectorAll(".sr-only")).toHaveLength(1);
+ expect(button.hasAttribute("data-base-ui-tooltip-trigger")).toBe(true);
});
-test("each section's icon sits in a square, the account's size", () => {
+test("each section's icon sits in a circle, the account's size", () => {
const view = inSidebar(
,
);
const button = view.getByRole("button", { name: "Conversations" });
- const square = button.querySelector('[data-slot="strip-icon"]');
- expect(square?.className.split(" ")).toContain("size-9");
- expect(square?.className).not.toMatch(/\b[hw]-\d/);
+ const circle = button.querySelector('[data-slot="strip-icon"]');
+ expect(circle?.className.split(" ")).toContain("size-10");
+ expect(circle?.className.split(" ")).toContain("rounded-full");
+ expect(circle?.className).not.toMatch(/\b[hw]-\d/);
});
-test("an item with nothing more to say than its name has no tooltip", () => {
+test("every section has a tooltip with its name, and more under it when there is more to say", () => {
const view = inSidebar(
} />
@@ -148,6 +149,6 @@ test("an item with nothing more to say than its name has no tooltip", () => {
);
const bots = view.getByRole("link", { name: "Bots" });
const skills = view.getByRole("link", { name: "Skills" });
- expect(bots.hasAttribute("data-base-ui-tooltip-trigger")).toBe(false);
+ expect(bots.hasAttribute("data-base-ui-tooltip-trigger")).toBe(true);
expect(skills.hasAttribute("data-base-ui-tooltip-trigger")).toBe(true);
});
diff --git a/docs/app-guidelines.md b/docs/app-guidelines.md
index dc973e180f..8c61c7d1d5 100644
--- a/docs/app-guidelines.md
+++ b/docs/app-guidelines.md
@@ -18,12 +18,14 @@ one of the rules below is not merged.
The scheme is the set of tokens in [`tokens/src/scheme.ts`](../tokens/src/scheme.ts), each with a
light and a dark value and what it means: `background`, `foreground`, `card`, `popover`, `primary`,
`secondary`, `muted`, `accent`, `destructive`, `success`, `warning`, `border`, `input` and `ring`,
-and the chart and sidebar sets.
+the `window` the sidebar and the page lie on, and the chart and sidebar sets.
The grays are Tailwind's slate. In light each gray is slate at its own lightness; in dark, slate's
hue moves from 265 to 252 with 40% of its tint, since slate's own dark leans indigo and reads purple.
+The one exception is the dark window, the design's violet-gray, lifted above the slabs on it.
CopilotKit's lavender marks only what it means: the `ring`, the selected sidebar row
-(`sidebar-accent`) and the empty pattern. `tokens/tests/slate.test.ts` holds both.
+(`sidebar-accent`, and half of it on a row the pointer is on, on its way to being chosen) and the
+empty pattern. `tokens/tests/slate.test.ts` holds both.
- **Only the tokens.** No color value in a screen or a component: no hex, no `rgb()`, no `oklch()`.
No class from Tailwind's palette either (`bg-blue-500`, `text-amber-600`). Write `bg-background`,
@@ -365,8 +367,9 @@ changes, for every screen at once, in a change agreed first.
(8px), cards and the page's panel `rounded-lg` (10px), menus, dialogs and the message box
`rounded-xl` (14px), round things `rounded-full`. `rounded-none` squares a part off. No other
step and no corner of its own (`rounded-[20px]`).
-4. **Surfaces.** The frame (`sidebar`), the panel the page sits in (`background`), cards on it
- (`card`). A card has a hairline border in light and in dark. Every line (`border`, a field's
+4. **Surfaces.** The window the sidebar and the page lie on (`window`, with its dots: dark in light,
+ a violet-gray above the slabs in dark), the frame (`sidebar`), the panel the page sits in
+ (`background`), cards on it (`card`). A card has a hairline border in light and in dark. Every line (`border`, a field's
`input`, the sidebar's `sidebar-border`) is the text color at 10% in light and 12% in dark,
about 1.25:1 against a card in light and 1.38:1 in dark, so no line in the app is fainter than
another. A line is never the only cue of a control: a checkbox's edge is `muted-foreground`.
@@ -394,7 +397,9 @@ changes, for every screen at once, in a change agreed first.
is the only control that glows.
9. **Icons.** Hugeicons' free set, at their usual sizes, imported from `components/icons` and never
from the set itself. The line is the set's own 1.5, which every glyph carries. An icon that
- needs another line says why in a comment.
+ needs another line says why in a comment. The sidebar strip's five section icons are the one
+ exception: the design's own drawings (`components/icons/strip.tsx`), in the text's color, filled
+ for the open section.
10. **Widths** come from `PageShell`. A screen sets no `max-w-*` of its own without a comment.
11. **Cards.** A card is `PageCard`, for a form, or `Card` (`components/ui/card.tsx`), for one
thing such as a Bot's tile. A list of rows is not a card: it is `PageRows`. No screen draws a
diff --git a/docs/design-system.md b/docs/design-system.md
index 08ae60b509..7eff42c15f 100644
--- a/docs/design-system.md
+++ b/docs/design-system.md
@@ -45,7 +45,8 @@ A screen is a few surfaces, one on another. Each level has its token, and the to
| Level | Token | What it is | Edge and shadow |
| --- | --- | --- | --- |
-| Frame | `sidebar` | The sidebar and the window's edge. The darkest. | None |
+| Window | `window` | What the sidebar and the page lie on, with its dots: the window's edges, and the dip between their corners where the two meet. The darkest in light; in dark lifted above the slabs, as the design draws it. | None |
+| Frame | `sidebar` | The sidebar's slab: the strip, and the row of the window's buttons. | None |
| Panel | `background` | What the page sits in. | None |
| Card | `card` | A group on the panel: a form, a table, one thing such as a Bot's tile. The lightest. | A hairline border, no shadow |
| Beside | `popover` | What opens beside what opened it: menus, selects, popovers. | A border and `shadow-lg` |
@@ -62,7 +63,7 @@ line is fainter than another.
- **In the page, the level is the color. Above it, the level is the shadow.** Nothing in the page
has a shadow, and a shadow never decorates: it says how far something floats.
- **Neighbors never match.** The frame is darker than the panel and the panel darker than a card,
- in light and in dark. In dark, a fill on a card is lighter than the card, so a button never reads
+ in light and in dark. The window is below all three in light and above them in dark. In dark, a fill on a card is lighter than the card, so a button never reads
as a hole. A menu's highlight differs from the menu and from the panel.
- **No level in between.** A surface that needs a shade or a shadow the levels don't have is a
change to the system (below), not a `bg-card/80`, a `color-mix()` or a `shadow-md` in a screen.
@@ -122,7 +123,8 @@ changed in `tokens/src/scheme.ts` and written out with `bun run tokens:generate`
and as a shadcn user expects. Moving `sm` by 4px, or making every button a pill, redraws every
screen at once. A new look is a new variant, agreed first. A size of our own goes beside
shadcn's, never in place of one: `SidebarMenuButton`'s `page` (36px) is for a page's own menu,
- Settings and Admin, and the app's main sidebar keeps `default` (32px).
+ Settings and Admin, and the rows of the app's sidebar panels are as tall, while `default` keeps
+ shadcn's 32px.
- **One system.** No second kit beside the first, no "legacy" mode, no variant that switches
between two looks. A skin keeps its own layout and wears the scheme's colors: it sets none of
them under `:root[data-skin]`, and each color role of its own reads the scheme's token that means
@@ -144,7 +146,10 @@ icons a screen draws with. What it leaves to this page:
- **One typeface and one icon set, in every app.** Figtree and Hugeicons' free set today, in the
web app, OpenBot Desktop and the extension. Changing either is a change for all three at once,
agreed first. It never lands in one app. Figtree covers Latin only: Cyrillic, Greek and other
- scripts are drawn in the system's face, and nothing loads a second face for them.
+ scripts are drawn in the system's face, and nothing loads a second face for them. The one
+ exception is the sidebar strip's five section icons (Conversations, Bots, Routines, Skills and
+ Apps): the design's own drawings, an outline and a filled face for the open section, in
+ `components/icons/strip.tsx`. No other icon joins them.
- **Draw with tokens, not with pictures.** A picture has one set of colors: it can't follow dark
mode, a skin or a customer's theme. Draw interface parts in CSS or as an SVG that takes
`currentColor`. A picture that is content, such as a screenshot or a photo, is a dependency like
@@ -205,7 +210,7 @@ A change to a token or a primitive changes every screen, so it lands differently
| [`app/tests/ui-look-guard.test.ts`](../app/tests/ui-look-guard.test.ts) | No corner, shadow, text size, `dark:` color or hand-drawn card of a screen's own. |
| [`app/tests/ui-primitives-look.test.ts`](../app/tests/ui-primitives-look.test.ts) | Every primitive keeps the look's corner and shadow steps, a copied shadcn one included. |
| [`app/tests/ui-look-theme.test.ts`](../app/tests/ui-look-theme.test.ts) | The one radius, the icons' line, and every line at one strength. |
-| [`app/tests/icon-set.test.ts`](../app/tests/icon-set.test.ts) | One icon set in the web app, the extension and OpenBot Desktop, taken from its module. |
+| [`app/tests/icon-set.test.ts`](../app/tests/icon-set.test.ts) | One icon set in the web app, the extension and OpenBot Desktop, taken from its module, and the strip's five drawings the only glyphs beside it. |
| [`tokens/tests/slate.test.ts`](../tokens/tests/slate.test.ts) | The grays are one family, in light and in dark. |
| [`tokens/tests/contrast.test.ts`](../tokens/tests/contrast.test.ts) | Text reads on the surfaces it is set on (4.5:1) and the focus ring shows (3:1), in light and in dark. |
| [`app/tests/skins.test.ts`](../app/tests/skins.test.ts) | A skin sets every light token for dark too, sets none of the scheme's colors and no radius of its own, and draws each state apart from, and stronger than, the one before. |
diff --git a/mobile/src/scheme.ts b/mobile/src/scheme.ts
index 69e1a20777..f3664ae0e2 100644
--- a/mobile/src/scheme.ts
+++ b/mobile/src/scheme.ts
@@ -29,6 +29,8 @@ export const scheme = {
"chart-4": "#ba0135",
"chart-5": "#7b65ef",
"empty-pattern-color": "#9ea4f5",
+ window: "#0b121a",
+ "window-foreground": "#ffffff",
sidebar: "#e9eef4",
"sidebar-foreground": "#010313",
"sidebar-primary": "#010313",
@@ -65,6 +67,8 @@ export const scheme = {
"chart-4": "#de3951",
"chart-5": "#aaa4ff",
"empty-pattern-color": "#bec2ff",
+ window: "#4a4e66",
+ "window-foreground": "#eef1f3",
sidebar: "#070d14",
"sidebar-foreground": "#eef1f3",
"sidebar-primary": "#eef1f3",
diff --git a/tokens/src/scheme.ts b/tokens/src/scheme.ts
index 53796c0e94..6052c5207a 100644
--- a/tokens/src/scheme.ts
+++ b/tokens/src/scheme.ts
@@ -6,8 +6,8 @@
* here, never in a copy. A new color is a change to the scheme: agree it first, then add it here
* with a light and a dark value (docs/app-guidelines.md).
*
- * The names are shadcn's, so a stock shadcn theme drops in, plus `success`, `warning` and the
- * empty-state pattern's color.
+ * The names are shadcn's, so a stock shadcn theme drops in, plus `success`, `warning`, the
+ * empty-state pattern's color and the window the sidebar and the page lie on.
*
* A color is never renamed or removed. A customer's theme (brand.yaml's `skin.stylesheet`) sets
* these names, and a theme that sets one the scheme no longer has would quietly stop working. Change
@@ -43,7 +43,11 @@ export const MEANING = {
"chart-4": "A chart's fourth series.",
"chart-5": "A chart's fifth series.",
"empty-pattern-color": "The pattern behind an empty state.",
- sidebar: "The frame: the sidebar, and the window edge it shares a tint with.",
+ window:
+ "The window the sidebar and the page lie on: its edges, and the dip between their corners.",
+ "window-foreground": "What is drawn on the window: its dots.",
+ sidebar:
+ "The frame: the sidebar, the strip and the row of the window's buttons.",
"sidebar-foreground": "Text in the sidebar.",
"sidebar-primary": "The main action in the sidebar.",
"sidebar-primary-foreground": "Text on the sidebar's main action.",
@@ -58,10 +62,11 @@ export type Token = keyof typeof MEANING;
export type Palette = Record;
/*
- * Three surfaces, darkest to lightest, the way Linear draws them: the frame (the sidebar's tint,
- * which the window edge shares), the panel the page sits in, and the white cards on it. Every gray
- * is Tailwind's slate at the gray's own lightness. CopilotKit's lavender is kept for what it marks:
- * the ring is its periwinkle, and the selected sidebar row is a lilac tint.
+ * Four surfaces, darkest to lightest: the window, dark in light too, which the sidebar and the page
+ * lie on; the frame (the sidebar's tint); the panel the page sits in; and the white cards on it,
+ * the way Linear draws the last three. Every gray is Tailwind's slate at the gray's own lightness.
+ * CopilotKit's lavender is kept for what it marks: the ring is its periwinkle, and the selected
+ * sidebar row is a lilac tint.
*/
const light: Palette = {
background: "oklch(0.983 0.003 247.9)",
@@ -102,6 +107,9 @@ const light: Palette = {
"chart-4": "oklch(0.5 0.2 18)",
"chart-5": "oklch(0.6 0.2 286)",
"empty-pattern-color": "oklch(0.746 0.117 279.9)",
+ // The design's window, #0B121A, with its dots in white.
+ window: "oklch(0.179 0.02 252.2)",
+ "window-foreground": "oklch(1 0 0)",
sidebar: "oklch(0.948 0.01 251.8)",
"sidebar-foreground": "oklch(0.108 0.042 264.7)",
"sidebar-primary": "oklch(0.108 0.042 264.7)",
@@ -113,7 +121,9 @@ const light: Palette = {
};
/*
- * The same three surfaces on a near-black blue-gray ground: the frame darkest, the cards lightest.
+ * The same surfaces on a near-black blue-gray ground: the frame darkest, the cards lightest. The
+ * window is the one out of that order: the design lifts it above the slabs here, a violet-gray
+ * (#4A4E66, the one gray with a tint of its own in dark), so the dark slabs stand out on it.
* The grays are slate with its hue moved from 265 to 252 and 40% of its tint: slate's own dark
* leans indigo, which reads as purple.
* Secondary and muted fills are lighter than the cards, as shadcn's dark fills are, so a button or
@@ -146,6 +156,9 @@ const dark: Palette = {
"chart-4": "oklch(0.6 0.2 18)",
"chart-5": "oklch(0.76 0.128 286)",
"empty-pattern-color": "oklch(0.832 0.085 281.4)",
+ // The design's window, #4A4E66, with its dots in the text's color.
+ window: "oklch(0.43 0.04 277.2)",
+ "window-foreground": "oklch(0.956 0.004 252)",
sidebar: "oklch(0.156 0.017 252)",
"sidebar-foreground": "oklch(0.956 0.004 252)",
"sidebar-primary": "oklch(0.956 0.004 252)",
diff --git a/tokens/tests/contrast.test.ts b/tokens/tests/contrast.test.ts
index 6257a273fe..c441a9c146 100644
--- a/tokens/tests/contrast.test.ts
+++ b/tokens/tests/contrast.test.ts
@@ -39,6 +39,8 @@ const PAIRS: [Token, Token[], number][] = [
["ring", ["background"], NON_TEXT],
["ring", ["card"], NON_TEXT],
["sidebar-ring", ["sidebar"], NON_TEXT],
+ // The bar in the notch that marks what is open, and the dots, on the window.
+ ["window-foreground", ["window"], TEXT],
];
function surface(mode: Mode, layers: Token[]): Rgb {
diff --git a/tokens/tests/slate.test.ts b/tokens/tests/slate.test.ts
index 8096894f56..19ea2a08b5 100644
--- a/tokens/tests/slate.test.ts
+++ b/tokens/tests/slate.test.ts
@@ -11,10 +11,12 @@ function lch(value: string): [number, number, number] {
/**
* The grays: every color with a faint tint. White has none, and the accents (the ring, the
* selected sidebar row, the empty pattern) and the status colors are far more saturated. The chart
- * colors are not grays at all; chart.test.ts holds them.
+ * colors are not grays at all; chart.test.ts holds them. Dark's window is the design's violet-gray
+ * (#4A4E66), lifted above the slabs, and held on its own below.
*/
function grays(mode: "light" | "dark") {
return TOKENS.filter((token) => !token.startsWith("chart-"))
+ .filter((token) => !(mode === "dark" && token === "window"))
.map((token) => [token, lch(scheme[mode][token])] as const)
.filter(([, [, c]]) => c > 0 && c < 0.05);
}
@@ -32,6 +34,12 @@ describe("the grays are slate", () => {
expect(off).toEqual([]);
});
+ test("in dark, the window is the design's violet-gray, a quiet tint and no accent", () => {
+ const [, c, h] = lch(scheme.dark.window);
+ expect(c).toBeLessThan(0.05);
+ expect(h).toBeGreaterThan(270);
+ });
+
test("the lavender accents stay", () => {
for (const mode of ["light", "dark"] as const) {
for (const token of [