Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Window frame: round card corners, and the frame in the sidebar's colour in every skin (#4641)

Omkar Satpute2d74ba961627
diff --git a/scripts/check-skin-contrast.mjs b/scripts/check-skin-contrast.mjs
index 62c205f52b..42a22fa176 100644
--- a/scripts/check-skin-contrast.mjs
+++ b/scripts/check-skin-contrast.mjs
@@ -60,7 +60,8 @@ function splitPhone(source) {
}
}
const phone = source.slice(start, end);
- if (phone.includes("[data-skin=")) return { desktop: source.slice(0, start) + source.slice(end), phone };
+ // A skin's own token block (`:is([data-skin="x"]) {`), not a rule that only scopes by skin, like the settings sheet's.
+ if (/\[data-skin="[a-z-]+"\]\)?\s*\{/.test(phone)) return { desktop: source.slice(0, start) + source.slice(end), phone };
}
return { desktop: source, phone: "" };
}
@@ -190,8 +191,6 @@ const PAIRS = [
["--color-inset", "--color-card", 1.04],
["--color-card", "--color-app", 1.04],
["--color-panel", "--color-app", 1.03],
- // The app's card is told from the frame round it.
- ["--color-frame", "--color-app", 1.05],
];
const skins = parseSkins(css);
@@ -248,6 +247,17 @@ for (const [id, tokens] of skins) {
if (skinFailed) failed = true;
}
+// The window's frame is the sidebar's colour in every skin, so the top bar, the rail and the sidebar read as one field;
+// the chat in the app's card is told from it by --color-panel on --color-app above. The rail of places is a page 36px
+// wide, so it renders the phone tokens beside a full-width page: there too its frame must be the desktop sidebar's.
+const tokenHex = (id, token) => resolve(skins.get(id)?.[token] ?? "", skins.get(id) ?? {}).toLowerCase();
+const frameMisses = [...skins.keys()].filter((id) => tokenHex(id, "--color-frame") !== tokenHex(id.replace(/ \(phone\)$/, ""), "--color-panel"));
+for (const id of frameMisses) {
+ console.log(`✗ ${id} frame — ${tokenHex(id, "--color-frame") || "undefined"}, not the sidebar's ${tokenHex(id.replace(/ \(phone\)$/, ""), "--color-panel")}`);
+}
+if (frameMisses.length) failed = true;
+else console.log(`✓ frame — the sidebar's colour in all ${skins.size} skins, phone widths included`);
+
// The inverted bubbles (Daylight's ink-black, Pop's ink) have
// their own inherited context: the editor, labels, quotes and file chips
// explicitly use these tokens, not parent color.
diff --git a/scripts/verify-window-frame.ts b/scripts/verify-window-frame.ts
index 670fed7b83..fe0f12b5d2 100644
--- a/scripts/verify-window-frame.ts
+++ b/scripts/verify-window-frame.ts
@@ -7,7 +7,7 @@
// Each view is photographed in Daylight and Midnight (every skin with --skins all) at 1280x800, at twice that size,
// and the views of the bar also as a strip of the bar alone. `tiles` draws each state of a rail tile with every pixel
// as a square, at 1x and 2x; `colours` puts the frame's colour today, the colour derived from the app's and the app's
-// own side by side; `skins` shows the window's corner in every skin, and `corners` the card's three corners in
+// own side by side; `skins` shows the window's corner in every skin, and `corners` the card's three round corners in
// every skin, three times their size.
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
@@ -141,7 +141,7 @@ async function tiles(page: HeadlessPage, base: string, skin: string, file: strin
const CORNER = { x: 0, y: 0, width: 560, height: 300 };
type Box = { x: number; y: number; width: number; height: number };
-/** The card's corners, each with the frame round it. */
+/** The card's round corners, each with the frame round it. */
const cardCorners = (card: Box): Array<[string, Box]> => [
["top left", { x: card.x - 24, y: card.y - 16, width: 96, height: 64 }],
["top right", { x: card.x + card.width - 72, y: card.y - 16, width: 72, height: 64 }],
@@ -214,7 +214,7 @@ try {
rows.push({ label: "", pictures });
}
const file = join(shots, "corners.png");
- await sheet(page, "The card's corners in every skin, three times their size", rows, file);
+ await sheet(page, "The card's round corners in every skin, three times their size", rows, file);
console.log(file);
}
} finally {
diff --git a/src/App.tsx b/src/App.tsx
index 64fd708794..d97b1604c4 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -355,10 +355,11 @@ function Shell({ viewer }: { viewer: WelcomeViewer | null }) {
)}
{!calendarFocus && <PlacesRail />}
<NewLocalFromMenu />
- {/* A framed window shows the app, its sidebar and the chat or page, as one square pane under the top bar and beside
- the window's rail, running to the window's right and bottom edges. */}
+ {/* A framed window shows the app, its sidebar and the chat or page, in a rounded card under the top bar and beside
+ the window's rail: its top corners and its bottom-left corner are round, and it runs to the window's right and
+ bottom edges. */}
<div data-window-card={framed ? "" : undefined}
- className={framed ? "relative flex min-w-0 flex-1 flex-col overflow-hidden bg-app" : "contents"}>
+ className={framed ? "relative flex min-w-0 flex-1 flex-col overflow-hidden rounded-t-[12px] rounded-bl-[12px] bg-app" : "contents"}>
{framed && strips}
<div className={framed ? "relative flex min-h-0 flex-1" : "contents"}>
{!calendarFocus && <Sidebar
diff --git a/src/styles.css b/src/styles.css
index 1391d08f9a..152e47d287 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -164,9 +164,9 @@
/* the 0.5px line where two panes meet: the sidebar and the chat */
--color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
/* the window's frame: its top bar and the rail of places, around the
- app's pane (the sidebar and the chat). The app's own colour a step darker, so it
- stays in the skin's family: --frame-shade of black. */
- --color-frame: color-mix(in oklab, var(--color-app), black var(--frame-shade));
+ app's card (the sidebar and the chat). The sidebar's colour in every skin,
+ so the bar, the rail and the sidebar read as one field. */
+ --color-frame: var(--color-panel);
--color-ink: #f5f5f5;
--color-ink-secondary: #f5f5f5a8;
/* quiet text: timestamps, hints, placeholders, calendar hours. It used to
@@ -232,10 +232,6 @@
:root {
--code-color-scheme: dark;
- /* how far the frame steps from the app's colour toward black: further on
- the dark skins, whose colours sit close to black, and a small step on the
- light ones (2.5%), where the quiet ink must still clear 4.5:1 on it */
- --frame-shade: 30%;
/* ink carried by a filled accent / danger surface (see the rule at the
bottom of this file, which is what makes them take effect) */
--color-accent-ink: #ffffff;
@@ -333,7 +329,6 @@
───────────────────────────────────────────────────────────────────────── */
[data-skin="atelier"] {
--code-color-scheme: light;
- --frame-shade: 3%;
--color-app: #f5f1eb; /* outermost ground */
--color-panel: #fbf8f2; /* sidebar */
--color-raised: #ffffff; /* content — raised means lighter here */
@@ -484,7 +479,6 @@
───────────────────────────────────────────────────────────────────────── */
[data-skin="lagoon"] {
--code-color-scheme: light;
- --frame-shade: 4%;
/* The tint is the point, so it is carried by the surfaces, not by a button:
the ground sits 13 points of green-blue above its red channel, roughly
three times Atelier's cream cast, which is what makes the skin read as
@@ -620,7 +614,6 @@
───────────────────────────────────────────────────────────────────────── */
[data-skin="linen"] {
--code-color-scheme: light;
- --frame-shade: 3.5%;
--color-app: #eceff3;
--color-panel: #f5f6f8;
--color-raised: #ffffff;
@@ -756,10 +749,8 @@
───────────────────────────────────────────────────────────────────────── */
[data-skin="daylight"] {
--code-color-scheme: light;
- --frame-shade: 6%;
--color-app: #fcfcfc; /* the thread */
--color-panel: #f5f5f5; /* sidebar */
- --color-frame: var(--color-panel);
--color-raised: #e4e4e4; /* the sidebar's selected row: 8% ink on the panel */
--color-raised-hover: #d8d8d8;
--color-card: #efefef; /* what a bot says: 6% ink on the page */
@@ -827,7 +818,6 @@
───────────────────────────────────────────────────────────────────────── */
[data-skin="meadow"] {
--code-color-scheme: light;
- --frame-shade: 6%;
--color-app: #ffffff; /* the thread */
--color-panel: #f6f8f6; /* sidebar */
--color-raised: #e9eeea;
@@ -892,7 +882,6 @@
───────────────────────────────────────────────────────────────────────── */
[data-skin="pop"] {
--code-color-scheme: light;
- --frame-shade: 6%;
--color-app: #fdf5ea; /* the page */
--color-panel: #f6ebdb; /* sidebar */
--color-raised: #efe3d1;
@@ -3460,10 +3449,10 @@ button:disabled.bg-danger {
scripts/check-skin-contrast.mjs measures these as "<skin> (phone)", so the
AA pairs hold here exactly as on desktop. */
@media (max-width: 767.98px) {
- /* The window's frame keeps the desktop ground at any width: the rail of places is a page 36px wide beside a full
- page, and both draw the frame's top bar or rail in one colour. */
+ /* The window's frame keeps the desktop sidebar's colour at any width: the rail of places is a page 36px wide beside
+ a full page, and both draw the frame's top bar or rail in one colour. */
:is([data-skin="midnight"]) {
- --color-frame: color-mix(in oklab, #121212, black var(--frame-shade));
+ --color-frame: #0e0e0e;
--color-app: #141414;
--color-panel: #1c1c1e;
--color-raised: #2c2c2e;
@@ -3482,7 +3471,7 @@ button:disabled.bg-danger {
--radius-menu: 22px;
}
:is([data-skin="meadow"]) {
- --color-frame: color-mix(in oklab, #ffffff, black var(--frame-shade));
+ --color-frame: #f6f8f6;
--color-app: #f6f8f6;
--color-panel: #fcfdfc;
--color-card: #ffffff;