Make menus opaque and redesign the core palettes
Phase 5a-3. The owner chose candidate B of each palette. - Menus are opaque (UI-043, replaces UI-013). With a background image, menus are at least 92% opaque and blur the image. Submenus show as manual popovers in the top layer, so the blur cannot clip them. - In a light palette, the page is the lightest surface, and the side panes have a slight tint (UI-044). - RuneStone uses neutral surfaces and the rune cyan of the app icon. Claude Dark uses the layout of the Claude app. Claude Light uses a white page with brand Light panes and a darker orange for text. Sakura uses Petal Veil for active rows. - All five core palettes pass every readability rule. A text role keeps the hue of its source and changes only its lightness. - The accent-text rule also checks accent-2, because inline code in Read uses it as text. - The root token defaults match RuneStone Dark. pnpm check passes. pnpm test: 447 pass, 5 todo, 0 fail. Full smoke suite: 92 passed, 2 known. editor/markdownPaste and tables/formulas failed one time and passed on retry. workspace/manageTemplates fails about half of its runs, also on the previous commit: the tree menu rebuilds when the template list reloads, and the open submenu closes.
This commit is contained in:
@@ -104,7 +104,7 @@ await runSmoke("appearance/palettes", async ({ browser }) => {
|
||||
const keyword = spans.find(span => !span.children.length && span.textContent.trim() === "def");
|
||||
return keyword ? getComputedStyle(keyword).color : null;
|
||||
});
|
||||
assert.equal(keywordColor, "rgb(152, 85, 108)", "Sakura keywords use Plum Wine");
|
||||
assert.equal(keywordColor, "rgb(160, 68, 107)", "Sakura keywords use the Rose Garden hue");
|
||||
}
|
||||
const typography = await settings.evaluate(() => ({
|
||||
body: getComputedStyle(document.body).fontFamily,
|
||||
@@ -115,7 +115,7 @@ await runSmoke("appearance/palettes", async ({ browser }) => {
|
||||
assert.match(typography.body, /Lora.*Georgia/);
|
||||
assert.match(typography.prose, /Lora.*Georgia/);
|
||||
assert.match(typography.heading, /Poppins.*Arial/);
|
||||
assert.equal(await settings.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--rs-accent").trim()), "#d97757");
|
||||
assert.equal(await settings.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue("--rs-accent").trim()), mode === "light" ? "#ab4e2f" : "#ed8968");
|
||||
} else assert.doesNotMatch(typography.body, /Lora|Georgia/);
|
||||
console.log(`PASS: ${theme} ${mode}, saved state, cross-window selection, existing and new source editors`);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ await runSmoke("appearance/palettes", async ({ browser }) => {
|
||||
return Object.fromEntries(["bg", "border", "selection", "bg-active", "syntax-keyword", "syntax-variable", "syntax-property", "syntax-constant", "syntax-punctuation"].map(key => [key, css.getPropertyValue(`--rs-${key}`).trim()]));
|
||||
});
|
||||
// The applied selection color caps its alpha at a6 so text backgrounds show through (appliedColors in src/lib/theme/contrast.ts).
|
||||
assert.deepEqual(sakura, { bg: "#fefcfc", border: "#f8dbe6", selection: "#ffc9dca6", "bg-active": "#dbeacb", "syntax-keyword": "#98556c", "syntax-variable": "#618c71", "syntax-property": "#607fa9", "syntax-constant": "#687788", "syntax-punctuation": "#687788" });
|
||||
assert.deepEqual(sakura, { bg: "#fefcfc", border: "#efd3dd", selection: "#ffc9dca6", "bg-active": "#f8dbe6", "syntax-keyword": "#a0446b", "syntax-variable": "#513346", "syntax-property": "#47658e", "syntax-constant": "#316a83", "syntax-punctuation": "#566575" });
|
||||
for (const [theme, savedMode, expectedTheme, mode] of [
|
||||
["gpt", "light", "default", "light"],
|
||||
["terminal", "dark", "default", "dark"],
|
||||
|
||||
@@ -175,7 +175,7 @@ await runSmoke('browser/webData', async ({ page }) => {
|
||||
const { saveAppearance } = await import('/src/lib/theme/appearance.ts');
|
||||
saveAppearance({ theme: 'default', mode });
|
||||
}, theme);
|
||||
assert.equal(await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue('--rs-bg').trim()), theme === 'light' ? '#f3f3f3' : '#141414');
|
||||
assert.equal(await page.evaluate(() => getComputedStyle(document.documentElement).getPropertyValue('--rs-bg').trim()), theme === 'light' ? '#fdfdfa' : '#151617');
|
||||
for (const dataType of ['cookies', 'history']) {
|
||||
await selectKind(dataType);
|
||||
await section.scrollIntoViewIfNeeded();
|
||||
|
||||
@@ -682,7 +682,7 @@ await runSmoke("layout/workbench", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 800, height: 600 });
|
||||
await actionCell(1, 0).click({ button: 'right' });
|
||||
await page.getByRole('menuitem', { name: 'Column', exact: true }).hover();
|
||||
assert.ok(await page.locator('.table-cell-menu, .table-cell-submenu:not([hidden])').evaluateAll(panels => panels.every(panel => {
|
||||
assert.ok(await page.locator('.table-cell-menu, .table-cell-submenu:popover-open').evaluateAll(panels => panels.every(panel => {
|
||||
const rect = panel.getBoundingClientRect(); return rect.left >= 0 && rect.top >= 0 && rect.right <= innerWidth && rect.bottom <= innerHeight;
|
||||
})));
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
@@ -36,7 +36,7 @@ await runSmoke("menus/consistency", async ({ page }) => {
|
||||
const label = row.querySelector(".action-label");
|
||||
const css = getComputedStyle(node), button = getComputedStyle(row);
|
||||
return {
|
||||
panel: [css.padding, css.borderRadius, css.backgroundColor, css.color, css.boxShadow, css.font],
|
||||
panel: [css.padding, css.borderRadius, css.backgroundColor, css.color, css.boxShadow, css.font, css.backdropFilter],
|
||||
row: [button.padding, button.minHeight, button.borderRadius, button.gap, button.font],
|
||||
iconWidth: icon.getBoundingClientRect().width,
|
||||
inset: Math.round(row.getBoundingClientRect().left - node.getBoundingClientRect().left),
|
||||
@@ -52,6 +52,12 @@ await runSmoke("menus/consistency", async ({ page }) => {
|
||||
const tab = page.getByRole("tab", { name: "a.md", exact: true });
|
||||
await tab.waitFor();
|
||||
await page.locator(".cm-content").waitFor();
|
||||
// Without a background image, menus are opaque and do not blur (UI-043).
|
||||
await row.click({ button: "right" });
|
||||
const opaque = await metrics(menu("File actions"));
|
||||
assert.match(opaque.panel[2], /^rgb\(/, "Menus are opaque without a background image");
|
||||
assert.equal(opaque.panel[6], "none");
|
||||
await dismiss();
|
||||
for (const theme of ["dark", "light"]) {
|
||||
await page.evaluate(async mode => {
|
||||
const { saveAppearance } = await import('/src/lib/theme/appearance.ts');
|
||||
@@ -84,7 +90,8 @@ await runSmoke("menus/consistency", async ({ page }) => {
|
||||
assert.ok(compactHeight < previousHeight * .85, 'The same actions use at least 15% less vertical space');
|
||||
console.log(JSON.stringify({ theme, compactHeight, previousHeight }));
|
||||
await page.screenshot({ path: path.join(output, `menu-spacing-after-${theme}.png`) });
|
||||
assert.ok(reference.panel[2].includes('/ 0.82') || /rgba\(.+, 0\.82\)/.test(reference.panel[2]), "Shared menus retain an 82% surface tint");
|
||||
assert.ok(reference.panel[2].includes('/ 0.92') || /rgba\(.+, 0\.92\)/.test(reference.panel[2]), "With a background image, menus are at least 92% opaque");
|
||||
assert.match(reference.panel[6], /blur\(18px\)/, "With a background image, menus blur it");
|
||||
assert.ok(reference.inset >= 5, "Rows need an inset from the panel border");
|
||||
assert.equal(await item("Pin").locator("svg.action-icon").count(), 1);
|
||||
const offsets = await file.locator(":scope > button").evaluateAll(nodes => nodes.map(node => Math.round(node.querySelector(".action-label").getBoundingClientRect().left - node.getBoundingClientRect().left)));
|
||||
|
||||
@@ -9,13 +9,8 @@ import { BASE_ROLES, resolveColors, type Mode } from '../../../src/lib/theme/rol
|
||||
import { RULES, checkTheme } from '../../../src/lib/theme/contrast.ts';
|
||||
import { composite, contrast, distance, formatHex, mix, parseHex } from '../../../src/lib/theme/color.ts';
|
||||
|
||||
// Rules that a palette fails today. Stages 5a-3 and 5a-4 redesign these palettes and remove each entry.
|
||||
// Rules that a palette fails today. Stage 5a-4 redesigns these palettes and removes each entry.
|
||||
const KNOWN_FAILURES: Record<string, readonly string[]> = {
|
||||
'default/dark': ['text', 'syntax-variety'],
|
||||
'default/light': ['text', 'syntax', 'syntax-variety', 'light-page'],
|
||||
'claude/dark': ['accent-text', 'status-text', 'syntax', 'status-distinct', 'syntax-variety'],
|
||||
'claude/light': ['accent-text', 'status-text', 'syntax', 'ansi', 'focus', 'selection-outline', 'syntax-variety', 'light-page'],
|
||||
'sakura/light': ['text', 'accent-text', 'status-text', 'syntax', 'ansi', 'syntax-variety', 'light-page'],
|
||||
'harvest-moon/dark': ['status-text', 'status-distinct'],
|
||||
'crimson-pilot/dark': ['status-distinct'],
|
||||
'silver-serpent/dark': ['status-text', 'status-distinct'],
|
||||
@@ -30,7 +25,7 @@ for (const variant of variants) {
|
||||
if (!results.length) continue;
|
||||
const known = KNOWN_FAILURES[variant.key]?.includes(rule.id);
|
||||
const failures = results.filter(finding => !finding.pass).map(finding => `${finding.subject}: ${finding.value.toFixed(2)} (minimum ${finding.min})`);
|
||||
test(`${variant.key} passes the ${rule.id} rule`, known ? { todo: 'Known palette failure. Stages 5a-3 and 5a-4 redesign this palette.' } : {}, () => {
|
||||
test(`${variant.key} passes the ${rule.id} rule`, known ? { todo: 'Known palette failure. Stage 5a-4 redesigns this palette.' } : {}, () => {
|
||||
assert.deepEqual(failures, []);
|
||||
});
|
||||
if (known) test(`${variant.key} still fails the known ${rule.id} rule`, () => {
|
||||
|
||||
Reference in New Issue
Block a user