From 83a5b5866571e0448dfe67019865c83b5b18f30a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 22:26:20 -0600 Subject: [PATCH 1/3] feat(ui): one radius scale and tint tokens across the renderer Surfaces are 8 px, controls 6 px and parts inside a control 4 px. Every hard-coded radius in the desktop renderer, the Store edition and the web demo moves onto the tokens; only dots and spinners stay round. Adds --tint, --tint-strong and --hairline to the base tokens, and a test that fails on a hard-coded radius. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_011Ya6qvLmxrim1dK1KjEpJ7 --- apps/desktop/design/tokens.md | 21 +- apps/desktop/e2e/layout.spec.ts | 16 +- .../src/renderer/code-review/code-review.css | 54 +-- apps/desktop/src/renderer/images/images.css | 18 +- .../src/renderer/plugins/plugins-catalog.css | 18 +- apps/desktop/src/renderer/plugins/plugins.css | 12 +- .../src/renderer/routines/routines.css | 46 +-- apps/desktop/src/renderer/space/knowledge.css | 6 +- apps/desktop/src/renderer/space/space.css | 128 +++--- apps/desktop/src/renderer/styles.css | 162 ++++---- apps/desktop/src/renderer/tokens.css | 20 +- apps/desktop/src/renderer/usage/usage.css | 60 +-- apps/desktop/src/renderer/workspace.css | 52 +-- apps/store-desktop/src/renderer/store.css | 8 +- apps/web/src/web.css | 8 +- .../2026-11-15-chat-refresh-foundation.md | 366 ++++++++++++++++++ scripts/test/radius-scale.test.mjs | 43 ++ 17 files changed, 735 insertions(+), 303 deletions(-) create mode 100644 docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md create mode 100644 scripts/test/radius-scale.test.mjs diff --git a/apps/desktop/design/tokens.md b/apps/desktop/design/tokens.md index deff555b..a8177a05 100644 --- a/apps/desktop/design/tokens.md +++ b/apps/desktop/design/tokens.md @@ -99,10 +99,27 @@ isn't a substitute: it lacks the small-size optical tracking and reads 1–2 px | "Codex" (sidebar title, cap 13 px) | ≈52 | 18/600 | `--text-lg` | | "What should we build in coven-threads?" | 481 | 28/400 = 480 | `--text-xl` | -## Radii +## Radius scale + +Since 2026-11-15 the renderer has one radius scale, chosen for a tighter, uniform look rather than +measured from the reference. It applies to every button and component in the desktop renderer, the +Store edition and the web demo. + +| Step | Value | Tokens | Used for | +|---|---|---|---| +| Surface | 8 px | `--radius-md`, `--radius-composer`, `--radius-sheet` | composer, menus, cards, dialogs, message bubbles, code blocks, the content sheet | +| Control | 6 px | `--radius-sm`, `--radius-row`, `--radius-pill` | buttons, icon buttons, rows, options, fields, chips and badges | +| Part | 4 px | `--radius-xs` | pieces inside a control: tabs, icon tiles, inline code, key hints | + +Only status dots, progress dots and spinners are round (`50%`). No stylesheet writes a radius as a +number: `scripts/test/radius-scale.test.mjs` fails on a hard-coded radius above 2 px and pins how +many circles each stylesheet has, so a new one is a deliberate edit. `--radius-pill` keeps its name +for the chips that use it, though nothing is pill-shaped any more. + +### Original measurements (superseded) Measured along the top edge of a filled box: the number of pixels, row by row, before the fill starts. -The inset profile is then compared with a circle. +The inset profile is then compared with a circle. These were the values until 2026-11-15. | Token | Value | Profile (inset px, rows from the top edge) | |---|---|---| diff --git a/apps/desktop/e2e/layout.spec.ts b/apps/desktop/e2e/layout.spec.ts index a92f7e40..2781bfce 100644 --- a/apps/desktop/e2e/layout.spec.ts +++ b/apps/desktop/e2e/layout.spec.ts @@ -111,7 +111,7 @@ test.describe("Design tokens", () => { "--border-pane": "#2b3144", "--border-rail": "#32384d", "--border-composer": "#42465e", "--rule": "#2b3347", "--text-1": "#f8f3fa", "--text-2": "#d0cad9", "--text-3": "#aaa5b8", "--text-4": "#918da2", "--text-placeholder": "#a49eb2", "--accent": "#ef7bcd", "--accent-strong": "#f386a1", "--accent-ink": "#1b1020", "--accent-warn": "#dc9258", "--text-sm": "13px", "--text-md": "14px", "--text-lg": "18px", "--text-xl": "28px", - "--radius-row": "10px", "--radius-composer": "20px", + "--radius-row": "6px", "--radius-composer": "8px", }; test("tokens resolve to the chosen values", async () => { @@ -165,7 +165,7 @@ test.describe("Phase 3 · shell", () => { expect([rail.x, rail.y, rail.width]).toEqual([0, 42, 48]); const sheet = await box(tid(page, "sheet")); expect([sheet.x, sheet.y]).toEqual([48, 42]); - expect(await css(tid(page, "sheet"), "border-top-left-radius")).toBe("12px"); + expect(await css(tid(page, "sheet"), "border-top-left-radius")).toBe("8px"); expect(await css(tid(page, "sheet"), "border-left-color")).toBe("rgb(50, 56, 77)"); }); @@ -200,7 +200,7 @@ test.describe("Phase 3 · shell", () => { expect(project.y).toBe(166); const row = await box(tid(page, "thread-row").first()); expect([row.x, row.y, row.width, row.height]).toEqual([57, 197, 213, 72]); // title, provider/model, and checkout/PR metadata - expect(await css(tid(page, "thread-row").first(), "border-top-left-radius")).toBe("10px"); + expect(await css(tid(page, "thread-row").first(), "border-top-left-radius")).toBe("6px"); const label = await box(tid(page, "thread-row-title").first()); near(label.x, 89); expect(await css(tid(page, "thread-row-title").first(), "font-size")).toBe("14px"); @@ -208,7 +208,7 @@ test.describe("Phase 3 · shell", () => { }); test.describe("Phase 4 · composer", () => { - // Reference #1: box 960×109; controls retain their insets; strip 38 px, inset 13 px; send a 34 px circle in the corner. + // Reference #1: box 960×109; controls retain their insets; strip 38 px, inset 13 px; send a 34 px square (control radius) in the corner. const near = (got: number, want: number, tol = 1) => expect(Math.abs(got - want), `${got} vs ${want}`).toBeLessThanOrEqual(tol); test("box is 960×109, centred in the main pane, 16 px off the bottom", async () => { @@ -220,7 +220,7 @@ test.describe("Phase 4 · composer", () => { near(c.x + c.width / 2, m.x + 1 + (m.width - 1) / 2); expect(await css(tid(page, "composer-box"), "background-color")).toBe("rgb(29, 36, 53)"); expect(await css(tid(page, "composer-box"), "border-top-color")).toBe("rgb(66, 70, 94)"); - expect(await css(tid(page, "composer-box"), "border-top-left-radius")).toBe("20px"); + expect(await css(tid(page, "composer-box"), "border-top-left-radius")).toBe("8px"); }); test("context strip sits on the box: 38 px, inset 13 px, 13 px text", async () => { @@ -231,7 +231,7 @@ test.describe("Phase 4 · composer", () => { expect(await css(tid(page, "composer-context"), "font-size")).toBe("13px"); }); - test("control row: + and access keep their insets, round send in the corner", async () => { + test("control row: + and access keep their insets, square send in the corner", async () => { const c = await box(tid(page, "composer-box")); const plus = await box(tid(page, "composer-plus")); near(plus.x + plus.width / 2, c.x + 22); near(plus.y + plus.height / 2, c.y + c.height - 22); @@ -242,7 +242,7 @@ test.describe("Phase 4 · composer", () => { expect([send.width, send.height]).toEqual([34, 34]); near(send.x + send.width, c.x + c.width - 2); near(send.y + send.height, c.y + c.height - 2); - expect(await css(tid(page, "send"), "border-top-left-radius")).toBe("50%"); + expect(await css(tid(page, "send"), "border-top-left-radius")).toBe("6px"); expect(await css(tid(page, "composer-input"), "font-size")).toBe("14px"); await expect(tid(page, "composer-input")).toHaveAttribute("placeholder", "Do anything"); }); @@ -263,7 +263,7 @@ test.describe("Phase 6 · transcript", () => { expect(await css(label, "border-bottom-color")).toBe("rgb(43, 51, 71)"); const bubble = items(page, "user").first().locator('[data-testid="item-text"]'); expect(await css(bubble, "background-color")).toBe("rgb(27, 34, 50)"); - expect(await css(bubble, "border-top-left-radius")).toBe("12px"); + expect(await css(bubble, "border-top-left-radius")).toBe("8px"); const b = await box(bubble); expect(Math.abs(b.x + b.width - (header.x + header.width))).toBeLessThanOrEqual(1); const prose = items(page, "assistant").first(); diff --git a/apps/desktop/src/renderer/code-review/code-review.css b/apps/desktop/src/renderer/code-review/code-review.css index 17ba26dc..08b28be7 100644 --- a/apps/desktop/src/renderer/code-review/code-review.css +++ b/apps/desktop/src/renderer/code-review/code-review.css @@ -23,20 +23,20 @@ .cr-inbox-head { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px; } .cr-inbox-title { flex: 1; min-width: 0; margin: 0; color: var(--text-1); font: var(--weight-semibold) var(--text-lg)/1 var(--font-sans); letter-spacing: -.02em; } .cr-menu { position: relative; } -.cr-search { height: 36px; margin: 0 10px 8px 8px; border-radius: 10px; } +.cr-search { height: 36px; margin: 0 10px 8px 8px; border-radius: var(--radius-sm); } .cr-search input::-webkit-search-cancel-button { display: none; } .cr-inbox-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-bottom: 16px; } .cr-group { margin-top: 8px; } .cr-group ul { margin: 0; padding: 0; list-style: none; } .cr-group-label { margin: 0; padding: 6px 16px; color: var(--text-3); font: var(--weight-regular) var(--text-md)/20px var(--font-sans); } -.cr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; width: calc(100% - 16px); margin: 0 8px 1px; padding: 7px 8px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text-1); font: inherit; text-align: left; cursor: pointer; } +.cr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; width: calc(100% - 16px); margin: 0 8px 1px; padding: 7px 8px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-1); font: inherit; text-align: left; cursor: pointer; } .cr-row:hover { background: var(--bg-row-hover); } .cr-row.selected { background: var(--bg-row-selected); } .cr-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } .cr-row-title { grid-column: 1; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--text-1); font-size: var(--text-md); line-height: 20px; overflow-wrap: anywhere; } .cr-row-stack { grid-column: 2; grid-row: 1; padding-top: 3px; color: var(--text-3); } .cr-row-meta { grid-column: 1 / -1; margin-top: 3px; overflow: hidden; color: var(--text-3); font-size: var(--text-sm); line-height: 18px; white-space: nowrap; text-overflow: ellipsis; } -.cr-show-more { margin: 2px 8px 0; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); font: inherit; font-size: var(--text-md); cursor: pointer; } +.cr-show-more { margin: 2px 8px 0; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); font: inherit; font-size: var(--text-md); cursor: pointer; } .cr-show-more:hover:not(:disabled) { background: var(--bg-row-hover); color: var(--text-2); } .cr-hint, .cr-stale { margin: 6px 16px; color: var(--text-info); font-size: var(--text-sm); line-height: 1.45; } .cr-stale .btn { margin-left: 6px; } @@ -60,9 +60,9 @@ .cr-state-closed { color: var(--danger-text); background: var(--danger-bg); } .cr-state-merged { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); } .cr-pr-id { min-width: 0; overflow: hidden; color: var(--text-3); font-size: var(--text-md); white-space: nowrap; text-overflow: ellipsis; } -.cr-link-group { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 1px; border: 1px solid var(--border-strong); border-radius: 10px; } +.cr-link-group { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 1px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); } .cr-link-group a.icon-btn { display: inline-grid; place-items: center; color: inherit; } -.cr-action { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-size: var(--text-md); white-space: nowrap; } +.cr-action { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font: inherit; font-size: var(--text-md); white-space: nowrap; } .cr-action.icon-only { width: 32px; padding: 0; border-color: transparent; } .cr-action.primary { border-color: transparent; background: var(--text-1); color: var(--bg-main); } .cr-action[aria-disabled="true"] { opacity: .5; cursor: default; } @@ -115,14 +115,14 @@ .cr-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; } .cr-section-heading h2 { font-size: var(--text-lg); margin: 0; } .cr-section-heading label { color: var(--text-3); font-size: var(--text-sm); } -.cr-section-heading select { max-width: 160px; color: var(--text-2); background: var(--bg-main); border: 1px solid var(--border-pane); border-radius: 6px; padding: 4px; } -.cr-activity-item { border: 1px solid var(--border-pane); border-radius: 10px; padding: 16px; margin: 12px 0; overflow-wrap: anywhere; } +.cr-section-heading select { max-width: 160px; color: var(--text-2); background: var(--bg-main); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 4px; } +.cr-activity-item { border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 16px; margin: 12px 0; overflow-wrap: anywhere; } .cr-activity-item > header { display: flex; flex-wrap: wrap; gap: 6px; color: var(--text-3); font-size: var(--text-sm); } .cr-activity-item > header strong { color: var(--text-2); } .cr-activity-item > header time { margin-left: auto; } .cr-activity-item > p { font-size: var(--text-md); } .cr-activity-item > p.cr-evidence { font-size: var(--text-xs); } -.cr-comment-slot { margin-top: 24px; padding: 16px; border: 1px solid var(--border-pane); border-radius: 10px; } +.cr-comment-slot { margin-top: 24px; padding: 16px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); } .cr-overview-layout :is(button, select, summary, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; } @container cr-pane (max-width: 1100px) { .cr-overview-main { padding-inline: 24px; } @@ -134,7 +134,7 @@ .cr-overview-main { overflow: visible; padding: 20px 24px 32px; } .cr-overview-sidebar { overflow: visible; padding: 16px 24px 120px; border-top: 1px solid var(--border-pane); } } -.cr-changes-summary { display: block; width: 100%; margin-bottom: 24px; padding: 12px; border: 1px solid var(--border-pane); border-radius: 10px; color: var(--text-2); background: transparent; font: inherit; text-align: left; cursor: pointer; } +.cr-changes-summary { display: block; width: 100%; margin-bottom: 24px; padding: 12px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); color: var(--text-2); background: transparent; font: inherit; text-align: left; cursor: pointer; } .cr-commit-group { margin: 12px 0; padding: 10px 16px; color: var(--text-3); border-left: 1px solid var(--border-pane); font-size: var(--text-md); } .cr-commit-group summary { cursor: pointer; } .cr-commit-group .cr-activity-item { margin-block: 4px; padding-block: 8px; border: 0; } @@ -156,8 +156,8 @@ .cr-diff-toolbar label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; } .cr-revision, .cr-previous, .cr-anchor { font-size: 11px; color: var(--text-3); overflow-wrap: anywhere; } .cr-anchor { margin: 4px 12px; } -.cr-file-section { border: 1px solid var(--border-pane); border-radius: 6px; margin: 0 0 12px; outline: none; } -.cr-file-heading { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 8px; background: var(--bg-2); border-radius: 6px 6px 0 0; } +.cr-file-section { border: 1px solid var(--border-pane); border-radius: var(--radius-sm); margin: 0 0 12px; outline: none; } +.cr-file-heading { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 8px; background: var(--bg-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; } .cr-file-heading > button { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; text-align: left; font-size: 11px; color: var(--text-2); background: transparent; border: 0; padding: 3px 0; cursor: pointer; } .cr-file-heading bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cr-file-heading .stat { flex-shrink: 0; font-size: 10px; } @@ -167,10 +167,10 @@ .cr-tree-viewed { font-size: 10px; color: var(--text-3); flex-shrink: 0; } .cr-file-menu { position: relative; } .cr-file-menu summary { list-style: none; cursor: pointer; padding: 0 4px; } -.cr-file-menu > div { position: absolute; z-index: 4; top: 22px; right: 0; display: grid; gap: 6px; width: 150px; padding: 8px; background: var(--bg-2); border: 1px solid var(--border-pane); border-radius: 6px; } +.cr-file-menu > div { position: absolute; z-index: 4; top: 22px; right: 0; display: grid; gap: 6px; width: 150px; padding: 8px; background: var(--bg-2); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); } .cr-file-menu a, .cr-file-menu button { font-size: 11px; } .cr-previous, .cr-patch-notice { margin: 8px; font-size: 11px; overflow-wrap: anywhere; } -.cr-patch { overflow-x: auto; border-radius: 0 0 6px 6px; } +.cr-patch { overflow-x: auto; border-radius: 0 0 var(--radius-sm) var(--radius-sm); } .cr-code.review-code .review-code-line { display: flex; } .cr-code .line-number { flex: 0 0 38px; width: 38px; padding: 0 5px; margin: 0; background: transparent; border: 0; font: inherit; color: var(--text-4); text-align: right; cursor: pointer; } .cr-code .line-number:disabled { cursor: default; } @@ -184,7 +184,7 @@ .cr-folder { font-size: 11px; margin: 6px 0; } .cr-folder > summary { color: var(--text-3); cursor: pointer; overflow-wrap: anywhere; } .cr-folder > div { padding-left: 10px; } -.cr-tree-file { width: 100%; display: flex; gap: 5px; align-items: center; background: transparent; border: 0; color: var(--text-2); padding: 5px 3px; text-align: left; border-radius: 4px; cursor: pointer; font-size: 11px; } +.cr-tree-file { width: 100%; display: flex; gap: 5px; align-items: center; background: transparent; border: 0; color: var(--text-2); padding: 5px 3px; text-align: left; border-radius: var(--radius-xs); cursor: pointer; font-size: 11px; } .cr-tree-file bdi { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cr-tree-file .stat { font-size: 9px; flex-shrink: 0; } .cr-tree-file[aria-current="true"] { background: var(--bg-row-selected); color: var(--text-1); } @@ -196,10 +196,10 @@ /* CR-7 (#326): comment and review composers, previews and sends in doubt. */ .cr-compose { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; } .cr-compose .cr-comment-slot { margin-top: 0; } -.cr-composer .cr-editor, .cr-composer .cr-preview, .cr-doubt { padding: 16px; border: 1px solid var(--border-pane); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; } +.cr-composer .cr-editor, .cr-composer .cr-preview, .cr-doubt { padding: 16px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 8px; min-width: 0; } .cr-preview { border-color: var(--accent, var(--border-pane)); } .cr-doubt { border-color: var(--danger-border); background: var(--danger-bg); } -.cr-textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; font: inherit; color: var(--text-1); background: var(--bg-input, transparent); border: 1px solid var(--border-pane); border-radius: 8px; padding: 8px; } +.cr-textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; font: inherit; color: var(--text-1); background: var(--bg-input, transparent); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 8px; } .cr-compose-buttons { display: flex; flex-wrap: wrap; gap: 8px; } .cr-events { display: flex; flex-wrap: wrap; gap: 12px; border: 0; padding: 0; margin: 0; } .cr-events legend { font-weight: 600; margin-bottom: 4px; } @@ -214,8 +214,8 @@ .cr-line-composer .cr-textarea { min-height: 40px; flex: 1 1 220px; } /* CR-7 Merge panel: under the PR header, above the pane's content. */ -.cr-merge { margin: 8px 16px; padding: 16px; border: 1px solid var(--border-pane); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; } -.cr-merge .cr-preview { padding: 12px; border: 1px solid var(--accent, var(--border-pane)); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; } +.cr-merge { margin: 8px 16px; padding: 16px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 8px; min-width: 0; } +.cr-merge .cr-preview { padding: 12px; border: 1px solid var(--accent, var(--border-pane)); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 8px; } .cr-merge-head { display: flex; align-items: center; gap: 8px; } .cr-merge .spacer { flex: 1; } .cr-merge p { margin: 0; } @@ -223,22 +223,22 @@ /* CR-7 decisions 2–4: the state menu, the edit form and reviewer requests. */ .cr-state-menu { position: relative; display: inline-flex; } button.cr-state { cursor: pointer; font: inherit; } -.cr-state-options { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 200px; padding: 4px; border: 1px solid var(--border-pane); border-radius: 10px; background: var(--bg-sidebar); display: flex; flex-direction: column; } -.cr-state-option { text-align: left; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; } +.cr-state-options { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 200px; padding: 4px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-sidebar); display: flex; flex-direction: column; } +.cr-state-option { text-align: left; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; font: inherit; cursor: pointer; } .cr-state-option:hover, .cr-state-option:focus-visible { background: var(--border-pane); } .cr-field { display: flex; flex-direction: column; gap: 4px; } -.cr-input { font: inherit; padding: 6px 8px; border: 1px solid var(--border-pane); border-radius: 8px; background: transparent; color: inherit; min-width: 0; } +.cr-input { font: inherit; padding: 6px 8px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: transparent; color: inherit; min-width: 0; } .cr-reviewers { display: flex; flex-direction: column; gap: 8px; } /* CR-6 (#325): the agent review panel, the instructions popover and the runs shown in the overview. */ .cr-instructions { position: relative; display: inline-flex; } -.cr-instructions-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: min(440px, 80vw); padding: 14px; border: 1px solid var(--border-pane); border-radius: 10px; background: var(--bg-sidebar); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: flex; flex-direction: column; gap: 8px; } +.cr-instructions-popover { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; width: min(440px, 80vw); padding: 14px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-sidebar); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: flex; flex-direction: column; gap: 8px; } .cr-instructions-popover h2 { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text-1); } .cr-instructions-popover p { margin: 0; } -.cr-agent-panel select { font: inherit; padding: 4px 8px; border: 1px solid var(--border-pane); border-radius: 8px; background: transparent; color: inherit; max-width: 280px; } +.cr-agent-panel select { font: inherit; padding: 4px 8px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: transparent; color: inherit; max-width: 280px; } .cr-agent-panel .cr-compose-buttons { align-items: center; } .cr-agent { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; } -.cr-agent-run { padding: 14px 16px; border: 1px solid var(--border-pane); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow-wrap: anywhere; } +.cr-agent-run { padding: 14px 16px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow-wrap: anywhere; } .cr-agent-run-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; } .cr-agent-state { font-size: var(--text-sm); padding: 1px 8px; border-radius: var(--radius-pill); background: var(--bg-row-hover); color: var(--text-2); } .cr-agent-running .cr-agent-state { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); } @@ -248,19 +248,19 @@ button.cr-state { cursor: pointer; font: inherit; } .cr-agent-coverage summary { cursor: pointer; font-size: var(--text-sm); color: var(--text-3); } .cr-agent-coverage ul, .cr-agent-trail { margin: 6px 0 0; padding-left: 18px; font-size: var(--text-sm); color: var(--text-3); } .cr-agent-findings { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; } -.cr-agent-finding { padding: 10px 12px; border: 1px solid var(--border-pane); border-radius: 8px; display: flex; flex-direction: column; gap: 4px; } +.cr-agent-finding { padding: 10px 12px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 4px; } .cr-agent-finding-head { display: flex; align-items: baseline; gap: 8px; } .cr-agent-severity { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); } .cr-severity-blocker .cr-agent-severity, .cr-severity-major .cr-agent-severity { color: var(--danger-text); } .cr-agent-finding-detail { margin: 0; white-space: pre-wrap; } .cr-agent-finding p { margin: 0; } -.cr-agent-ask { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border-pane); border-radius: 10px; } +.cr-agent-ask { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); } .cr-agent-ask p { margin: 0; } /* C76: the deletion counts on the file header and tree use the diff's text colour, which keeps AA on every theme's panel background. */ .cr-file-heading .stat.del, .cr-tree-file .stat.del { color: var(--diff-del-text); } /* The diff's plain actions (Refresh files, Retry, Cancel context): without this they take the browser's button colours, which fail contrast on every dark theme. */ -.cr-diff button:not([class]) { color: var(--text-1); background: transparent; border: 1px solid var(--border-pane); border-radius: 6px; padding: 2px 8px; font: inherit; cursor: pointer; } +.cr-diff button:not([class]) { color: var(--text-1); background: transparent; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 2px 8px; font: inherit; cursor: pointer; } .cr-diff button:not([class]):hover:not(:disabled) { background: var(--bg-row-hover); } .cr-diff button:not([class]):disabled { cursor: default; color: var(--text-3); } diff --git a/apps/desktop/src/renderer/images/images.css b/apps/desktop/src/renderer/images/images.css index 747fccc6..479ba9f6 100644 --- a/apps/desktop/src/renderer/images/images.css +++ b/apps/desktop/src/renderer/images/images.css @@ -53,7 +53,7 @@ padding: 7px 10px; background: transparent; border: 0; - border-radius: 7px; + border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer; } @@ -66,7 +66,7 @@ color: var(--text-1); border: 1px solid var(--border-pane); padding: 8px 10px; - border-radius: 8px; + border-radius: var(--radius-sm); max-width: 100%; } .images-surface :is(button, input, select, textarea, summary):focus-visible { @@ -78,7 +78,7 @@ padding: 12px; margin: 12px 0; border: 1px solid var(--border-pane); - border-radius: 8px; + border-radius: var(--radius-sm); } .images-error button { margin-left: 12px; @@ -106,7 +106,7 @@ min-width: 0; border: 1px solid transparent; padding: 6px; - border-radius: 12px; + border-radius: var(--radius-md); color: var(--text-1); background: transparent; cursor: pointer; @@ -119,7 +119,7 @@ .image-card > div { width: 100%; aspect-ratio: 1; - border-radius: 8px; + border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-elevated); display: grid; @@ -171,7 +171,7 @@ border: 0; padding: 0; background: var(--bg-elevated); - border-radius: 10px; + border-radius: var(--radius-sm); cursor: zoom-in; } .image-preview img { @@ -199,7 +199,7 @@ } .image-studio { border: 1px solid var(--border-pane); - border-radius: 14px; + border-radius: var(--radius-md); padding: 22px; margin: 20px 0; display: flex; @@ -231,7 +231,7 @@ gap: 8px; padding: 5px; border: 1px solid var(--border-pane); - border-radius: 8px; + border-radius: var(--radius-sm); } .image-references img { width: 40px; @@ -270,7 +270,7 @@ margin-top: 12px; background: var(--bg-elevated); padding: 12px; - border-radius: 8px; + border-radius: var(--radius-sm); } .image-transcript pre { white-space: pre-wrap; diff --git a/apps/desktop/src/renderer/plugins/plugins-catalog.css b/apps/desktop/src/renderer/plugins/plugins-catalog.css index ee0b6554..39fe9de1 100644 --- a/apps/desktop/src/renderer/plugins/plugins-catalog.css +++ b/apps/desktop/src/renderer/plugins/plugins-catalog.css @@ -5,8 +5,8 @@ .pc-list header { display: flex; align-items: center; height: 50px; padding: 0 6px 0 10px; } .pc-list h1 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; } .pc-list h2 { margin: 26px 10px 12px; color: var(--text-2); font-size: 13px; font-weight: 400; } -.plugins-catalog .pc-icon { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); } -.pc-nav { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 14px; color: var(--text-1); } +.plugins-catalog .pc-icon { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); } +.pc-nav { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-1); } .pc-nav[aria-current] { background: var(--bg-row-selected); } .pc-nav.pc-off { color: var(--text-3); } .pc-nav small { margin-left: auto; font-size: 11px; color: var(--text-4); } @@ -15,25 +15,25 @@ .pc-page { max-width: 1180px; margin: 0 auto; padding: 20px 28px 32px; } .pc-head { display: flex; align-items: center; gap: 12px; } .pc-head h2 { flex: 1; margin: 0; font-size: 22px; font-weight: 500; } -.pc-search { display: flex; align-items: center; gap: 10px; width: 240px; height: 36px; padding: 0 14px; border: 1px solid var(--border-pane); border-radius: 18px; color: var(--text-2); } +.pc-search { display: flex; align-items: center; gap: 10px; width: 240px; height: 36px; padding: 0 14px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); color: var(--text-2); } .plugins-catalog .pc-search input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text-1); font: inherit; font-size: 14px; box-shadow: none; } -.plugins-catalog .pc-add { height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: var(--text-1); color: var(--bg-main); font-size: 14px; font-weight: 500; } +.plugins-catalog .pc-add { height: 36px; padding: 0 16px; border: 0; border-radius: var(--radius-md); background: var(--text-1); color: var(--bg-main); font-size: 14px; font-weight: 500; } .plugins-catalog .pc-add:disabled { opacity: .45; cursor: not-allowed; } .pc-sub { margin: 10px 0 0; color: var(--text-2); font-size: 15.5px; } -.pc-note { margin: 10px 0 0; padding: 9px 12px; border: 1px solid var(--border-pane); border-radius: 10px; color: var(--text-3); font-size: 12.5px; } +.pc-note { margin: 10px 0 0; padding: 9px 12px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); color: var(--text-3); font-size: 12.5px; } .pc-tabs { display: flex; gap: 6px; margin: 14px 0 16px; } -.plugins-catalog .pc-tabs button { height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: transparent; color: var(--text-1); font-size: 14px; } +.plugins-catalog .pc-tabs button { height: 36px; padding: 0 16px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-1); font-size: 14px; } .plugins-catalog .pc-tabs button[aria-selected="true"] { background: var(--bg-row-selected); } .pc-section { margin-bottom: 18px; } .pc-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 17px; font-weight: 500; } .pc-section h3 svg { color: var(--text-3); } .pc-section ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 36px; margin: 0; padding: 0; list-style: none; } .pc-section li { display: flex; align-items: center; gap: 12px; height: 60px; } -.pc-mark { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #fff; font-size: 16px; font-weight: 600; } +.pc-mark { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); color: #fff; font-size: 16px; font-weight: 600; } .pc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .pc-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 500; } .pc-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 14px; } -.plugins-catalog .pc-plus { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); } +.plugins-catalog .pc-plus { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); } .plugins-catalog .pc-plus:disabled { opacity: .4; cursor: not-allowed; } @media (max-width: 900px) { .plugins-catalog { grid-template-columns: minmax(0, 1fr); } .pc-list { display: none; } } @@ -46,7 +46,7 @@ .pc-crumbs { display: flex; align-items: center; gap: 12px; margin: 18px 0 0 24px; font-size: 13.5px; color: var(--text-3); } .pc-crumbs strong { color: var(--text-1); font-weight: 400; } .pc-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 0 36px; margin: 14px 0 0; padding: 0; list-style: none; } -.pc-skills li { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 8px; border-radius: 12px; } +.pc-skills li { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 8px; border-radius: var(--radius-md); } .pc-skills li:hover { background: var(--bg-row-hover); } .pc-skill-mark { background: transparent; border: 1px solid var(--border-pane); color: var(--text-2); } .plugins-catalog .pc-skills .pc-plus:not(:disabled) { cursor: pointer; } diff --git a/apps/desktop/src/renderer/plugins/plugins.css b/apps/desktop/src/renderer/plugins/plugins.css index 03d9028b..33486d5b 100644 --- a/apps/desktop/src/renderer/plugins/plugins.css +++ b/apps/desktop/src/renderer/plugins/plugins.css @@ -3,7 +3,7 @@ .plugins-header h1 { margin: 3px 0 8px; font-size: 30px; font-weight: 600; } .plugins-header p { margin: 0; color: var(--text-3); } .plugins-eyebrow { font-size: 10px; letter-spacing: .16em; font-weight: 600; } -.plugins-view button, .plugins-view select, .plugins-view input, .plugins-view textarea { color: var(--text-1); background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: 7px; padding: 8px 11px; font: inherit; } +.plugins-view button, .plugins-view select, .plugins-view input, .plugins-view textarea { color: var(--text-1); background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 8px 11px; font: inherit; } .plugins-view button { cursor: pointer; } .plugins-view button:hover:not(:disabled) { background: var(--bg-row-hover); border-color: var(--border-strong); } .plugins-view button:disabled { opacity: .45; cursor: default; } @@ -15,13 +15,13 @@ .plugins-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border-pane); margin: 22px 0; } .plugins-tabs button { border: 0; background: transparent; border-radius: 0; padding: 12px 1px; color: var(--text-3); border-bottom: 2px solid transparent; } .plugins-tabs button[aria-current=page] { color: var(--text-1); border-bottom-color: var(--accent); } -.plugins-error, .plugins-notice { padding: 12px 15px; border-radius: 8px; margin: 14px 0; overflow-wrap: anywhere; } +.plugins-error, .plugins-notice { padding: 12px 15px; border-radius: var(--radius-sm); margin: 14px 0; overflow-wrap: anywhere; } .plugins-error { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); } .plugins-notice { background: var(--bg-row-hover); color: var(--text-2); } .plugins-search { margin-bottom: 20px; max-width: 460px; } .plugins-layout { display: flex; align-items: flex-start; gap: 22px; } .plugins-list { flex: 1; min-width: 230px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; } -.plugin-card { background: var(--bg-sidebar); border: 1px solid var(--border-pane); border-radius: 12px; overflow: hidden; } +.plugin-card { background: var(--bg-sidebar); border: 1px solid var(--border-pane); border-radius: var(--radius-md); overflow: hidden; } .plugin-card.is-selected { border-color: var(--accent); } .plugins-view .plugin-open { display: flex; flex-direction: column; gap: 12px; text-align: left; width: 100%; background: transparent; border: 0; border-radius: 0; padding: 18px; } .plugin-open > span:not(:first-child) { color: var(--text-3); line-height: 1.6; overflow-wrap: anywhere; } @@ -31,7 +31,7 @@ .plugin-open small { color: var(--text-4); font-size: 11px; } .plugin-actions { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 18px 16px; } .plugin-actions button { font-size: 12px; padding: 6px 9px; } -.plugin-details { width: min(44%, 520px); min-width: 270px; border: 1px solid var(--border-pane); border-radius: 12px; padding: 20px; background: var(--bg-sidebar); } +.plugin-details { width: min(44%, 520px); min-width: 270px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); padding: 20px; background: var(--bg-sidebar); } .plugin-detail-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; } .plugin-detail-heading h2, .plugin-source h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; } .plugin-details pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 var(--font-mono); color: var(--text-2); } @@ -50,6 +50,6 @@ .plugins-empty h2 { color: var(--text-2); font-size: 17px; font-weight: 500; } @media (max-width: 800px) { .plugins-layout { flex-direction: column; } .plugins-list, .plugin-details { width: 100%; min-width: 0; } .plugin-source { flex-direction: column; } .plugins-context label { flex: 1; } .plugins-context select { max-width: 100%; } } .sheet > .plugin-surface { grid-area: 1 / 1 / 2 / -1; overflow: auto; min-width: 0; min-height: 0; position: relative; } -.plugin-binding { margin: 20px 28px; padding: 20px; border: 1px solid var(--border-pane); border-radius: 12px; background: var(--bg-elevated); color: var(--text-1); display: flex; flex-direction: column; gap: 12px; } -.plugin-binding :is(input,select) { color: var(--text-1); background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: 6px; padding: 8px; } +.plugin-binding { margin: 20px 28px; padding: 20px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-1); display: flex; flex-direction: column; gap: 12px; } +.plugin-binding :is(input,select) { color: var(--text-1); background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 8px; } .plugin-binding :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; } diff --git a/apps/desktop/src/renderer/routines/routines.css b/apps/desktop/src/renderer/routines/routines.css index 71c1ec8d..0543cad3 100644 --- a/apps/desktop/src/renderer/routines/routines.css +++ b/apps/desktop/src/renderer/routines/routines.css @@ -8,13 +8,13 @@ .sched-list-head h1 { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0; } .routines-view .sched-list-head .icon-btn, .routines-view .sched-reopen { border: 0; background: transparent; padding: 0; color: var(--text-2); } .routines-view .sched-search { margin: 0 12px 6px; } -.routines-view .sched-new { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; margin: 1px 8px 0; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text-1); font-size: 14px; text-align: left; } +.routines-view .sched-new { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; margin: 1px 8px 0; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-1); font-size: 14px; text-align: left; } .sched-scroll { flex: 1; min-height: 0; overflow: auto; padding-bottom: 16px; } .sched-scroll ul { list-style: none; margin: 0; padding: 0; } .routines-view .sched-section { display: flex; align-items: center; gap: 6px; margin: 24px 16px 12px; padding: 0; border: 0; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 400; line-height: 20px; } .routines-view .sched-fold:hover:not(:disabled) { background: transparent; color: var(--text-1); } .sched-none { margin: 0 16px; color: var(--text-3); font-size: 12px; } -.routines-view .sched-row { display: block; width: calc(100% - 16px); margin: 0 8px; padding: 7px 8px 6px; border: 0; border-radius: 9px; background: transparent; text-align: left; white-space: normal; } +.routines-view .sched-row { display: block; width: calc(100% - 16px); margin: 0 8px; padding: 7px 8px 6px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; white-space: normal; } .routines-view .sched-row.selected { background: var(--bg-row-selected); } .sched-row-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); font-size: 14px; line-height: 20px; } .sched-row-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 12px; line-height: 18px; } @@ -31,7 +31,7 @@ .sched-hero h2 { margin: 12px 0 0; font-size: 17px; font-weight: 500; line-height: 24px; } .sched-hero > p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 20px; } .sched-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 357px)); gap: 22px 21px; width: 100%; max-width: 735px; margin-top: 44px; } -.routines-view .sched-card { display: flex; align-items: center; gap: 18px; height: 108px; padding: 0 22px; border: 1px dashed var(--border-pane); border-radius: 22px; background: transparent; text-align: left; white-space: normal; } +.routines-view .sched-card { display: flex; align-items: center; gap: 18px; height: 108px; padding: 0 22px; border: 1px dashed var(--border-pane); border-radius: var(--radius-md); background: transparent; text-align: left; white-space: normal; } .routines-view .sched-card:hover:not(:disabled) { border-style: solid; background: var(--bg-row-hover); } .sched-card-icon { flex: none; width: 20px; font-size: 18px; line-height: 20px; text-align: center; } .sched-card-text { min-width: 0; display: flex; flex-direction: column; gap: 5px; } @@ -42,23 +42,23 @@ .routines-header h1 { margin: 3px 0 8px; font-size: 30px; font-weight: 600; } .routines-header p { margin: 0; color: var(--text-3); max-width: 640px; line-height: 1.6; } .routines-eyebrow { font-size: 10px; letter-spacing: .16em; font-weight: 600; } -.routines-view button, .routines-view select, .routines-view input:not([type=radio]):not([type=checkbox]), .routines-view textarea { color: var(--text-1); background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: 7px; padding: 8px 11px; font: inherit; } +.routines-view button, .routines-view select, .routines-view input:not([type=radio]):not([type=checkbox]), .routines-view textarea { color: var(--text-1); background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 8px 11px; font: inherit; } .routines-view button { cursor: pointer; white-space: nowrap; } .routines-view button:hover:not(:disabled) { background: var(--bg-row-hover); border-color: var(--border-strong); } .routines-view button:disabled { opacity: .45; cursor: default; } .routines-view :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; } -.routines-error { padding: 12px 15px; border-radius: 8px; margin: 14px 0; overflow-wrap: anywhere; background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); } +.routines-error { padding: 12px 15px; border-radius: var(--radius-sm); margin: 14px 0; overflow-wrap: anywhere; background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); } .routines-error button { margin-left: 8px; font-size: 12px; padding: 4px 8px; } .routines-empty { color: var(--text-3); } .routines-section { font-size: 15px; font-weight: 600; margin: 28px 0 12px; } .routines-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } -.routine-card { display: flex; gap: 16px; justify-content: space-between; align-items: center; background: var(--bg-sidebar); border: 1px solid var(--border-pane); border-radius: 12px; padding: 14px 16px; } +.routine-card { display: flex; gap: 16px; justify-content: space-between; align-items: center; background: var(--bg-sidebar); border: 1px solid var(--border-pane); border-radius: var(--radius-md); padding: 14px 16px; } .routine-card-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .routine-card-main strong { overflow-wrap: anywhere; } .routine-card-main span { color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; } .routine-actions { display: flex; gap: 7px; flex-wrap: wrap; } .routine-actions button { font-size: 12px; padding: 6px 9px; } -.routine-editor { display: flex; flex-direction: column; gap: 14px; max-width: 720px; padding: 20px; margin: 8px 0 18px; border: 1px solid var(--border-pane); border-radius: 12px; background: var(--bg-sidebar); } +.routine-editor { display: flex; flex-direction: column; gap: 14px; max-width: 720px; padding: 20px; margin: 8px 0 18px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-sidebar); } .routine-editor label { display: flex; flex-direction: column; gap: 7px; color: var(--text-3); font-size: 12px; } .routine-editor textarea { resize: vertical; min-height: 96px; } .routine-editor fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; } @@ -85,7 +85,7 @@ .sheet[data-surface="routines"]:has(> .main.scheduled-chat) > .routines-view { grid-area: 1 / 1; grid-template-columns: 338px; } .sheet[data-surface="routines"]:has(> .main.scheduled-chat) > .routines-view.list-closed { display: none; } .scheduled-chat-header { flex: none; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px 0 22px; } -.scheduled-chat-header .sched-chat-title { display: inline-flex; align-items: center; gap: 8px; max-width: 46vw; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-1); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; } +.scheduled-chat-header .sched-chat-title { display: inline-flex; align-items: center; gap: 8px; max-width: 46vw; padding: 5px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-1); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; } .scheduled-chat-header .sched-chat-title:hover { background: var(--bg-row-hover); } .scheduled-chat-header .sched-chat-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .scheduled-chat-header .sched-chat-title .icon-svg { color: var(--text-3); } @@ -95,19 +95,19 @@ .sched-compose-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; } .sched-compose-hero h2 { margin: 12px 0 0; font-size: 17px; font-weight: 500; } .sched-compose-hero p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; } -.sched-composer { width: 100%; max-width: 768px; padding: 14px 14px 10px 18px; border: 1px solid var(--border-pane); border-radius: 24px; background: var(--bg-composer); } +.sched-composer { width: 100%; max-width: 768px; padding: 14px 14px 10px 18px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-composer); } .routines-view .sched-composer textarea { display: block; width: 100%; min-height: 48px; padding: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text-1); font: inherit; font-size: 15px; line-height: 22px; box-shadow: none; } .sched-composer-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; } -.routines-view .sched-composer select { max-width: 180px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 13px; } +.routines-view .sched-composer select { max-width: 180px; padding: 4px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font-size: 13px; } .sched-reading { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 12.5px; } -.routines-view .sched-send { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--text-1); color: var(--bg-main); } +.routines-view .sched-send { flex: none; width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm); background: var(--text-1); color: var(--bg-main); } .routines-view .sched-send:disabled { opacity: .35; } /* A task row's actions, shown on hover; and what the task wrote, beside its conversation. */ .sched-scroll li { position: relative; } .sched-row-menu { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); opacity: 0; } .sched-scroll li:hover .sched-row-menu, .sched-row-menu:focus-within, .sched-row-menu:has([aria-expanded="true"]) { opacity: 1; } -.routines-view .sched-row-menu .icon-btn { width: 26px; height: 22px; border: 0; border-radius: 7px; background: var(--bg-row-selected); color: var(--text-1); } +.routines-view .sched-row-menu .icon-btn { width: 26px; height: 22px; border: 0; border-radius: var(--radius-sm); background: var(--bg-row-selected); color: var(--text-1); } .sched-scroll li:hover .sched-row { background: var(--bg-row-hover); padding-right: 40px; } .sched-info-menu { min-width: 300px; } .sched-info-menu .sched-info-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } @@ -115,11 +115,11 @@ .sheet[data-surface="routines"]:has(> .sched-output) > .main.scheduled-chat { grid-area: 1 / 2 / 2 / 3; } .sheet > .sched-output { grid-area: 1 / 3; width: clamp(340px, 42vw, 720px); min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border-pane); background: var(--bg-window); } .sched-output-bar { flex: none; display: flex; align-items: center; gap: 6px; height: 58px; padding: 0 10px; } -.sched-output .file-pill { display: inline-flex; align-items: center; gap: 9px; max-width: 260px; height: 32px; padding: 0 13px; border: 0; border-radius: 16px; background: var(--bg-composer); color: var(--text-1); font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; } +.sched-output .file-pill { display: inline-flex; align-items: center; gap: 9px; max-width: 260px; height: 32px; padding: 0 13px; border: 0; border-radius: var(--radius-md); background: var(--bg-composer); color: var(--text-1); font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; } .sched-output-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; } -.sched-output .file-round { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--bg-composer); color: var(--text-2); } +.sched-output .file-round { flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: var(--bg-composer); color: var(--text-2); } .sched-output-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 22px 28px; } -.sched-paper { max-width: 760px; min-height: 100%; margin: 0 auto; padding: 44px 52px 60px; border-radius: 3px; background: #fff; color: #1b2230; font-size: 14px; line-height: 1.6; box-shadow: 0 10px 34px rgba(0, 0, 0, .35); --text-1: #1b2230; --text-2: #364154; --text-3: #5b6577; --text-4: #7a8394; --border-pane: #d9dee7; --bg-composer: #f2f4f7; --bg-elevated: #f2f4f7; } +.sched-paper { max-width: 760px; min-height: 100%; margin: 0 auto; padding: 44px 52px 60px; border-radius: var(--radius-xs); background: #fff; color: #1b2230; font-size: 14px; line-height: 1.6; box-shadow: 0 10px 34px rgba(0, 0, 0, .35); --text-1: #1b2230; --text-2: #364154; --text-3: #5b6577; --text-4: #7a8394; --border-pane: #d9dee7; --bg-composer: #f2f4f7; --bg-elevated: #f2f4f7; } .sched-paper h1:first-child { margin: 0 0 18px; font-size: 26px; line-height: 1.2; } .sched-paper table { font-size: 12.5px; } @media (max-width: 1100px) { .sheet > .sched-output { position: absolute; z-index: 30; inset: 0 0 0 auto; width: min(560px, 100%); } } @@ -132,13 +132,13 @@ /* Schedule a task: the task's settings as a dialog of grouped rows, each with its control at the right. */ .st-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(0, 0, 0, .5); } -.st-dialog { --st-line: color-mix(in srgb, var(--text-1) 14%, transparent); display: flex; flex-direction: column; width: 680px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); border-radius: 26px; background: var(--bg-elevated); color: var(--text-1); box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--st-line); } +.st-dialog { --st-line: color-mix(in srgb, var(--text-1) 14%, transparent); display: flex; flex-direction: column; width: 680px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-1); box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--st-line); } .st-dialog > header { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 14px; } .st-dialog h2 { margin: 0; font-size: 16px; font-weight: 600; } .routines-view .st-dialog button { font: inherit; cursor: pointer; } -.routines-view .st-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); } +.routines-view .st-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); } .st-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 4px; } -.st-text, .st-group { border: 1px solid var(--st-line); border-radius: 18px; } +.st-text, .st-group { border: 1px solid var(--st-line); border-radius: var(--radius-md); } .st-text { padding: 4px 18px 10px; } .routines-view .st-text input, .routines-view .st-text textarea { display: block; width: 100%; padding: 12px 0; border: 0; border-radius: 0; outline: 0; background: transparent; color: var(--text-1); font: inherit; font-size: 14px; line-height: 21px; resize: none; box-shadow: none; } .routines-view .st-text input { border-bottom: 1px solid var(--st-line); font-weight: 500; } @@ -146,20 +146,20 @@ .st-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; margin: 0; font-size: 14px; color: var(--text-1); } .st-group > .st-row + .st-row { border-top: 1px solid var(--st-line); } label.st-group.st-row { margin-top: 12px; background: transparent; } -.routines-view .st-row select, .routines-view .st-row input:not(.st-switch) { width: auto; max-width: 60%; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; outline: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; text-align: right; box-shadow: none; color-scheme: dark; } +.routines-view .st-row select, .routines-view .st-row input:not(.st-switch) { width: auto; max-width: 60%; height: 30px; padding: 0 6px; border: 0; border-radius: var(--radius-sm); outline: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; text-align: right; box-shadow: none; color-scheme: dark; } .routines-view .st-row select:hover, .routines-view .st-row input:not(.st-switch):hover, .routines-view .st-row :is(select, input):focus-visible { background: color-mix(in srgb, var(--text-1) 7%, transparent); color: var(--text-1); } .routines-view .st-row :is(select, input):focus-visible { box-shadow: inset 0 0 0 1px var(--accent); } .st-pair { display: inline-flex; align-items: center; gap: 4px; } .routines-view .st-pair input { width: 72px; } -.routines-view input.st-switch { appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--text-1) 18%, transparent); cursor: pointer; transition: background 140ms; } -.routines-view input.st-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 140ms; } +.routines-view input.st-switch { appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0; border: 0; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--text-1) 18%, transparent); cursor: pointer; transition: background 140ms; } +.routines-view input.st-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--radius-xs); background: #fff; transition: transform 140ms; } .routines-view input.st-switch:checked { background: var(--accent); } .routines-view input.st-switch:checked::after { transform: translateX(14px); } .routines-view .st-advanced { display: inline-flex; align-items: center; gap: 7px; margin: 14px 0 2px 8px; padding: 4px 0; border: 0; background: transparent; color: var(--text-2); font-size: 13.5px; } .st-note { margin: 12px 8px 4px; color: var(--text-3); font-size: 12px; line-height: 1.5; } .st-dialog > footer { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 20px; } -.routines-view .st-cancel { height: 34px; padding: 0 16px; border: 0; border-radius: 17px; background: transparent; color: var(--text-2); font-size: 14px; } -.routines-view .st-save { height: 34px; padding: 0 20px; border: 0; border-radius: 17px; background: var(--text-1); color: var(--bg-main); font-size: 14px; font-weight: 500; } +.routines-view .st-cancel { height: 34px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font-size: 14px; } +.routines-view .st-save { height: 34px; padding: 0 20px; border: 0; border-radius: var(--radius-sm); background: var(--text-1); color: var(--bg-main); font-size: 14px; font-weight: 500; } .routines-view .st-save:disabled { opacity: .45; } @media (prefers-reduced-motion: reduce) { .routines-view input.st-switch, .routines-view input.st-switch::after { transition: none; } } .routines-view .st-dialog .st-text input, .routines-view .st-dialog .st-text textarea { padding: 12px 0; } diff --git a/apps/desktop/src/renderer/space/knowledge.css b/apps/desktop/src/renderer/space/knowledge.css index 68fc0953..32134d9b 100644 --- a/apps/desktop/src/renderer/space/knowledge.css +++ b/apps/desktop/src/renderer/space/knowledge.css @@ -3,7 +3,7 @@ .knowledge-main { min-height: 0; overflow: hidden; container-type: inline-size; } .knowledge-maintenance { flex-shrink: 0; padding: 4px 12px 10px; border-bottom: 1px solid var(--border-pane); font-size: 11px; max-height: 220px; overflow: auto; } .knowledge-maintenance[hidden] { display: none; } -.knowledge-maintenance-toggle { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; min-height: 28px; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); font-size: 11px; } +.knowledge-maintenance-toggle { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; min-height: 28px; padding: 0 6px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-3); font-size: 11px; } .knowledge-maintenance-toggle:hover, .knowledge-maintenance-toggle[aria-expanded="true"] { background: var(--bg-row-hover); color: var(--text-1); } .knowledge-maintenance-toggle[aria-expanded="true"] svg { transform: rotate(90deg); } .knowledge-maintenance p { max-width: 760px; color: var(--text-3); line-height: 1.5; } @@ -17,10 +17,10 @@ .knowledge-status.ready::before { content: ''; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; } .knowledge-setup { flex: 1; overflow: auto; padding: clamp(28px, 5vh, 64px) clamp(24px, 5vw, 76px) 32px; } .knowledge-intro, .knowledge-folder, .knowledge-launch, .knowledge-features, .knowledge-footnote { max-width: 720px; margin-left: auto; margin-right: auto; } -.knowledge-emblem { width: 56px; height: 56px; display: grid; place-items: center; margin: 22px 0 20px; color: var(--accent); border: 1px solid var(--border-pane); border-radius: 15px; background: var(--bg-sidebar); } +.knowledge-emblem { width: 56px; height: 56px; display: grid; place-items: center; margin: 22px 0 20px; color: var(--accent); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-sidebar); } .knowledge-intro h1 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; line-height: 1.15; font-weight: 600; margin: 0 0 14px; } .knowledge-intro p { color: var(--text-3); font-size: 14px; line-height: 1.7; margin: 0 0 30px; } -.knowledge-folder { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--border-pane); border-radius: 12px; background: var(--bg-sidebar); } +.knowledge-folder { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-sidebar); } .knowledge-folder-icon { color: var(--text-3); flex: none; } .knowledge-folder > div:nth-child(2) { flex: 1; min-width: 0; } .knowledge-folder strong { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } diff --git a/apps/desktop/src/renderer/space/space.css b/apps/desktop/src/renderer/space/space.css index 2daee0eb..40c0566d 100644 --- a/apps/desktop/src/renderer/space/space.css +++ b/apps/desktop/src/renderer/space/space.css @@ -9,14 +9,14 @@ .space-sidebar-title strong { font-weight: 600; letter-spacing: -.3px; } .space-sidebar-options { position: relative; } .space-sidebar-options .menu { z-index: 55; min-width: 200px; } -.space-new-page { display: flex; align-items: center; gap: 10px; flex: none; height: 30px; padding: 0 8px; margin: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--text-2); text-align: left; font-size: 14px; } +.space-new-page { display: flex; align-items: center; gap: 10px; flex: none; height: 30px; padding: 0 8px; margin: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-2); text-align: left; font-size: 14px; } .space-new-page:hover { background: var(--bg-row-hover); } -.space-search { display: flex; gap: 8px; align-items: center; background: var(--bg-main); border: 1px solid var(--border-pane); border-radius: 8px; padding: 7px 9px; margin: 8px 8px 0; color: var(--text-3); } +.space-search { display: flex; gap: 8px; align-items: center; background: var(--bg-main); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 7px 9px; margin: 8px 8px 0; color: var(--text-3); } .space-search:focus-within { border-color: var(--accent); } .space-search input { background: none; border: 0; min-width: 0; width: 100%; outline: none; font-size: 13px; } .space-search input::placeholder { color: var(--text-4); } .space-views { display: grid; gap: 1px; margin: 9px 8px 20px; } -.space-views button, .space-sidebar-footer button { display: flex; align-items: center; gap: 10px; height: 30px; border: 0; border-radius: 9px; background: none; padding: 0 8px; text-align: left; color: var(--text-2); font-size: 14px; } +.space-views button, .space-sidebar-footer button { display: flex; align-items: center; gap: 10px; height: 30px; border: 0; border-radius: var(--radius-sm); background: none; padding: 0 8px; text-align: left; color: var(--text-2); font-size: 14px; } .space-views button:hover, .space-sidebar-footer button:hover { background: var(--bg-row-hover); } .space-views button[aria-current], .space-sidebar-footer button[aria-current] { background: var(--bg-row-selected); color: var(--text-1); } .space-tree-label { color: var(--text-4); font-size: 14px; padding: 0 8px; margin: 0 0 9px; } @@ -24,10 +24,10 @@ .space-tree { flex: 1; overflow: auto; min-height: 0; padding: 0 8px; } .space-tree ul { margin: 0; padding: 0; list-style: none; } .space-tree ul ul { padding-left: 14px; } -.space-tree-row { position: relative; display: flex; align-items: center; border-radius: 9px; } +.space-tree-row { position: relative; display: flex; align-items: center; border-radius: var(--radius-sm); } .space-tree-row:hover { background: var(--bg-row-hover); } .space-tree-row.selected { background: var(--bg-row-selected); } -.space-tree-page { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; height: 30px; padding: 0 8px; background: none; border: none; border-radius: 9px; text-align: left; font-size: 14px; color: var(--text-2); } +.space-tree-page { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; height: 30px; padding: 0 8px; background: none; border: none; border-radius: var(--radius-sm); text-align: left; font-size: 14px; color: var(--text-2); } .space-tree-page > svg { flex: none; color: var(--text-3); } .space-tree-page[aria-current] { color: var(--text-1); } .space-tree-page span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } @@ -39,35 +39,35 @@ .space-sidebar-footer { display: grid; flex: none; padding: 0 8px; margin-top: 14px; } .space-main { container-type: inline-size; container-name: space-main; flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-main); position: relative; } .space-topbar { display: flex; align-items: center; gap: 4px; flex: none; padding: 0 8px; } -.space-page-pill, .space-share { display: flex; align-items: center; border: 0; border-radius: 20px; background: var(--bg-elevated); color: var(--text-2); } +.space-page-pill, .space-share { display: flex; align-items: center; border: 0; border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-2); } .space-page-pill > span { min-width: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .space-page-pill > svg { flex: none; } .space-page-menu, .space-share-anchor, .space-insert-anchor { position: relative; min-width: 0; } .space-page-menu { flex-shrink: 1; } .space-page-menu .menu { left: 0; right: auto; min-width: 210px; z-index: 50; } -.space-tools { display: flex; flex: none; align-items: center; gap: 2px; margin-left: 2px; border-radius: 20px; background: var(--bg-elevated); } -.space-tools .icon-btn { border-radius: 50%; } -.space-round-action.icon-btn { background: var(--bg-elevated); border-radius: 50%; } +.space-tools { display: flex; flex: none; align-items: center; gap: 2px; margin-left: 2px; border-radius: var(--radius-md); background: var(--bg-elevated); } +.space-tools .icon-btn { border-radius: var(--radius-sm); } +.space-round-action.icon-btn { background: var(--bg-elevated); border-radius: var(--radius-sm); } .space-round-action[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-main)); } -.space-avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: #f79583; color: #fff; font-size: 11px; } +.space-avatar { width: 24px; height: 24px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; flex: none; background: #f79583; color: #fff; font-size: 11px; } .space-share { padding-left: 5px; gap: 12px; } .space-share-anchor .menu { min-width: 240px; z-index: 50; } .space-save { font-size: 11px; color: var(--text-4); white-space: nowrap; margin: 0 8px; opacity: 0; } .space-topbar:hover .space-save, .space-save.failed { opacity: 1; } .space-save.failed { color: var(--danger-text); } .space-starred { color: var(--accent); } -.space-insert-menu { max-height: 330px; overflow: auto; padding: 6px; border-radius: 18px; z-index: 50; background: var(--bg-elevated); border-color: var(--border-pane); box-shadow: 0 8px 30px #0002; scrollbar-width: thin; scrollbar-color: var(--bg-row-hover) transparent; } +.space-insert-menu { max-height: 330px; overflow: auto; padding: 6px; border-radius: var(--radius-md); z-index: 50; background: var(--bg-elevated); border-color: var(--border-pane); box-shadow: 0 8px 30px #0002; scrollbar-width: thin; scrollbar-color: var(--bg-row-hover) transparent; } .space-insert-menu .menu-label { text-transform: none; font: 13px/20px var(--font-sans); letter-spacing: 0; color: var(--text-4); } -.space-insert-menu .menu-item { display: flex; align-items: center; gap: 8px; min-height: 29px; padding: 4px 6px; border-radius: 16px; font-size: 13px; } +.space-insert-menu .menu-item { display: flex; align-items: center; gap: 8px; min-height: 29px; padding: 4px 6px; border-radius: var(--radius-md); font-size: 13px; } .space-insert-menu small { color: var(--text-4); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .space-insert-symbol { width: 16px; flex: none; font-size: 11px; color: var(--text-3); } .space-new { display: flex; align-items: center; gap: 5px; } .space-breadcrumb { display: flex; align-items: center; gap: 8px; } .space-breadcrumb button { border: 0; background: none; color: var(--text-3); } .space-page-body { flex: 1; min-height: 0; min-width: 0; display: flex; } -.space-error { margin: 12px 24px 0; padding: 12px 14px; background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: 8px; color: var(--danger-text); display: flex; gap: 12px; align-items: center; } +.space-error { margin: 12px 24px 0; padding: 12px 14px; background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: var(--radius-sm); color: var(--danger-text); display: flex; gap: 12px; align-items: center; } .space-error span { flex: 1; } -.space-notice { position: absolute; z-index: 10; right: 24px; top: 66px; padding: 9px 14px; background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: 8px; box-shadow: 0 4px 16px #0003; font-size: 12px; } +.space-notice { position: absolute; z-index: 10; right: 24px; top: 66px; padding: 9px 14px; background: var(--bg-elevated); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); box-shadow: 0 4px 16px #0003; font-size: 12px; } .space-loading { margin: auto; color: var(--text-3); } .space-document-scroll { overflow: auto; flex: 1; min-width: 0; min-height: 0; scroll-padding-bottom: 220px; } .space-document { width: min(100%, 840px); margin: 0 auto; padding: 28px 48px 100px; } @@ -75,24 +75,24 @@ .space-page-emblem { color: var(--text-3); margin: 0 0 24px 3px; } .space-title { display: block; width: 100%; background: none; border: 0; outline: none; padding: 0; font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: 0; color: var(--text-1); } .space-title::placeholder { color: var(--text-4); opacity: .7; } -.space-title:focus-visible { outline-offset: 7px; border-radius: 3px; } +.space-title:focus-visible { outline-offset: 7px; border-radius: var(--radius-xs); } .space-document-meta { display: flex; align-items: center; gap: 9px; margin: 15px 0 35px; font-size: 11px; color: var(--text-4); } .space-editor { position: relative; } -.space-format-bar { position: absolute; left: 0; display: flex; align-items: center; gap: 3px; margin: 0; border: 1px solid var(--border-pane); border-radius: 20px; background: var(--bg-elevated); padding: 4px; z-index: 10; box-shadow: 0 4px 16px #0002; } +.space-format-bar { position: absolute; left: 0; display: flex; align-items: center; gap: 3px; margin: 0; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); padding: 4px; z-index: 10; box-shadow: 0 4px 16px #0002; } .space-editor.is-editing .space-format-bar, .space-format-bar:focus-within { visibility: visible; } -.space-format-bar button { width: 28px; height: 28px; border-radius: 5px; border: 0; background: none; color: var(--text-3); } +.space-format-bar button { width: 28px; height: 28px; border-radius: var(--radius-xs); border: 0; background: none; color: var(--text-3); } .space-format-bar button:hover:enabled { background: var(--bg-row-hover); color: var(--text-1); } .space-format-bar > span:first-of-type { flex: 1; } .space-writing-hint { font-size: 10px; color: var(--text-4); } -.space-writing-hint kbd { font: 10px var(--font-mono); background: var(--bg-row-hover); border-radius: 3px; padding: 1px 4px; } +.space-writing-hint kbd { font: 10px var(--font-mono); background: var(--bg-row-hover); border-radius: var(--radius-xs); padding: 1px 4px; } .space-block { position: relative; min-height: 34px; margin: 0; } .space-block-tools { position: absolute; left: -48px; top: 5px; display: flex; align-items: center; opacity: 0; transition: opacity 120ms; } .space-block:is(:hover, :focus-within) .space-block-tools { opacity: 1; } .space-block-tools:has(details[open]) { opacity: 1; z-index: 11; } -.space-block-actions summary { width: 22px; height: 24px; display: grid; place-items: center; color: var(--text-4); font-size: 18px; cursor: pointer; list-style: none; border-radius: 5px; } +.space-block-actions summary { width: 22px; height: 24px; display: grid; place-items: center; color: var(--text-4); font-size: 18px; cursor: pointer; list-style: none; border-radius: var(--radius-xs); } .space-block-actions summary::-webkit-details-marker { display: none; } -.space-block-popover { display: grid; position: absolute; left: 0; top: 28px; width: 164px; padding: 5px; border: 1px solid var(--border-pane); border-radius: 10px; background: var(--bg-elevated); box-shadow: 0 8px 28px #0004; } -.space-block-popover button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 5px; font-size: 12px; } +.space-block-popover { display: grid; position: absolute; left: 0; top: 28px; width: 164px; padding: 5px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-elevated); box-shadow: 0 8px 28px #0004; } +.space-block-popover button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: var(--radius-xs); font-size: 12px; } .space-block-popover button:hover { background: var(--bg-row-hover); } .space-block-input { display: block; width: 100%; min-height: 34px; resize: none; overflow: hidden; border: 0; background: transparent; outline: none; padding: 5px 0; color: var(--text-2); font-size: 14px; line-height: 1.75; letter-spacing: -.1px; } .space-block-input::placeholder { color: var(--text-4); } @@ -102,7 +102,7 @@ .space-block-input.heading-2 { font-size: 18px; font-weight: 600; line-height: 1.4; } .space-block-input.heading-3 { font-size: 19px; font-weight: 600; line-height: 1.4; } .space-block-input.code { font: 13px/1.7 var(--font-mono); } -.space-block-preview { min-height: 34px; padding: 5px 0; border-radius: 3px; font-size: 14px; line-height: 1.75; color: var(--text-2); overflow-wrap: anywhere; cursor: text; } +.space-block-preview { min-height: 34px; padding: 5px 0; border-radius: var(--radius-xs); font-size: 14px; line-height: 1.75; color: var(--text-2); overflow-wrap: anywhere; cursor: text; } .space-block-preview p { margin: 0; } .space-block-preview :is(h1,h2,h3,h4,h5,h6) { color: var(--text-1); letter-spacing: 0; font-weight: 600; line-height: 1.4; margin: 18px 0 0; } .space-block-preview h1 { font-size: 30px; } @@ -111,13 +111,13 @@ .space-block-preview :is(ul,ol) { margin: 0; padding-left: 24px; } .space-block-preview li { padding: 2px 0; } .space-block-preview blockquote { border-left: 2px solid var(--accent); padding: 5px 18px; margin: 4px 0; color: var(--text-2); font-size: 17px; } -.space-block-preview pre { padding: 16px 18px; border: 1px solid var(--border-pane); border-radius: 8px; background: var(--bg-sidebar); overflow: auto; } -.space-block-preview code { font-size: 12px; background: var(--bg-row-hover); padding: 2px 4px; border-radius: 4px; } +.space-block-preview pre { padding: 16px 18px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-sidebar); overflow: auto; } +.space-block-preview code { font-size: 12px; background: var(--bg-row-hover); padding: 2px 4px; border-radius: var(--radius-xs); } .space-block-preview pre code { background: none; padding: 0; } .space-block-preview table { border-collapse: collapse; width: 100%; font-size: 13px; } .space-block-preview :is(th,td) { border: 1px solid var(--border-pane); padding: 8px 12px; text-align: left; } .space-block-preview th { background: var(--bg-sidebar); font-weight: 600; } -.space-block-preview img { max-width: 100%; max-height: 480px; border-radius: 8px; outline: 1px solid light-dark(#0000001a, #ffffff1a); } +.space-block-preview img { max-width: 100%; max-height: 480px; border-radius: var(--radius-sm); outline: 1px solid light-dark(#0000001a, #ffffff1a); } .space-block-preview figure { margin: 10px 0; } .space-block-preview figcaption { text-align: center; color: var(--text-4); font-size: 12px; } .space-block-preview hr { border: 0; border-top: 1px solid var(--border-pane); margin: 18px 0; } @@ -125,17 +125,17 @@ .space-check { display: flex; align-items: baseline; cursor: pointer; } .space-check input { accent-color: var(--accent); flex-shrink: 0; } .space-check input:checked + span { text-decoration: line-through; color: var(--text-4); } -.space-callout { border-radius: 8px; padding: 16px; background: var(--bg-composer-context); border-left: 3px solid var(--accent); } -.space-slash { position: absolute; left: 0; top: 100%; z-index: 20; width: min(330px, 100%); max-height: 338px; overflow: auto; padding: 6px; border: 1px solid var(--border-pane); border-radius: 14px; background: var(--bg-row-hover); box-shadow: 0 8px 12px #0002, 0 24px 50px #0004; } +.space-callout { border-radius: var(--radius-sm); padding: 16px; background: var(--bg-composer-context); border-left: 3px solid var(--accent); } +.space-slash { position: absolute; left: 0; top: 100%; z-index: 20; width: min(330px, 100%); max-height: 338px; overflow: auto; padding: 6px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-row-hover); box-shadow: 0 8px 12px #0002, 0 24px 50px #0004; } .space-slash-heading { display: flex; justify-content: space-between; font: 9px var(--font-mono); letter-spacing: .05em; color: var(--text-4); padding: 10px 8px; } .space-slash-heading span { font-family: var(--font-sans); letter-spacing: 0; } -.space-slash > button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; border-radius: 7px; padding: 8px; text-align: left; } +.space-slash > button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; border-radius: var(--radius-sm); padding: 8px; text-align: left; } .space-slash > button[aria-selected="true"], .space-slash > button:hover { background: var(--bg-row-selected); } -.space-command-symbol { display: grid; place-items: center; width: 34px; height: 34px; background: var(--bg-main); border: 1px solid var(--border-pane); border-radius: 6px; color: var(--text-2); font: 14px var(--font-mono); } +.space-command-symbol { display: grid; place-items: center; width: 34px; height: 34px; background: var(--bg-main); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); color: var(--text-2); font: 14px var(--font-mono); } .space-slash strong { display: block; font-size: 12px; font-weight: 500; } .space-slash small { color: var(--text-3); font-size: 10px; } .space-slash p { color: var(--text-3); font-size: 12px; padding: 8px; } -.space-add-block { opacity: 0; display: flex; align-items: center; gap: 7px; margin: 18px 0 0; border: 0; border-radius: 5px; padding: 6px 0; background: none; color: var(--text-4); font-size: 12px; } +.space-add-block { opacity: 0; display: flex; align-items: center; gap: 7px; margin: 18px 0 0; border: 0; border-radius: var(--radius-xs); padding: 6px 0; background: none; color: var(--text-4); font-size: 12px; } .space-editor:is(:hover, :focus-within) .space-add-block { opacity: 1; } .space-add-block:hover { color: var(--accent); } .space-add-block > span { font-size: 17px; } @@ -194,7 +194,7 @@ .pages-maintenance summary { cursor: pointer; } .pages-maintenance p { color: var(--text-3); max-width: 70ch; } .pages-maintenance label { display: inline-flex; align-items: center; gap: 8px; margin: 6px 20px 6px 0; } -.pages-history { border: 1px solid var(--border-pane); border-radius: 8px; padding: 16px; margin-bottom: 24px; } +.pages-history { border: 1px solid var(--border-pane); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 24px; } .pages-history > div { display: flex; justify-content: space-between; align-items: center; } .pages-history details { padding: 10px 0; } .pages-history summary { cursor: pointer; font-size: 12px; } @@ -209,29 +209,29 @@ .task-view-answer { margin: 0; white-space: pre-wrap; } .task-view-proposed { margin: 8px 0 0; white-space: pre-wrap; font: inherit; } -.space-comments { flex: none; display: flex; flex-direction: column; position: relative; width: 298px; max-width: 42%; min-height: 0; margin: 0 8px 8px; border-radius: 16px; background: var(--bg-elevated); color: var(--text-2); overflow: hidden; padding-bottom: 60px; } +.space-comments { flex: none; display: flex; flex-direction: column; position: relative; width: 298px; max-width: 42%; min-height: 0; margin: 0 8px 8px; border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-2); overflow: hidden; padding-bottom: 60px; } .space-comments > header { display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 10px 0 16px; flex: none; } .space-comments h2 { margin: 0; font-size: 14px; font-weight: 600; } -.space-comments > header .icon-btn { background: var(--bg-row-hover); border-radius: 50%; } +.space-comments > header .icon-btn { background: var(--bg-row-hover); border-radius: var(--radius-sm); } .space-comments-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 16px; } .space-comments-empty { padding-top: 110px; display: flex; flex-direction: column; align-items: center; color: var(--text-3); font-size: 14px; } .space-comments-empty svg { margin-bottom: 10px; } .space-comments-empty p { margin: 5px 0 0; } .space-comments footer { display: flex; justify-content: flex-end; padding: 8px; } -.space-comments footer .icon-btn.lg { border: 1px solid var(--border-pane); border-radius: 50%; } +.space-comments footer .icon-btn.lg { border: 1px solid var(--border-pane); border-radius: var(--radius-sm); } .space-comment { padding: 14px 0; border-bottom: 1px solid var(--border-pane); font-size: 13px; overflow-wrap: anywhere; } .space-comment-author { display: flex; align-items: center; gap: 7px; font-size: 12px; } .space-comment-author time { margin-left: auto; font-size: 11px; color: var(--text-4); } .space-comment p { white-space: pre-wrap; margin: 10px 0 0; } .space-comments blockquote { margin: 12px 0 0; padding-left: 10px; border-left: 2px solid var(--accent); color: var(--text-3); font-size: 12px; max-height: 100px; overflow: auto; } -.space-comment-form { margin: 8px; border: 1px solid var(--border-pane); border-radius: 14px; background: var(--bg-row-hover); } +.space-comment-form { margin: 8px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-row-hover); } .space-comment-form textarea { width: 100%; max-height: 120px; border: 0; background: none; outline: none; font-size: 13px; } .space-comment-form > div { display: flex; align-items: center; } .space-comment-form > div > span { margin-right: auto; font-size: 10px; color: var(--text-4); } .space-comment-error { padding: 0 16px; color: var(--danger-text); font-size: 12px; } -.space-chat-launcher { position: absolute; right: 8px; bottom: 10px; z-index: 12; display: flex; align-items: center; width: min(560px, calc(100% - 16px)); height: 44px; padding: 0 8px 0 16px; border: 0; border-radius: 24px; color: var(--text-3); background: var(--bg-elevated); text-align: left; } +.space-chat-launcher { position: absolute; right: 8px; bottom: 10px; z-index: 12; display: flex; align-items: center; width: min(560px, calc(100% - 16px)); height: 44px; padding: 0 8px 0 16px; border: 0; border-radius: var(--radius-md); color: var(--text-3); background: var(--bg-elevated); text-align: left; } .space-chat-launcher > span { flex: 1; } -.space-chat-launcher .space-chat-send { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--text-1); color: var(--bg-main); } +.space-chat-launcher .space-chat-send { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--text-1); color: var(--bg-main); } @media (max-width: 1200px) { .space-page-body:has(.space-comments) .space-document { padding: 32px 48px 100px; } .space-save { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); } @@ -247,9 +247,9 @@ .space-page-pill > span { max-width: 100px; } } -.space-comment-start { display: flex; align-items: center; gap: 8px; margin: 6px 8px 8px; padding: 8px 10px; border: 1px solid var(--border-pane); border-radius: 14px; background: var(--bg-row-hover); color: var(--text-4); text-align: left; font-size: 13px; } +.space-comment-start { display: flex; align-items: center; gap: 8px; margin: 6px 8px 8px; padding: 8px 10px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-row-hover); color: var(--text-4); text-align: left; font-size: 13px; } .space-comment-start span { flex: 1; } -.space-comment-start svg { border-radius: 50%; background: var(--text-4); color: var(--bg-elevated); padding: 3px; width: 22px; height: 22px; } +.space-comment-start svg { border-radius: var(--radius-xs); background: var(--text-4); color: var(--bg-elevated); padding: 3px; width: 22px; height: 22px; } .space-comment-form > div { justify-content: flex-end; } @container space-main (max-width: 700px) { .space-document, .space-page-body:has(.space-comments) .space-document { padding: 24px 24px 100px; } @@ -276,42 +276,42 @@ .space-title { margin-bottom: 11px; } .space-document { padding-top: 24px; } .space-check { gap: 8px; } -.space-check input { appearance: none; position: relative; width: 14px; height: 14px; margin: 0; border: 1px solid var(--text-4); border-radius: 3px; background: transparent; transform: translateY(2px); } +.space-check input { appearance: none; position: relative; width: 14px; height: 14px; margin: 0; border: 1px solid var(--text-4); border-radius: var(--radius-xs); background: transparent; transform: translateY(2px); } .space-check input:checked { background: var(--accent); border-color: var(--accent); } .space-check input:checked::after { content: ''; position: absolute; left: 3px; top: 1px; width: 4px; height: 7px; border: solid var(--bg-main); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); } -.space-insert-menu, .space-actions-menu { border: 1px solid var(--border-pane); border-radius: 16px; background: var(--bg-elevated); box-shadow: 0 8px 24px #0002; padding: 6px; max-height: min(330px, calc(100vh - 110px)); overflow: auto; scrollbar-width: thin; } +.space-insert-menu, .space-actions-menu { border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); box-shadow: 0 8px 24px #0002; padding: 6px; max-height: min(330px, calc(100vh - 110px)); overflow: auto; scrollbar-width: thin; } .space-insert-menu { width: 360px; } -.space-insert-menu .menu-item, .space-actions-menu .menu-item { min-height: 28px; padding: 4px 7px; font-size: 13px; border-radius: 14px; gap: 8px; } +.space-insert-menu .menu-item, .space-actions-menu .menu-item { min-height: 28px; padding: 4px 7px; font-size: 13px; border-radius: var(--radius-md); gap: 8px; } .space-insert-menu small { font-size: 13px; } .space-insert-menu .menu-label { font-size: 12px; padding: 3px 6px; } .space-actions-menu { width: 220px; } .space-actions-menu .menu-item { display: flex; align-items: center; } .space-actions-menu .menu-item svg { width: 14px; height: 14px; color: var(--text-3); flex: none; } .space-actions-menu .menu-separator { margin: 5px; } -.space-generation { position: relative; display: grid; place-items: center; min-height: 124px; margin: 10px 0 32px; border: 2px solid var(--border-strong); border-radius: 7px; color: var(--text-4); } +.space-generation { position: relative; display: grid; place-items: center; min-height: 124px; margin: 10px 0 32px; border: 2px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-4); } .space-generation-visualize { background: var(--bg-composer); } .space-generation > .tooltip-anchor { position: absolute; top: 4px; right: 4px; } -.space-generation form { position: absolute; display: flex; align-items: center; gap: 6px; width: min(380px, calc(100% - 32px)); bottom: -12px; padding: 4px; border: 1px solid var(--border-pane); border-radius: 22px; background: var(--bg-elevated); } +.space-generation form { position: absolute; display: flex; align-items: center; gap: 6px; width: min(380px, calc(100% - 32px)); bottom: -12px; padding: 4px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); } .space-generation input { border: 0; background: transparent; outline: none; min-width: 0; flex: 1; padding: 4px 8px; font-size: 12px; } -.space-generation form button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--text-3); color: var(--bg-main); display: grid; place-items: center; flex: none; } +.space-generation form button { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 0; background: var(--text-3); color: var(--bg-main); display: grid; place-items: center; flex: none; } .space-generation-lines { width: 100%; padding: 14px; } -.space-generation-lines i { display: block; height: 12px; border-radius: 5px; margin: 7px 0; background: var(--bg-window); width: 68%; } +.space-generation-lines i { display: block; height: 12px; border-radius: var(--radius-xs); margin: 7px 0; background: var(--bg-window); width: 68%; } .space-generation-lines i:nth-child(2) { width: 84%; } .space-generation-lines i:nth-child(3) { width: 60%; } .space-overview-topbar { display: none; } .space-overview { width: 100%; max-width: 1120px; padding: 24px 48px 90px; } .space-overview-heading { display: flex; align-items: center; gap: 12px; } .space-overview-heading h1 { flex: 1; font-size: 24px; letter-spacing: -.02em; } -.space-overview-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-pane); border-radius: 20px; padding: 7px 12px; width: 240px; color: var(--text-4); } +.space-overview-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); padding: 7px 12px; width: 240px; color: var(--text-4); } .space-overview-search input { border: 0; background: transparent; min-width: 0; width: 100%; font-size: 12px; outline: none; } -.space-overview-new { display: flex; align-items: center; gap: 12px; padding: 7px 16px; border: 0; border-radius: 20px; background: var(--text-1); color: var(--bg-main); font-size: 12px; } +.space-overview-new { display: flex; align-items: center; gap: 12px; padding: 7px 16px; border: 0; border-radius: var(--radius-md); background: var(--text-1); color: var(--bg-main); font-size: 12px; } .space-overview-tabs { display: flex; gap: 6px; margin: 22px 0 32px; } -.space-overview-tabs button { border: 0; background: none; color: var(--text-3); padding: 9px 16px; border-radius: 22px; font-size: 12px; } +.space-overview-tabs button { border: 0; background: none; color: var(--text-3); padding: 9px 16px; border-radius: var(--radius-md); font-size: 12px; } .space-overview-tabs button[aria-current] { background: var(--bg-elevated); color: var(--text-1); } .space-template-heading h2 { margin: 0; font-size: 16px; font-weight: 500; } .space-template-heading p { margin: 5px 0 20px; font-size: 13px; color: var(--text-4); } .space-templates { display: flex; gap: 12px; overflow-x: auto; padding: 3px 3px 10px; margin-bottom: 38px; } -.space-templates button { display: flex; flex: 0 0 180px; height: 82px; padding: 14px; border-radius: 16px; background: var(--bg-composer); } +.space-templates button { display: flex; flex: 0 0 180px; height: 82px; padding: 14px; border-radius: var(--radius-md); background: var(--bg-composer); } .space-templates button > svg:first-child { width: 18px; height: 18px; margin-bottom: 12px; color: #9facf0; } .space-templates button:nth-child(2) > svg:first-child { color: #dc7854; } .space-templates button:nth-child(3) > svg:first-child { color: #78bda7; } @@ -342,7 +342,7 @@ .space-comment-form textarea { min-height: 24px; padding: 3px 0; resize: vertical; } .space-comment-form blockquote { grid-column: 1 / -1; margin: 3px 0 5px; } .space-comment-form > div { gap: 3px; } -.space-comment-discard, .space-comment-submit { width: 22px; height: 22px; border: 0; border-radius: 50%; display: grid; place-items: center; padding: 0; } +.space-comment-discard, .space-comment-submit { width: 22px; height: 22px; border: 0; border-radius: var(--radius-sm); display: grid; place-items: center; padding: 0; } .space-comment-discard { background: transparent; color: var(--text-3); } .space-comment-submit { background: var(--text-3); color: var(--bg-main); } @@ -352,25 +352,25 @@ .space-comment-form:has(textarea:focus-visible), .space-format-bar:has(.space-selection-prompt input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; } .space-chat-launcher { gap: 8px; padding-left: 8px; } -.space-chat-launcher > button { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); } +.space-chat-launcher > button { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); } .space-chat-launcher input { flex: 1; min-width: 0; padding: 4px 0; border: 0; background: transparent; font-size: 13px; } .space-chat-launcher input::placeholder { color: var(--text-4); } .space-surface .space-chat-launcher input:focus-visible { outline: none; } .space-chat-launcher:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; } -.space-format-bar > .space-selection-action:last-child { background: var(--bg-row-hover); border-radius: 16px; } +.space-format-bar > .space-selection-action:last-child { background: var(--bg-row-hover); border-radius: var(--radius-md); } .space-new-anchor { position: relative; } .space-new-anchor .menu { min-width: 190px; z-index: 20; } .space-overview-tabs { align-items: center; } -.space-overview-tabs .icon-btn { padding: 0; width: 32px; height: 32px; border-radius: 50%; } +.space-overview-tabs .icon-btn { padding: 0; width: 32px; height: 32px; border-radius: var(--radius-sm); } .space-overview-tabs .icon-btn[aria-pressed="true"] { background: var(--bg-elevated); color: var(--text-2); } .space-page-list-row > button:first-child { display: grid; grid-template-columns: minmax(0, 1fr) 30% 28%; gap: 0; } .space-page-list-row .space-list-name { display: flex; align-items: center; gap: 12px; } -.space-page-list-row .space-list-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--border-pane); border-radius: 10px; } +.space-page-list-row .space-list-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); } .space-list-icon svg { color: #9facf0; } .space-page-list-row .space-page-source, .space-page-list-row time { width: auto; margin: 0; text-align: left; } .space-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; } -.space-page-grid .space-page-list-row { border: 1px solid var(--border-pane); border-radius: 14px; overflow: hidden; flex-direction: column; align-items: stretch; } +.space-page-grid .space-page-list-row { border: 1px solid var(--border-pane); border-radius: var(--radius-md); overflow: hidden; flex-direction: column; align-items: stretch; } .space-page-grid .space-page-list-row > button:first-child { display: flex; flex-direction: column; align-items: start; gap: 10px; padding: 16px; } .space-page-grid .space-list-name { width: 100%; } @container space-main (max-width: 600px) { @@ -399,14 +399,14 @@ .space-templates button { flex-basis: 182px; } .space-templates button strong { font-size: 14px; } .space-templates .space-template-guide { border-color: color-mix(in srgb, var(--accent) 50%, var(--border-pane)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 14%, transparent); } -.space-insert-menu kbd { margin-left: auto; max-width: 40px; overflow: hidden; text-overflow: ellipsis; border-radius: 8px; padding: 0 5px; background: var(--bg-row-hover); color: var(--text-4); font: 11px/16px var(--font-sans); } +.space-insert-menu kbd { margin-left: auto; max-width: 40px; overflow: hidden; text-overflow: ellipsis; border-radius: var(--radius-sm); padding: 0 5px; background: var(--bg-row-hover); color: var(--text-4); font: 11px/16px var(--font-sans); } .space-actions-menu { scrollbar-color: var(--bg-row-hover) transparent; } /* The notes tree (NotesTree.tsx): a row's menu shows on hover or focus; names are edited in place. */ .notes-tree { margin: 0; padding: 0; list-style: none; } .space-tree-menu { flex: none; opacity: 0; } .space-tree-row:hover .space-tree-menu, .space-tree-menu:focus-within, .space-tree-menu [aria-expanded="true"] { opacity: 1; } .space-tree-row:has(.space-tree-menu [aria-expanded="true"]) .space-tree-menu { opacity: 1; } -.space-tree-edit { flex: 1; min-width: 0; height: 28px; margin: 1px 4px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text-1); background: var(--bg-input, var(--bg-main)); border: 1px solid var(--accent, var(--border-pane)); border-radius: 8px; outline: none; } +.space-tree-edit { flex: 1; min-width: 0; height: 28px; margin: 1px 4px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--text-1); background: var(--bg-input, var(--bg-main)); border: 1px solid var(--accent, var(--border-pane)); border-radius: var(--radius-sm); outline: none; } /* A file's preview (FilePreview.tsx). */ .notes-file-preview { width: min(880px, calc(100vw - 80px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; padding: 14px 16px; } .notes-file-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; } @@ -414,7 +414,7 @@ .notes-file-size { color: var(--text-3); font-size: 12px; } .notes-file-body { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; } .notes-file-body img { max-width: 100%; max-height: 70vh; object-fit: contain; } -.notes-file-body pre { place-self: stretch; margin: 0; padding: 12px; white-space: pre-wrap; font-size: 12.5px; background: var(--bg-main); border-radius: 8px; } +.notes-file-body pre { place-self: stretch; margin: 0; padding: 12px; white-space: pre-wrap; font-size: 12.5px; background: var(--bg-main); border-radius: var(--radius-sm); } .notes-file-none { color: var(--text-3); } /* Space, second pass: a quieter title, Create, Recents above the tree, and template cards that preview the page. */ @@ -430,10 +430,10 @@ .space-templates { gap: 18px; } .space-templates button, .space-templates .space-template-guide { flex: 0 0 274px; flex-direction: column; align-items: center; height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; text-align: center; } .space-templates button:hover { background: none; } -.space-templates button .space-template-preview { position: static; clip-path: none; display: block; width: 100%; height: 152px; margin-bottom: 14px; padding: 22px 26px 0; overflow: hidden; border: 1px solid var(--border-pane); border-radius: 16px; background: var(--bg-main); transition: border-color 120ms; } +.space-templates button .space-template-preview { position: static; clip-path: none; display: block; width: 100%; height: 152px; margin-bottom: 14px; padding: 22px 26px 0; overflow: hidden; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-main); transition: border-color 120ms; } .space-templates button:hover .space-template-preview { border-color: var(--border-strong); } .space-templates .space-template-guide .space-template-preview { border-color: color-mix(in srgb, var(--accent) 50%, var(--border-pane)); } -.space-templates button .space-template-sheet { position: static; display: flex; flex-direction: column; gap: 5px; width: auto; height: 100%; margin: 0; padding: 16px 16px 0; clip-path: none; overflow: hidden; border: 1px solid var(--border-pane); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--bg-composer); text-align: left; } +.space-templates button .space-template-sheet { position: static; display: flex; flex-direction: column; gap: 5px; width: auto; height: 100%; margin: 0; padding: 16px 16px 0; clip-path: none; overflow: hidden; border: 1px solid var(--border-pane); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--bg-composer); text-align: left; } .space-templates button .space-template-sheet > svg { display: block; flex: none; width: 18px; height: 18px; margin: 0 0 6px; color: #5aa7f0; } .space-templates button:nth-child(2) .space-template-sheet > svg { color: #dc7854; } .space-templates button:nth-child(3) .space-template-sheet > svg { color: #78bda7; } @@ -456,12 +456,12 @@ .space-block .space-block-input:is(:focus, :focus-visible) { outline: none; border: 0; box-shadow: none; } /* The page's Insert menu: 350 wide, 36 px rows, a name and its muted description on one line. */ -.menu.space-insert-menu { width: 376px; max-height: min(430px, calc(100vh - 110px)); padding: 8px 9px; border-radius: 20px; border-color: color-mix(in srgb, var(--text-1) 12%, transparent); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); } +.menu.space-insert-menu { width: 376px; max-height: min(430px, calc(100vh - 110px)); padding: 8px 9px; border-radius: var(--radius-md); border-color: color-mix(in srgb, var(--text-1) 12%, transparent); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); } .menu.space-insert-menu .menu-label { height: 30px; padding: 0 9px; display: flex; align-items: center; color: var(--text-3); font-size: 13.5px; line-height: 1; } -.menu.space-insert-menu .menu-item { min-height: 36px; padding: 0 9px; gap: 10px; border-radius: 12px; color: var(--text-1); font-size: 14.5px; } +.menu.space-insert-menu .menu-item { min-height: 36px; padding: 0 9px; gap: 10px; border-radius: var(--radius-md); color: var(--text-1); font-size: 14.5px; } .menu.space-insert-menu .menu-item > svg { flex: none; width: 18px; height: 18px; color: var(--text-1); } .menu.space-insert-menu .menu-item > span:not(.space-insert-symbol) { flex: none; } .menu.space-insert-menu small { flex: 1; min-width: 0; margin-left: 2px; color: var(--text-3); font-size: 14.5px; } .menu.space-insert-menu .space-insert-symbol { flex: none; display: inline-grid; place-items: center; width: 18px; color: var(--text-1); font-size: 13px; font-weight: 600; } -.menu.space-insert-menu kbd { margin-left: auto; min-width: 26px; max-width: 48px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: color-mix(in srgb, var(--text-1) 9%, transparent); color: var(--text-3); font: 11px/1 var(--font-mono); } +.menu.space-insert-menu kbd { margin-left: auto; min-width: 26px; max-width: 48px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--text-1) 9%, transparent); color: var(--text-3); font: 11px/1 var(--font-mono); } .menu.space-insert-menu .menu-item:is(:hover, :focus-visible):not(:disabled) { background: color-mix(in srgb, var(--text-1) 8%, transparent); } diff --git a/apps/desktop/src/renderer/styles.css b/apps/desktop/src/renderer/styles.css index 96de81c3..29cf95e5 100644 --- a/apps/desktop/src/renderer/styles.css +++ b/apps/desktop/src/renderer/styles.css @@ -32,7 +32,7 @@ a { color: var(--accent); } .hint.pad { padding: 14px; margin: 0; } /* Buttons */ -.btn { background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--fg); transition: background .12s, border-color .12s; white-space: nowrap; } +.btn { background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer; color: var(--fg); transition: background .12s, border-color .12s; white-space: nowrap; } .btn:hover { background: var(--bg-elevated); } .btn:disabled { opacity: .45; cursor: default; } .btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); } @@ -43,8 +43,8 @@ a { color: var(--accent); } .btn.small { padding: 3px 9px; font-size: 12.5px; } .btn.full { width: 100%; text-align: left; } .btn.active { border-color: var(--accent); color: var(--accent); } -.btn .count { margin-left: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 0 6px; font-size: 11px; } -.icon { background: transparent; border: 0; color: var(--fg-1); cursor: pointer; border-radius: 6px; width: 22px; height: 22px; line-height: 20px; padding: 0; text-align: center; } +.btn .count { margin-left: 6px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); padding: 0 6px; font-size: 11px; } +.icon { background: transparent; border: 0; color: var(--fg-1); cursor: pointer; border-radius: var(--radius-sm); width: 22px; height: 22px; line-height: 20px; padding: 0; text-align: center; } .icon:hover { background: var(--bg-3); color: var(--fg); } .icon.dim { color: var(--fg-2); opacity: 0; } .file:hover .icon.dim, .file:focus-within .icon.dim { opacity: 1; } @@ -56,7 +56,7 @@ a { color: var(--accent); } .chev { background: none; border: 0; color: var(--fg-2); width: 18px; cursor: pointer; padding: 0; } .thread-view { display: flex; flex-direction: column; flex: 1; height: 100%; min-height: 0; } -.pill { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12px; color: var(--fg-1); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.pill { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 1px 10px; font-size: 12px; color: var(--fg-1); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .patch { margin: 0; padding: 8px 0; overflow: auto; white-space: pre; } @@ -76,13 +76,13 @@ a { color: var(--accent); } /* Welcome workspace: stack first, expand to a desk when the pane has room. */ .empty { container-type: inline-size; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow-y: auto; background: radial-gradient(ellipse at top right, var(--canvas-sheen), transparent 65%); } .empty-card { display: grid; gap: 24px; width: min(1280px, 100%); margin: auto; padding: 24px 16px; animation: empty-in 240ms var(--ease-out) both; } -.empty-start { min-width: 0; padding: clamp(24px, 5cqi, 48px); border: 1px solid var(--border-pane); border-radius: 12px; background: linear-gradient(145deg, var(--bg-composer-context), var(--bg-main)); box-shadow: 0 2px 4px #0002, 0 16px 36px #0002, inset 0 1px #ffffff0c; } -.empty-aura { display: grid; place-items: center; width: 64px; height: 72px; margin-bottom: 28px; border: 1px solid var(--border-pane); border-radius: 10px; background: var(--bg-composer-context); box-shadow: 0 6px 0 var(--bg-sunken), 0 10px 20px #0003; } +.empty-start { min-width: 0; padding: clamp(24px, 5cqi, 48px); border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: linear-gradient(145deg, var(--bg-composer-context), var(--bg-main)); box-shadow: 0 2px 4px #0002, 0 16px 36px #0002, inset 0 1px #ffffff0c; } +.empty-aura { display: grid; place-items: center; width: 64px; height: 72px; margin-bottom: 28px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-composer-context); box-shadow: 0 6px 0 var(--bg-sunken), 0 10px 20px #0003; } .empty-card .brand-mark.big { width: 32px; height: 42px; margin: 0; } .empty-kicker { margin: 0 0 14px; color: var(--accent); font: var(--weight-semibold) 10px/1.5 var(--font-mono); letter-spacing: .16em; } .empty-card h1 { margin: 0; color: var(--text-1); font-size: clamp(28px, 4cqi, 44px); font-weight: var(--weight-semibold); letter-spacing: -.045em; line-height: 1.12; text-wrap: balance; max-width: 14ch; } .empty-intro { max-width: 460px; margin: 18px 0 24px; color: var(--text-2); font-size: 14px; line-height: 1.65; } -.empty-card .empty-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 8px; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent-strong) 40%, var(--bg-sunken)), 0 10px 24px #0002; font-weight: var(--weight-semibold); transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out), background 120ms var(--ease-out); } +.empty-card .empty-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent-strong) 40%, var(--bg-sunken)), 0 10px 24px #0002; font-weight: var(--weight-semibold); transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out), background 120ms var(--ease-out); } .empty-card .empty-cta:hover:not(:disabled) { box-shadow: 0 3px 0 color-mix(in srgb, var(--accent-strong) 40%, var(--bg-sunken)), 0 12px 28px #0003; } .empty-card .empty-cta:active:not(:disabled) { transform: scale(.96); } .empty-card .empty-cta:focus-visible { outline: 2px solid var(--text-1); outline-offset: 4px; } @@ -92,7 +92,7 @@ a { color: var(--accent); } .empty-workflows h2 { margin: 0 0 4px; font-size: 16px; font-weight: var(--weight-semibold); } .empty-workflows > p { margin: 0 0 16px; color: var(--text-3); font-size: 12px; } .empty-modes { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; flex: 1; } -.empty-mode { display: grid; grid-template-columns: 24px 1fr; gap: 6px 10px; align-content: start; min-width: 0; padding: 18px; border: 1px solid var(--border-pane); border-radius: 10px; background: linear-gradient(150deg, var(--bg-composer-context), var(--bg-sidebar)); box-shadow: 0 2px 3px #0002, 0 8px 20px #0002, inset 0 1px #ffffff09; } +.empty-mode { display: grid; grid-template-columns: 24px 1fr; gap: 6px 10px; align-content: start; min-width: 0; padding: 18px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: linear-gradient(150deg, var(--bg-composer-context), var(--bg-sidebar)); box-shadow: 0 2px 3px #0002, 0 8px 20px #0002, inset 0 1px #ffffff09; } .empty-mode > .icon-svg { grid-row: span 2; color: var(--accent); margin-top: 1px; } .empty-mode strong { color: var(--text-1); font-size: 14px; font-weight: var(--weight-semibold); } .empty-mode span { color: var(--text-3); font-size: 12px; line-height: 1.6; } @@ -127,14 +127,14 @@ a { color: var(--accent); } /* Modal + toast */ .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 10; } -.modal { background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 14px; padding: 20px 22px; width: 520px; max-width: calc(100vw - 40px); box-shadow: 0 30px 80px rgba(0,0,0,.5); } +.modal { background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 20px 22px; width: 520px; max-width: calc(100vw - 40px); box-shadow: 0 30px 80px rgba(0,0,0,.5); } .modal h2 { margin: 0 0 14px; font-size: 16px; } .field { display: grid; gap: 4px; margin-bottom: 12px; } .field > span { color: var(--fg-1); font-size: 12.5px; } -.field input, .field select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; } +.field input, .field select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px; } .field small.ok { color: var(--ok); } .field small.warn { color: var(--warn); } -.toast { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); background: color-mix(in srgb, var(--danger) 12%, var(--bg-elevated)); border: 1px solid var(--danger-border); color: var(--text-1); border-radius: 10px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; max-width: 640px; z-index: 5; } +.toast { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); background: color-mix(in srgb, var(--danger) 12%, var(--bg-elevated)); border: 1px solid var(--danger-border); color: var(--text-1); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; gap: 10px; align-items: center; max-width: 640px; z-index: 5; } .toast .btn { color: inherit; border-color: var(--danger-border); background: var(--danger-bg); } .toast .btn:hover { background: color-mix(in srgb, var(--danger) 22%, transparent); } .toast .toast-close { background: none; border: 0; color: inherit; cursor: pointer; font-size: 16px; } @@ -145,19 +145,19 @@ a { color: var(--accent); } .error-notice-actions .btn.small { margin: 0; font-size: 12px; } /* Backend segmented control, plan toggle, effort, shortcuts */ -kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin-left: 6px; color: var(--fg-1); } +kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--radius-xs); padding: 0 5px; margin-left: 6px; color: var(--fg-1); } .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } -.modal code { background: var(--bg-2); padding: 0 5px; border-radius: 4px; } +.modal code { background: var(--bg-2); padding: 0 5px; border-radius: var(--radius-xs); } .companion-modal { width: min(440px, calc(100vw - 32px)); padding: 28px; color: var(--text-1); } .companion-heading { display: flex; justify-content: space-between; align-items: flex-start; } -.companion-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); } -.companion-close { border: 0; background: transparent; color: var(--text-2); padding: 5px; border-radius: 7px; cursor: pointer; } +.companion-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius-md); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); } +.companion-close { border: 0; background: transparent; color: var(--text-2); padding: 5px; border-radius: var(--radius-sm); cursor: pointer; } .companion-close:hover { color: var(--text-1); background: var(--bg-2); } .companion-eyebrow { margin: 28px 0 8px; font-size: 10px; font-weight: 750; letter-spacing: .17em; color: var(--accent); } .companion-modal h2 { font-size: 25px; line-height: 1.16; letter-spacing: -.035em; margin: 0 0 10px; } .companion-intro { color: var(--text-2); font-size: 13px; line-height: 1.55; margin: 0 0 22px; } -.companion-pairing, .companion-idle { display: flex; flex-direction: column; align-items: center; text-align: center; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-2); padding: 22px 16px; } -.companion-qr { padding: 9px; border-radius: 12px; background: white; box-shadow: 0 9px 26px rgba(0,0,0,.18); } +.companion-pairing, .companion-idle { display: flex; flex-direction: column; align-items: center; text-align: center; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--bg-2); padding: 22px 16px; } +.companion-qr { padding: 9px; border-radius: var(--radius-md); background: white; box-shadow: 0 9px 26px rgba(0,0,0,.18); } .companion-qr img { display: block; width: 226px; height: 226px; image-rendering: pixelated; } .companion-pairing p { font-size: 13px; margin: 16px 0 4px; } .companion-network { display: grid; gap: 6px; margin-top: 12px; font-size: 12px; } @@ -175,20 +175,20 @@ kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1 /* Model menu (Codex-style popover) */ .model-menu { position: relative; min-width: 0; } .model-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.menu { position: absolute; min-width: 200px; max-width: 460px; max-height: 60vh; overflow: auto; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.5); padding: 6px; z-index: 20; } +.menu { position: absolute; min-width: 200px; max-width: 460px; max-height: 60vh; overflow: auto; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius-md); box-shadow: 0 18px 50px rgba(0,0,0,.5); padding: 6px; z-index: 20; } .menu-error { color: var(--warn); font-size: 12px; padding: 8px 10px; } -.menu-item { display: flex; gap: 10px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 8px 10px; color: var(--fg); cursor: pointer; } +.menu-item { display: flex; gap: 10px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: var(--radius-sm); padding: 8px 10px; color: var(--fg); cursor: pointer; } .menu-item:hover, .menu-item:focus-visible { background: var(--bg-2); outline: none; } .menu-item:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); } .menu-item.selected { background: var(--bg-3); } .menu-check { width: 14px; height: 20px; display: inline-flex; align-items: center; color: var(--accent); flex: none; } .menu-body { display: grid; gap: 3px; min-width: 0; } .menu-title { font-weight: 600; display: flex; gap: 8px; align-items: center; } -.menu-default { font-size: 10.5px; font-weight: 500; color: var(--fg-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px; } +.menu-default { font-size: 10.5px; font-weight: 500; color: var(--fg-2); border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 0 6px; } .menu-desc { color: var(--fg-2); font-size: 12px; } .effort-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 10px 6px 34px; } .effort-label { color: var(--fg-2); font-size: 11.5px; margin-right: 4px; } -.effort-pill { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--fg-1); cursor: pointer; } +.effort-pill { font-size: 11.5px; padding: 1px 8px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: transparent; color: var(--fg-1); cursor: pointer; } .effort-pill:hover { border-color: var(--accent); } .effort-pill.on { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); color: var(--accent); } @@ -222,8 +222,8 @@ kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1 .settings-header { flex: none; padding: 24px 26px 18px; } .settings-header h2 { margin: 0 0 6px; font-size: 21px; font-weight: 500; letter-spacing: -.5px; } .settings-header p { margin: 0; color: var(--fg-2); font-size: 12px; line-height: 1.5; } -.settings-nav { display: flex; flex: none; gap: 4px; overflow-x: auto; margin: 0 22px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); scrollbar-width: thin; } -.settings-nav-item { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1 0 auto; min-height: 38px; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--fg-2); font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out; } +.settings-nav { display: flex; flex: none; gap: 4px; overflow-x: auto; margin: 0 22px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-1); scrollbar-width: thin; } +.settings-nav-item { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1 0 auto; min-height: 38px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 8px 10px; background: transparent; color: var(--fg-2); font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out; } .settings-nav-item svg { width: 15px; height: 15px; opacity: .7; } .settings-nav-item:hover { background: var(--bg-2); color: var(--fg); } .settings-nav-item.active { border-color: var(--line); background: var(--bg-elevated); color: var(--fg); box-shadow: 0 1px 3px #00000020, inset 0 1px 0 #ffffff06; } @@ -232,12 +232,12 @@ kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1 .settings-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 22px 26px; scrollbar-gutter: stable; } .settings-section h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--fg-1); } .settings-section .field:last-child { margin-bottom: 0; } -.settings-backends { display: grid; gap: 4px; min-width: 0; margin: 2px 0 12px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 10px; } +.settings-backends { display: grid; gap: 4px; min-width: 0; margin: 2px 0 12px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); } .settings-backends legend { padding: 0 5px; color: var(--fg-1); font-size: 12.5px; } .settings-backends .check { margin: 2px 0; } .settings-backends > small { color: var(--fg-2); margin-top: 3px; line-height: 1.45; } .settings-demo-backend { margin-top: 0; } -.settings-effect { margin: 8px 0 12px; padding: 9px 11px; border-left: 2px solid var(--accent); background: var(--bg-2); border-radius: 0 7px 7px 0; font-size: 12px; } +.settings-effect { margin: 8px 0 12px; padding: 9px 11px; border-left: 2px solid var(--accent); background: var(--bg-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 12px; } .settings-divider { height: 1px; margin: 17px 0 13px; background: var(--line); } .settings-footer { display: flex; flex: none; align-items: center; justify-content: flex-end; gap: 12px; min-height: 62px; padding: 10px 22px; border-top: 1px solid var(--line); background: var(--bg-1); } .settings-footer .row { flex: none; } @@ -250,11 +250,11 @@ kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1 .connections-heading .btn { flex: none; } .connections-note { margin: 12px 0 16px; color: var(--fg-2); font-size: 12px; line-height: 1.5; } .connections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; } -.connection-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-1); } +.connection-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-1); } .connection-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; } .connection-heading h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; } .connection-heading p { line-height: 1.5; } -.connection-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--fg-2); font-size: 11px; white-space: nowrap; background: var(--bg-2); } +.connection-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 7px; color: var(--fg-2); font-size: 11px; white-space: nowrap; background: var(--bg-2); } .connection-badge > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; } .connection-badge.connected { color: var(--ok); } .connection-health { margin: 14px 0; color: var(--fg-1); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; } @@ -265,7 +265,7 @@ kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1 .connection-account { margin: 16px 0 0; } .claude-accounts { display: grid; gap: 10px; margin: 4px 0 8px; } .claude-account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; } -.claude-account-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; } +.claude-account-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; } .claude-account-list li > div:first-child { display: grid; gap: 2px; min-width: 0; } .claude-account-list small { opacity: .75; overflow-wrap: anywhere; } .claude-account-form { display: grid; gap: 8px; } @@ -276,7 +276,7 @@ kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1 .connection-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; color: var(--fg-1); } .connection-details summary { cursor: pointer; padding-block: 6px; min-height: 30px; } .connection-details > p { margin: 8px 0; color: var(--fg-2); line-height: 1.5; } -.connection-command { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; background: var(--bg-2); border-radius: 10px; } +.connection-command { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; background: var(--bg-2); border-radius: var(--radius-sm); } .connection-command code { flex: 1 1 150px; min-width: 0; font-size: 11px; overflow-wrap: anywhere; user-select: text; } .connection-command .btn { flex: none; min-height: 30px; } .connection-path-heading { margin: 20px 0 12px; } @@ -332,11 +332,11 @@ kbd, .kbd { font: 11px var(--mono); background: rgba(255,255,255,.08); border: 1 .menu.bottom-end { top: calc(100% + 6px); right: 0; } .menu.model-list { min-width: 340px; } .model-search { padding: 4px 8px 8px; } -.model-search input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); } +.model-search input { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-row); background: var(--bg); } /* Row actions stay reachable by keyboard: hidden only until their row is hovered or holds focus. */ .side-row:hover .icon-btn.reveal, .side-row:focus-within .icon-btn.reveal, .icon-btn.reveal:focus-visible, .icon-btn.reveal[aria-expanded="true"] { opacity: 1; } -.icon-btn.lg { width: 36px; height: 36px; border-radius: 8px; } +.icon-btn.lg { width: 36px; height: 36px; border-radius: var(--radius-sm); } .menu-item.danger { color: var(--danger); } .menu-close-on-select { display: contents; } @@ -430,7 +430,7 @@ body[data-streamer-mode="true"] ::search-text { color: transparent; background-c .thread-branch .icon-svg { flex: none; } .thread-branch > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .thread-pr { flex: none; max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); text-decoration: none; } -a.thread-pr { border-radius: 3px; } +a.thread-pr { border-radius: var(--radius-xs); } a.thread-pr:hover { text-decoration: underline; } .thread-pr[data-state="open"] { color: var(--ok); } .thread-pr[data-state="merged"] { color: var(--accent); } @@ -459,7 +459,7 @@ a.thread-pr:hover { text-decoration: underline; } /* ── Composer: 960×109 at rest, with a 38 px context strip inset 13 px. ── */ .composer { flex: none; padding: 0 16px 16px; } .composer-inner { container-type: inline-size; container-name: composer; max-width: 960px; margin: 0 auto; } -.composer-context { display: flex; align-items: center; gap: 28px; height: 38px; margin: 0 13px; padding: 0 14px; overflow: hidden; border-radius: 12px 12px 0 0; background: var(--bg-composer-context); color: var(--text-1); font-size: var(--text-sm); white-space: nowrap; box-shadow: inset 0 1px rgba(255, 255, 255, .025); } +.composer-context { display: flex; align-items: center; gap: 28px; height: 38px; margin: 0 13px; padding: 0 14px; overflow: hidden; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--bg-composer-context); color: var(--text-1); font-size: var(--text-sm); white-space: nowrap; box-shadow: inset 0 1px rgba(255, 255, 255, .025); } .context-item { display: inline-flex; align-items: center; gap: 7px; min-width: 0; } .context-item .icon-svg { color: var(--text-2); } .context-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; } @@ -475,7 +475,7 @@ a.thread-pr:hover { text-decoration: underline; } .followup:hover .followup-text { color: var(--text-2); } .followup:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-composer); } .followup-text { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow-wrap: anywhere; white-space: pre-wrap; } -.followup-hint { display: inline-block; margin: 3px 0 2px -6px; padding: 0 7px; border-radius: 7px; background: color-mix(in srgb, var(--text-1) 7%, transparent); color: var(--text-3); font-size: var(--text-sm); line-height: 20px; } +.followup-hint { display: inline-block; margin: 3px 0 2px -6px; padding: 0 7px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--text-1) 7%, transparent); color: var(--text-3); font-size: var(--text-sm); line-height: 20px; } .composer .followup + textarea { position: absolute; top: 0; left: 0; height: 33px !important; } .composer textarea { display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent; padding: 13px 12px 0; color: var(--text-1); font-size: var(--text-md); line-height: 20px; } .composer textarea::placeholder { color: var(--text-placeholder); } @@ -491,14 +491,14 @@ a.thread-pr:hover { text-decoration: underline; } .composer-chip.tone-accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); } .composer-chip.tone-auto { color: var(--accent-warn); border-color: color-mix(in srgb, var(--accent-warn) 45%, transparent); } .composer-chip:disabled { opacity: .5; cursor: default; } -.model-trigger { display: inline-flex; align-items: center; gap: 4px; max-width: min(320px, 100%); height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-1); font-size: var(--text-sm); cursor: pointer; } +.model-trigger { display: inline-flex; align-items: center; gap: 4px; max-width: min(320px, 100%); height: 28px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-1); font-size: var(--text-sm); cursor: pointer; } .model-trigger:hover:not(:disabled), .model-trigger[aria-expanded="true"] { background: var(--bg-row-selected); } .model-trigger:disabled { opacity: .5; cursor: default; } .model-trigger.warn { color: var(--warn); } .model-trigger-effort { color: var(--text-3); } -/* Concentric with the box's 20 px corner: a 34 px circle 2 px inside the box's outer edge. */ +/* A 34 px square with the control radius, 2 px inside the box's outer edge. */ .composer-bar > .tooltip-anchor:last-child { align-self: flex-end; } -.icon-btn.send-btn { width: 34px; height: 34px; margin-left: 6px; border-radius: 50%; background: var(--text-1); color: var(--bg-composer); } +.icon-btn.send-btn { width: 34px; height: 34px; margin-left: 6px; border-radius: var(--radius-sm); background: var(--text-1); color: var(--bg-composer); } .icon-btn.send-btn:hover:not(:disabled) { background: #fff; color: var(--bg-composer); } .icon-btn.send-btn:disabled { opacity: .3; background: var(--text-1); } .composer-warn { display: flex; align-items: center; gap: 8px; padding: 6px 13px 0; color: var(--warn); font-size: var(--text-xs); } @@ -509,13 +509,13 @@ a.thread-pr:hover { text-decoration: underline; } .attachment-chip.openable:hover { border-color: var(--border-strong); background: var(--bg-row-hover); } .attachment-content { display: inline-flex; align-items: center; gap: 8px; min-width: 0; } .attachment-content:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; } -.attachment-thumb, .attachment-glyph { width: 26px; height: 26px; flex: none; border-radius: 6px; background: var(--bg-row-selected); } +.attachment-thumb, .attachment-glyph { width: 26px; height: 26px; flex: none; border-radius: var(--radius-sm); background: var(--bg-row-selected); } .attachment-thumb { object-fit: cover; } .attachment-glyph { display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); } .attachment-text { display: flex; flex-direction: column; min-width: 0; } .attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .attachment-size { color: var(--text-info); } -.attachment-remove { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; } +.attachment-remove { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 2px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); cursor: pointer; } .attachment-remove:hover { background: var(--bg-row-selected); color: var(--text-1); } .msg.user .attachments { justify-content: flex-end; max-width: 70%; padding: 0; } .msg.user .bubble + .attachments { padding-top: 6px; } @@ -537,7 +537,7 @@ a.thread-pr:hover { text-decoration: underline; } .draft-project { position: relative; display: inline-block; } .draft-project-name { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--text-3); text-decoration-thickness: 1px; text-underline-offset: 6px; } .draft-project-name:hover, .draft-project-name[aria-expanded="true"] { text-decoration-color: var(--text-1); } -.draft-project-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; } +.draft-project-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); } .draft-project .menu { text-align: left; font: var(--weight-regular) var(--text-md)/1.5 var(--font-sans); } .context-toggle { margin: 0 -6px; padding: 3px 6px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; font: inherit; cursor: pointer; } .context-toggle:hover { background: var(--bg-row-selected); } @@ -548,10 +548,10 @@ a.thread-pr:hover { text-decoration: underline; } .transcript { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 24px 0 16px; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; } .transcript > * { max-width: calc(938px + 54px); margin-left: auto; margin-right: auto; padding-left: 27px; padding-right: 27px; } .transcript-empty { color: var(--text-3); } -.transcript-empty code { padding: 1px 5px; border-radius: 4px; background: var(--bg-row-selected); } +.transcript-empty code { padding: 1px 5px; border-radius: var(--radius-xs); background: var(--bg-row-selected); } .msg { margin-bottom: 20px; color: var(--text-1); font-size: var(--text-md); line-height: 1.6; } .msg.user { display: flex; flex-direction: column; align-items: flex-end; } -.msg.user .bubble { max-width: 70%; padding: 8px 16px; border: 1px solid var(--bubble-border); border-radius: 12px; background: var(--bg-user-bubble); white-space: pre-wrap; overflow-wrap: anywhere; } +.msg.user .bubble { max-width: 70%; padding: 8px 16px; border: 1px solid var(--bubble-border); border-radius: var(--radius-md); background: var(--bg-user-bubble); white-space: pre-wrap; overflow-wrap: anywhere; } .md p { margin: 0 0 12px; } /* Text as written until it nears the view and parses (Markdown.tsx, DeferMarkdown). */ .md-deferred { white-space: pre-wrap; overflow-wrap: anywhere; } @@ -572,19 +572,19 @@ a.thread-pr:hover { text-decoration: underline; } .md .footnote { margin: 0 0 6px; color: var(--text-3); font-size: var(--text-sm); } .md sup { font-size: 0.75em; } .md strong { font-weight: var(--weight-semibold); } -.md code { padding: 1px 5px; border-radius: 5px; background: var(--bg-row-selected); font-size: 12.5px; } +.md code { padding: 1px 5px; border-radius: var(--radius-xs); background: var(--bg-row-selected); font-size: 12.5px; } .md pre.code { margin: 8px 0 14px; padding: 12px 14px; overflow: auto; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-sunken); } .md .code-block { position: relative; margin: 8px 0 14px; } .md .code-block pre.code { margin: 0; padding-top: 30px; } .md .code-head { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; height: 26px; padding: 0 8px 0 14px; color: var(--text-3); font-size: var(--text-xs); } -.md .code-copy { padding: 2px 8px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--text-3); font: inherit; cursor: pointer; } +.md .code-copy { padding: 2px 8px; border: 1px solid transparent; border-radius: var(--radius-xs); background: none; color: var(--text-3); font: inherit; cursor: pointer; } .md .code-copy:hover { border-color: var(--border-pane); color: var(--text-1); } .md .code-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; } .md .code-copy-error { display: block; margin-top: 4px; color: var(--text-3); font-size: var(--text-xs); } .md pre.code code { padding: 0; background: none; } .md a, .tool-link { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; } .md a:hover, .tool-link:hover { text-decoration: underline; } -.md a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; } +.md a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); } /* Questions an agent asked in its reply; an option sends itself as the next message. */ .message-asks { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border-pane); border-radius: var(--radius-row); background: var(--bg-sunken); } @@ -660,7 +660,7 @@ a.thread-pr:hover { text-decoration: underline; } /* Failure: the card that ends a turn that did not complete. Bordered like an approval (it also stops the thread), in the danger tone. */ .transcript > .failure, .turn-content .failure { width: calc(100% - 54px); max-width: 714px; margin: 4px 0 16px; padding: 12px 16px; border: 1px solid var(--danger-border); border-radius: var(--radius-md); background: var(--bg-elevated); font-size: var(--text-sm); } .failure-head { display: flex; align-items: flex-start; gap: 10px; color: var(--text-1); font-weight: var(--weight-semibold); } -.failure-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); font-size: 12px; font-weight: var(--weight-semibold); } +.failure-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; border-radius: var(--radius-xs); background: var(--danger-bg); color: var(--danger); font-size: 12px; font-weight: var(--weight-semibold); } .failure-hint { margin: 6px 0 0 28px; color: var(--text-2); } .failure-message { margin: 8px 0 0 28px; padding: 8px 10px; max-height: 120px; overflow: auto; border-radius: var(--radius-sm); background: var(--bg-sunken); color: var(--text-3); font: 12px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; } .failure-actions { margin: 10px 0 0 28px; flex-wrap: wrap; gap: 8px; } @@ -706,7 +706,7 @@ a.thread-pr:hover { text-decoration: underline; } /* ── Title bar actions (Phase 7) ── */ .changes-toggle { position: relative; } .changes-toggle.on { color: var(--text-1); } -.count-badge { position: absolute; top: 1px; right: 0; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font: var(--weight-semibold) 10px/14px var(--font-sans); text-align: center; } +.count-badge { position: absolute; top: 1px; right: 0; min-width: 14px; height: 14px; padding: 0 3px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font: var(--weight-semibold) 10px/14px var(--font-sans); text-align: center; } .menu.thread-actions { min-width: 240px; } .menu.thread-actions .menu-label span { display: block; max-width: 320px; overflow: hidden; color: var(--text-3); font: 11.5px var(--font-mono); text-overflow: ellipsis; white-space: nowrap; } @@ -754,7 +754,7 @@ a.thread-pr:hover { text-decoration: underline; } .evidence-where { overflow-wrap: anywhere; color: var(--text-2); font: 12px var(--font-mono); } .evidence-note { margin-left: 8px; color: var(--text-3); } .evidence-actions { display: inline-flex; gap: 4px; margin-left: 8px; } -.evidence-action { padding: 1px 7px; border: 1px solid var(--border-pane); border-radius: 5px; background: none; color: var(--text-3); font: inherit; font-size: var(--text-xs); cursor: pointer; } +.evidence-action { padding: 1px 7px; border: 1px solid var(--border-pane); border-radius: var(--radius-xs); background: none; color: var(--text-3); font: inherit; font-size: var(--text-xs); cursor: pointer; } .evidence-action:hover { color: var(--text-1); border-color: var(--border-strong); } .evidence-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; } .evidence-excerpt-box { margin: 6px 0 2px; } @@ -783,7 +783,7 @@ a.thread-pr:hover { text-decoration: underline; } .task-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 18px; font-size: var(--text-xs); color: var(--text-3); } .task-note-save { border: 0; background: transparent; padding: 2px 0; color: var(--text-3); font: inherit; cursor: pointer; } .task-note-save:hover { color: var(--text-1); } -.task-note-save:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; } +.task-note-save:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-xs); } .task-note-saved { display: inline-flex; align-items: center; gap: 6px; } /* Small controls keep their look but get a 28 px hit area. */ @@ -812,7 +812,7 @@ a.thread-pr:hover { text-decoration: underline; } .terminal-screen { flex: 1; min-height: 0; overflow: hidden; margin: 0 var(--space-3) var(--space-2) var(--space-5); } .terminal-screen .xterm { height: 100%; } .terminal-screen .xterm .xterm-viewport { background: transparent; overflow-y: hidden; } /* xterm 6 scrolls with its own scrollbar; the native one only left a grey square */ -.approval-rule { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 12px; min-width: 0; } +.approval-rule { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 12px 0; padding: 12px; min-width: 0; } .approval-rule legend { color: var(--text-2); padding: 0 6px; } .approval-rule .check { margin: 0; } .approval-preview { border-left: 2px solid var(--text-3); margin: 12px 0; padding: 8px 12px; } @@ -827,25 +827,25 @@ a.thread-pr:hover { text-decoration: underline; } .theme-choice[data-selected="true"] { border-color: var(--accent); } .theme-choice:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; } .theme-choice input { position: absolute; right: 12px; bottom: 28px; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); } -.theme-preview { position: relative; display: block; height: 66px; margin-bottom: 6px; border-radius: 6px; overflow: hidden; background: var(--preview-bg); border: 1px solid rgba(255,255,255,.12); } +.theme-preview { position: relative; display: block; height: 66px; margin-bottom: 6px; border-radius: var(--radius-sm); overflow: hidden; background: var(--preview-bg); border: 1px solid rgba(255,255,255,.12); } .theme-preview-rail { position: absolute; inset: 0 auto 0 0; width: 24%; background: var(--preview-surface); border-right: 1px solid rgba(255,255,255,.08); } .theme-preview-lines { position: absolute; top: 13px; left: 33%; width: 50%; display: grid; gap: 5px; } .theme-preview-lines i { height: 3px; background: rgba(255,255,255,.26); border-radius: 2px; } .theme-preview-lines i:nth-child(2) { width: 74%; } .theme-preview-lines i:nth-child(3) { width: 52%; } -.theme-preview-composer { position: absolute; bottom: 7px; left: 32%; right: 9%; height: 15px; border-radius: 5px; background: var(--preview-surface); } +.theme-preview-composer { position: absolute; bottom: 7px; left: 32%; right: 9%; height: 15px; border-radius: var(--radius-xs); background: var(--preview-surface); } .theme-preview-composer i { position: absolute; width: 7px; height: 7px; right: 4px; top: 4px; border-radius: 50%; background: var(--preview-accent); } .theme-name { padding-right: 25px; font-size: 13px; font-weight: 600; } .theme-description { color: var(--text-3); font-size: 12px; } /* Release notices stay in the workspace flow and use either theme's accent. */ .update-banner { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 32px; align-items: center; flex: none; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-pane); background: color-mix(in srgb, var(--accent) 6%, var(--bg-main)); color: var(--text-2); font-size: var(--text-sm); } -.update-banner-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); } +.update-banner-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); } .update-banner-copy { display: grid; gap: 3px; min-width: 0; line-height: 1.4; overflow-wrap: anywhere; } .update-banner-copy strong { color: var(--text-1); font-weight: 500; } .update-banner-copy > span { font-size: var(--text-xs); color: var(--text-2); text-wrap: pretty; } .update-banner-detail { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-3); overflow-wrap: anywhere; } -.update-banner a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 7px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background 120ms var(--ease-out), border-color 120ms var(--ease-out), transform 120ms var(--ease-out); } +.update-banner a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background 120ms var(--ease-out), border-color 120ms var(--ease-out), transform 120ms var(--ease-out); } .update-banner a:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); } .update-banner a:active { transform: scale(0.96); } .update-banner a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; } @@ -865,7 +865,7 @@ a.thread-pr:hover { text-decoration: underline; } .update-recovery-content > p, .update-recovery-drafts > p { color: var(--text-2); line-height: 1.5; } .update-recovery-drafts { margin: 24px 0; } .update-recovery-draft { margin: 16px 0; } -.update-recovery-draft textarea { display: block; width: 100%; margin-top: 8px; padding: 12px; border: 1px solid var(--border-pane); border-radius: 8px; background: var(--bg-elevated); color: var(--text-1); resize: vertical; } +.update-recovery-draft textarea { display: block; width: 100%; margin-top: 8px; padding: 12px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-1); resize: vertical; } .update-recovery-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; } .update-recovery-actions a { text-decoration: none; } .active-agents { flex: none; min-height: 0; max-height: 35vh; display: flex; flex-direction: column; padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-pane); } @@ -890,7 +890,7 @@ a.thread-pr:hover { text-decoration: underline; } :root[data-theme="graphite"] .title-text { font-size: 14px; } :root[data-theme="graphite"] .rail { padding-left: 8px; } :root[data-theme="graphite"] .sidebar-title .brand-mark { display: none; } -:root[data-theme="graphite"] .thread-row { height: 30px; grid-template-rows: 30px; border-radius: 10px; } +:root[data-theme="graphite"] .thread-row { height: 30px; grid-template-rows: 30px; border-radius: var(--radius-sm); } :root[data-theme="graphite"] .thread-main { padding: 0 8px 0 32px; } :root[data-theme="graphite"] .thread-provider-line, :root[data-theme="graphite"] .thread-context-line { display: none; } @@ -900,9 +900,9 @@ a.thread-pr:hover { text-decoration: underline; } :root[data-theme="graphite"] .main { container-type: inline-size; container-name: thread-main; } :root[data-theme="graphite"] .composer-box { box-shadow: none; background-image: none; } :root[data-theme="graphite"] .side-row.selected { box-shadow: none; } -.repository-overview { display: none; position: absolute; z-index: 2; top: 8px; right: 8px; width: 300px; padding: 12px; border-radius: 16px; background: var(--bg-elevated); color: var(--text-2); font-size: 13px; } +.repository-overview { display: none; position: absolute; z-index: 2; top: 8px; right: 8px; width: 300px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-2); font-size: 13px; } .repository-overview-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 8px 7px; color: var(--text-3); } -.repository-overview-row { display: flex; align-items: center; width: 100%; min-height: 32px; gap: 10px; padding: 5px 8px; text-align: left; border-radius: 6px; } +.repository-overview-row { display: flex; align-items: center; width: 100%; min-height: 32px; gap: 10px; padding: 5px 8px; text-align: left; border-radius: var(--radius-sm); } .repository-overview-row > span:not(.spacer) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .repository-overview-row .icon-svg { flex: none; } button.repository-overview-row { appearance: none; background: transparent; border: 0; cursor: pointer; } @@ -936,7 +936,7 @@ body[data-panel-resizing], body[data-panel-resizing] * { cursor: col-resize !imp :root[data-theme="graphite"] .project { margin-bottom: 9px; } :root[data-theme="graphite"] .thread-row:is(:hover, :focus-within) .thread-main { padding-right: 30px; } :root[data-theme="graphite"] .titlebar-nav::after { display: none; } -.thread-details { position: fixed; z-index: 90; width: 320px; padding: 7px 9px; border: 1px solid var(--border-pane); border-radius: 12px; background: var(--bg-elevated); color: var(--text-2); font-size: 13px; line-height: 20px; box-shadow: 0 4px 16px #0002; } +.thread-details { position: fixed; z-index: 90; width: 320px; padding: 7px 9px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-2); font-size: 13px; line-height: 20px; box-shadow: 0 4px 16px #0002; } .thread-details-title { display: flex; align-items: center; gap: 8px; } .thread-details-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .thread-details-title > svg { flex: none; color: var(--text-4); } @@ -947,7 +947,7 @@ body[data-panel-resizing], body[data-panel-resizing] * { cursor: col-resize !imp .thread-details summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .thread-details-meta { display: grid; gap: 2px; padding: 8px 0 1px 21px; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; } /* The current chat stays mounted when used as Space's floating assistant. */ -.sheet[data-surface="space"] > .main.space-chat { display: flex; position: absolute; grid-area: unset; z-index: 25; right: 8px; bottom: 8px; width: min(560px, calc(100% - 16px)); height: min(640px, calc(100% - 72px)); border: 1px solid var(--border-pane); border-radius: 24px; background: var(--bg-elevated); box-shadow: 0 12px 40px #0002; container-type: normal; } +.sheet[data-surface="space"] > .main.space-chat { display: flex; position: absolute; grid-area: unset; z-index: 25; right: 8px; bottom: 8px; width: min(560px, calc(100% - 16px)); height: min(640px, calc(100% - 72px)); border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); box-shadow: 0 12px 40px #0002; container-type: normal; } .space-chat-header { flex: none; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; color: var(--text-3); font-size: 13px; } .space-chat-header > span:not(.tooltip-anchor) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .space-chat .draft-view { flex: 1; min-height: 0; } @@ -956,7 +956,7 @@ body[data-panel-resizing], body[data-panel-resizing] * { cursor: col-resize !imp .space-chat .draft-title { font-size: 20px; } .space-chat .transcript { padding: 12px 24px; } .space-chat .composer { padding: 8px 12px 10px; border-top: 1px solid var(--border-pane); } -.space-chat .composer-box { border: 0; box-shadow: none; border-radius: 16px; background: transparent; } +.space-chat .composer-box { border: 0; box-shadow: none; border-radius: var(--radius-md); background: transparent; } .space-chat .composer-context { margin: 0; background: transparent; } .space-chat .composer textarea { min-height: 36px; max-height: 120px; overflow-y: auto; } .sheet[data-surface="space"]:has(.space-chat) > .toast { display: flex; z-index: 30; } @@ -1004,48 +1004,48 @@ button.turn-label:hover { color: var(--text-2); } .menu-group-state { color: var(--text-4); } .menu-group-state.ready { color: var(--text-3); } .menu-group-state.unavailable { color: var(--warn); } -.model-trigger-local { padding: 1px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-3); font-size: 10.5px; white-space: nowrap; } +.model-trigger-local { padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--text-3); font-size: 10.5px; white-space: nowrap; } .model-trigger.local .model-trigger-label { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; } .local-inference-host { margin: 0 0 8px; padding: 0 4px; font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; } /* Create project: a name, one source folder, Cancel and Create. */ .cp-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(0, 0, 0, .45); } -.cp-dialog { position: relative; width: 520px; max-width: calc(100vw - 32px); padding: 26px 20px 20px; border: 1px solid var(--border-pane); border-radius: 22px; background: var(--bg-elevated); color: var(--text-1); box-shadow: 0 24px 70px rgba(0, 0, 0, .5); } +.cp-dialog { position: relative; width: 520px; max-width: calc(100vw - 32px); padding: 26px 20px 20px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-1); box-shadow: 0 24px 70px rgba(0, 0, 0, .5); } .cp-dialog h2 { margin: 0 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; } .cp-dialog button { font: inherit; cursor: pointer; } -.cp-close { position: absolute; top: 18px; right: 16px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); } +.cp-close { position: absolute; top: 18px; right: 16px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); } .cp-dialog { --cp-line: color-mix(in srgb, var(--text-1) 16%, transparent); } -.cp-name { display: flex; align-items: center; height: 40px; border: 1px solid var(--cp-line); border-radius: 12px; } +.cp-name { display: flex; align-items: center; height: 40px; border: 1px solid var(--cp-line); border-radius: var(--radius-md); } .cp-name:focus-within { border-color: var(--accent); } .cp-name > span { flex: none; display: grid; place-items: center; width: 40px; height: 100%; border-right: 1px solid var(--cp-line); color: var(--text-1); } .cp-dialog input { flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: 0; outline: 0; background: transparent; color: var(--text-1); font: inherit; font-size: 14px; box-shadow: none; } .cp-sources-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; font-size: 14px; } .cp-sources-head strong { font-weight: 500; } .cp-sources-head span { display: flex; align-items: center; gap: 8px; color: var(--text-3); } -.cp-sources { border: 1px solid var(--cp-line); border-radius: 12px; } +.cp-sources { border: 1px solid var(--cp-line); border-radius: var(--radius-md); } .cp-folder { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px 0 14px; font-size: 14px; color: var(--text-1); } .cp-folder > svg { flex: none; color: var(--text-2); } .cp-folder span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.cp-folder button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); } +.cp-folder button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); } .cp-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 16px; } .cp-empty p { margin: 0; font-size: 14px; color: var(--text-1); } .cp-empty p span { color: var(--text-3); } .cp-path { display: flex; align-items: center; gap: 8px; width: 100%; } -.cp-dialog .cp-path input { height: 32px; border: 1px solid var(--cp-line); border-radius: 9px; } -.cp-add { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--bg-row-selected); color: var(--text-1); font-size: 13.5px; } +.cp-dialog .cp-path input { height: 32px; border: 1px solid var(--cp-line); border-radius: var(--radius-sm); } +.cp-add { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: var(--radius-md); background: var(--bg-row-selected); color: var(--text-1); font-size: 13.5px; } .cp-add:disabled { opacity: .45; cursor: default; } .cp-error { margin: 10px 2px 0; color: var(--danger, #e66); font-size: 12.5px; } .cp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 30px; } -.cp-cancel { height: 32px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--text-3); font-size: 14px; } -.cp-create { height: 32px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--text-1); color: var(--bg-main); font-size: 14px; font-weight: 500; } +.cp-cancel { height: 32px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-3); font-size: 14px; } +.cp-create { height: 32px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); background: var(--text-1); color: var(--bg-main); font-size: 14px; font-weight: 500; } .cp-create:disabled { opacity: .45; cursor: default; } /* A label fades only where it is cut off: it fills its row, so a short name is never dimmed. */ :root[data-theme="graphite"] :is(.project-toggle, .new-chat) > .side-row-label { flex: 1 1 auto; } /* Hover cards beside the sidebar: a chat's, and a project's. */ -.thread-details { padding: 10px 12px; border-radius: 14px; font-size: 13.5px; } +.thread-details { padding: 10px 12px; border-radius: var(--radius-md); font-size: 13.5px; } .thread-details-title { color: var(--text-1); font-size: 14px; } .thread-details time { font-size: 12px; } .project-details hr { height: 1px; margin: 7px -4px; border: 0; background: color-mix(in srgb, var(--text-1) 16%, transparent); } @@ -1065,16 +1065,16 @@ button.turn-label:hover { color: var(--text-2); } .msg-actions .task-note-saved { display: inline-flex; align-items: center; gap: 8px; } /* The Auto routing receipt: one quiet line, and when opened a card with its reasons and three measures. */ -.route { border-radius: 14px; transition: background 140ms, box-shadow 140ms; } +.route { border-radius: var(--radius-md); transition: background 140ms, box-shadow 140ms; } .route.open { margin: 4px 0 10px; background: color-mix(in srgb, var(--text-1) 3.5%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-1) 9%, transparent); } -.route .route-head { gap: 10px; min-height: 34px; padding: 0 10px 0 6px; border-radius: 14px; } +.route .route-head { gap: 10px; min-height: 34px; padding: 0 10px 0 6px; border-radius: var(--radius-md); } .route .route-head:hover { background: color-mix(in srgb, var(--text-1) 4%, transparent); } -.route-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: var(--accent-warn); background: color-mix(in srgb, var(--accent-warn) 14%, transparent); } +.route-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-sm); color: var(--accent-warn); background: color-mix(in srgb, var(--accent-warn) 14%, transparent); } .route-label { color: var(--text-3); font-size: 13px; letter-spacing: .005em; } .route-label b { color: var(--text-1); font-weight: 500; } .route-meta, .route.heuristic .route-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); } .route-sep { font-size: 0; } -.route-chip { height: 20px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 10px; font-size: 11.5px; line-height: 1; color: var(--text-2); background: color-mix(in srgb, var(--text-1) 7%, transparent); } +.route-chip { height: 20px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: var(--radius-sm); font-size: 11.5px; line-height: 1; color: var(--text-2); background: color-mix(in srgb, var(--text-1) 7%, transparent); } .route-chip.source { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); } .route.heuristic .route-chip.source { color: var(--text-3); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-1) 13%, transparent); } .route .route-body { margin: 0; padding: 2px 14px 12px 38px; border: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; } @@ -1082,7 +1082,7 @@ button.turn-label:hover { color: var(--text-2); } .route-body ul li { position: relative; margin: 0; padding: 3px 0 3px 14px; } .route-body ul li::before { content: ""; position: absolute; left: 0; top: 12px; width: 4px; height: 4px; border-radius: 50%; background: var(--text-4); } .route-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; } -.route-stats > div { min-width: 118px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--text-1) 4.5%, transparent); } +.route-stats > div { min-width: 118px; padding: 8px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--text-1) 4.5%, transparent); } .route-stats dt { color: var(--text-4); font-size: 11px; letter-spacing: .02em; } .route-stats dd { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--text-1); font-size: 13px; font-variant-numeric: tabular-nums; } .route-meter { flex: 1; min-width: 34px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--text-1) 10%, transparent); overflow: hidden; } @@ -1090,8 +1090,8 @@ button.turn-label:hover { color: var(--text-2); } @media (prefers-reduced-motion: reduce) { .route { transition: none; } } /* Interface size: three choices in a segmented row. */ -.ui-size-options { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg-composer); } -.ui-size-options button { height: 28px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; } +.ui-size-options { display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--radius-sm); background: var(--bg-composer); } +.ui-size-options button { height: 28px; padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; } .ui-size-options button[aria-checked="true"] { background: var(--bg-row-selected); color: var(--text-1); } .task-context-select { position: relative; display: flow-root; margin: 0 27px; z-index: 4; font-size: 12px; } @@ -1106,7 +1106,7 @@ button.turn-label:hover { color: var(--text-2); } .composer-inner:has(> .task-context-select) > .composer-context { gap: 12px; padding-left: 8px; padding-right: 48px; } .composer-inner:has(> .task-context-select) > .composer-context .context-item { gap: 4px; } } -.task-context-panel { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 6px 0; text-align: left; } +.task-context-panel { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 6px 0; text-align: left; } .task-context-panel p { margin: 6px 0; } .task-context-panel button { margin: 4px 8px 4px 0; } .task-context-candidates { display: grid; gap: 6px; } @@ -1119,4 +1119,4 @@ button.turn-label:hover { color: var(--text-2); } .task-view > .task-context-turn { display: block; min-width: 0; } .task-context-panel { box-sizing: border-box; width: 100%; min-width: 0; } .task-context-confirm { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; } -.task-context-panel fieldset { min-width: 0; margin: 8px 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px; } +.task-context-panel fieldset { min-width: 0; margin: 8px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; } diff --git a/apps/desktop/src/renderer/tokens.css b/apps/desktop/src/renderer/tokens.css index 9949c6ee..70a801ab 100644 --- a/apps/desktop/src/renderer/tokens.css +++ b/apps/desktop/src/renderer/tokens.css @@ -31,6 +31,10 @@ --border-composer: #42465e; --border-strong: #54586f; --rule: #2b3347; + /* Derived from the text colour, so every theme inherits them: hover fills and inner borders. */ + --tint: color-mix(in srgb, var(--text-1) 5%, transparent); + --tint-strong: color-mix(in srgb, var(--text-1) 9%, transparent); + --hairline: color-mix(in srgb, var(--text-1) 11%, transparent); /* Text — brightest glyph-core pixel on each surface */ --text-1: #f8f3fa; @@ -81,12 +85,14 @@ --weight-semibold: 600; --leading: 1.5; - /* Radii */ - --radius-sm: 6px; /* derived: icon buttons, inline code */ - --radius-row: 10px; /* measured: selected sidebar row */ - --radius-md: 12px; /* derived: menus, cards */ - --radius-composer: 20px; /* measured ±2: composer box */ - --radius-pill: 999px; + /* Radii: one scale for every button and component (design/tokens.md, "Radius scale"). + 8 px surfaces, 6 px controls, 4 px parts inside a control. Only dots and spinners are round. */ + --radius-xs: 4px; /* part: tabs, icon tiles, inline code, key hints */ + --radius-sm: 6px; /* control: buttons, icon buttons, fields */ + --radius-row: 6px; /* control: rows and options */ + --radius-md: 8px; /* surface: menus, cards, dialogs */ + --radius-composer: 8px; /* surface: composer box */ + --radius-pill: 6px; /* control: chips and badges (no longer pill-shaped) */ /* Spacing (4 px grid) */ --space-1: 4px; @@ -101,7 +107,7 @@ --rail-w: 48px; /* x 0–47; the sheet's 1 px left border sits at x 48 */ --sidebar-w: 240px; /* x 49–288; 1 px divider at x 289 */ --row-h: 30px; /* sidebar rows, 31 px pitch */ - --radius-sheet: 12px; /* content sheet corners */ + --radius-sheet: 8px; /* surface: content sheet corners */ /* Motion */ --ease-out: cubic-bezier(0.2, 0, 0, 1); diff --git a/apps/desktop/src/renderer/usage/usage.css b/apps/desktop/src/renderer/usage/usage.css index 5afe17bd..b83724a4 100644 --- a/apps/desktop/src/renderer/usage/usage.css +++ b/apps/desktop/src/renderer/usage/usage.css @@ -147,7 +147,7 @@ svg { background: var(--primary); color: var(--primary-ink); padding: 12px; - border-radius: 6px; + border-radius: var(--radius-sm); } .skip-link:focus { top: 12px; @@ -199,7 +199,7 @@ svg { min-height: 40px; padding: 10px 12px; border: 0; - border-radius: 6px; + border-radius: var(--radius-sm); background: transparent; font-family: var(--font-mono); font-size: 9px; @@ -244,7 +244,7 @@ svg { align-items: center; gap: 11px; border: 0; - border-radius: 6px; + border-radius: var(--radius-sm); background: transparent; padding: 11px 12px; color: var(--muted); @@ -275,7 +275,7 @@ svg { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--border); - border-radius: 4px; + border-radius: var(--radius-xs); padding: 1px 5px; margin-left: auto; } @@ -403,7 +403,7 @@ svg { margin-left: 18px; background: var(--secondary); border: 1px solid var(--border); - border-radius: 50%; + border-radius: var(--radius-sm); color: var(--foreground); font-size: 10px; } @@ -455,7 +455,7 @@ h1 { min-height: 37px; padding: 8px 13px; border: 1px solid transparent; - border-radius: 6px; + border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; white-space: nowrap; @@ -486,7 +486,7 @@ h1 { background: transparent; width: 32px; height: 32px; - border-radius: 5px; + border-radius: var(--radius-xs); color: var(--muted); } .icon-button:hover { @@ -522,7 +522,7 @@ h1 { gap: 10px; padding: 11px 14px; border: 1px solid var(--border); - border-radius: 7px; + border-radius: var(--radius-sm); background: color-mix(in srgb, var(--primary) 3%, var(--card)); color: var(--muted); font-size: 11px; @@ -570,7 +570,7 @@ h1 { align-items: center; gap: 8px; border: 1px solid var(--border); - border-radius: 6px; + border-radius: var(--radius-sm); padding-left: 10px; background: var(--card); } @@ -604,7 +604,7 @@ h1 { font-size: 9px; padding: 3px 5px; border: 1px solid var(--border); - border-radius: 3px; + border-radius: var(--radius-xs); } .metrics { display: grid; @@ -615,7 +615,7 @@ h1 { .metric { background: var(--card); box-shadow: var(--shadow); - border-radius: 10px; + border-radius: var(--radius-sm); padding: 18px 18px 16px; min-width: 0; } @@ -667,7 +667,7 @@ h1 { background: var(--border); margin-left: auto; overflow: hidden; - border-radius: 3px; + border-radius: var(--radius-xs); } .mini-track i { display: block; @@ -684,7 +684,7 @@ h1 { .panel { background: var(--card); box-shadow: var(--shadow); - border-radius: 10px; + border-radius: var(--radius-sm); min-width: 0; overflow: hidden; } @@ -712,13 +712,13 @@ h1 { background: var(--background); border: 1px solid var(--border); padding: 3px; - border-radius: 6px; + border-radius: var(--radius-sm); } .segmented button { border: 0; background: transparent; padding: 5px 9px; - border-radius: 3px; + border-radius: var(--radius-xs); font-size: 10px; color: var(--muted); } @@ -888,7 +888,7 @@ h1 { height: 24px; display: grid; place-items: center; - border-radius: 6px; + border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, currentColor 20%, transparent); background: color-mix(in srgb, currentColor 7%, transparent); } @@ -923,14 +923,14 @@ h1 { display: block; height: 5px; background: var(--background); - border-radius: 3px; + border-radius: var(--radius-xs); overflow: hidden; } .rank-track > i { display: block; height: 100%; background: currentColor; - border-radius: 3px; + border-radius: var(--radius-xs); min-width: 2px; } .insight-panel { @@ -951,7 +951,7 @@ h1 { width: 30px; height: 30px; border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent); - border-radius: 7px; + border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--teal); @@ -1026,7 +1026,7 @@ td:first-child > .row-secondary { font-size: 9px; border: 1px solid var(--border); padding: 4px 7px; - border-radius: 4px; + border-radius: var(--radius-xs); line-height: 1.2; } .badge.neutral { @@ -1062,7 +1062,7 @@ td:first-child > .row-secondary { gap: 9px; border: 1px solid var(--input); background: var(--card); - border-radius: 6px; + border-radius: var(--radius-sm); padding: 0 10px; max-width: 380px; width: 100%; @@ -1111,7 +1111,7 @@ td:first-child > .row-secondary { width: 38px; height: 38px; border: 1px solid var(--border); - border-radius: 9px; + border-radius: var(--radius-sm); color: var(--muted); margin-bottom: 17px; } @@ -1133,7 +1133,7 @@ td:first-child > .row-secondary { min-width: 0; background: var(--background); border: 1px solid var(--border); - border-radius: 7px; + border-radius: var(--radius-sm); padding: 20px; } .project-icon, @@ -1144,7 +1144,7 @@ td:first-child > .row-secondary { height: 32px; background: var(--secondary); border: 1px solid var(--border); - border-radius: 7px; + border-radius: var(--radius-sm); color: var(--primary); margin-bottom: 16px; } @@ -1180,7 +1180,7 @@ td:first-child > .row-secondary { padding: 22px; background: var(--card); border: 1px solid var(--border); - border-radius: 10px; + border-radius: var(--radius-sm); margin-bottom: 20px; } .account-notice > .icon { @@ -1269,7 +1269,7 @@ dd { place-items: center; width: 36px; height: 36px; - border-radius: 50%; + border-radius: var(--radius-sm); background: color-mix(in srgb, var(--teal) 8%, transparent); color: var(--teal); } @@ -1317,7 +1317,7 @@ dd { background: var(--card); border: 1px solid var(--border); box-shadow: 0 12px 24px #0004; - border-radius: 8px; + border-radius: var(--radius-sm); padding: 14px 20px; display: flex; gap: 10px; @@ -1330,7 +1330,7 @@ dd { } .dialog { border: 1px solid var(--border); - border-radius: 12px; + border-radius: var(--radius-md); background: var(--card); color: var(--foreground); padding: 0; @@ -1392,7 +1392,7 @@ dd { padding: 10px 12px; margin-top: 7px; border: 1px solid var(--input); - border-radius: 6px; + border-radius: var(--radius-sm); background: var(--background); color: var(--foreground); } @@ -1573,7 +1573,7 @@ dd { flex-shrink: 0; white-space: nowrap; font-size: 11px; - border-radius: 5px 5px 0 0; + border-radius: var(--radius-xs) var(--radius-xs) 0 0; min-height: 40px; padding: 10px; } diff --git a/apps/desktop/src/renderer/workspace.css b/apps/desktop/src/renderer/workspace.css index f6483da7..c3c901f7 100644 --- a/apps/desktop/src/renderer/workspace.css +++ b/apps/desktop/src/renderer/workspace.css @@ -14,43 +14,43 @@ .workspace button:disabled { color: var(--text-4); opacity: .65; } .workspace .icon-btn { color: var(--text-3); flex-shrink: 0; } .workspace .icon-btn:hover { background: var(--bg-row-hover); color: var(--text-1); } -.workspace .icon-btn.on { color: var(--text-1); background: var(--bg-row-selected); border-radius: 6px; } +.workspace .icon-btn.on { color: var(--text-1); background: var(--bg-row-selected); border-radius: var(--radius-sm); } .workspace-tabbar { height: 40px; padding: 4px 7px; display: flex; align-items: center; gap: 4px; flex: none; background: var(--workspace-bg); border-bottom: 1px solid var(--border-pane); } .workspace-tabs { min-width: 0; display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; } -.workspace-tab { display: flex; flex: 0 1 180px; min-width: 90px; height: 30px; align-items: center; border: 1px solid transparent; border-radius: 7px; color: var(--text-3); } +.workspace-tab { display: flex; flex: 0 1 180px; min-width: 90px; height: 30px; align-items: center; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-3); } .workspace-tab.selected { background: var(--bg-row-selected); color: var(--workspace-text); } .workspace-tab [role="tab"] { min-width: 0; flex: 1; height: 100%; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 0; background: transparent; text-align: left; font-size: 13px; } .workspace-tab [role="tab"] span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .workspace-tab svg { flex: none; } -.workspace-tab-close { display: grid; place-items: center; width: 28px; height: 26px; border: 0; background: transparent; color: var(--text-3) !important; border-radius: 5px; } +.workspace-tab-close { display: grid; place-items: center; width: 28px; height: 26px; border: 0; background: transparent; color: var(--text-3) !important; border-radius: var(--radius-xs); } .workspace-tab-close:hover { background: var(--bg-row-hover); } -.workspace .workspace-hide { border-radius: 6px; } +.workspace .workspace-hide { border-radius: var(--radius-sm); } .workspace-tabbar [data-testid="workspace-full"] .icon-svg { width: 12px; height: 12px; } .workspace-menu-anchor { position: relative; display: inline-flex; flex: none; } .workspace .menu { z-index: 60; color: var(--text-2); background: var(--bg-elevated); border: 1px solid var(--border-strong); box-shadow: 0 8px 24px #0004; min-width: 210px; } .workspace .menu-item { color: inherit; } .workspace .menu-item:hover, .workspace .menu-item:focus-visible { background: var(--bg-row-hover); } -.workspace-new-menu.menu { width: 241px; min-width: 241px; padding: 4px 6px; border-radius: 18px; top: calc(100% + 3px); } -.workspace-new-menu .menu-item { height: 28px; padding: 0 4px; display: flex; gap: 6px; font-size: 14px; border-radius: 11px; } +.workspace-new-menu.menu { width: 241px; min-width: 241px; padding: 4px 6px; border-radius: var(--radius-md); top: calc(100% + 3px); } +.workspace-new-menu .menu-item { height: 28px; padding: 0 4px; display: flex; gap: 6px; font-size: 14px; border-radius: var(--radius-sm); } .workspace-new-menu .menu-item span { flex: 1; white-space: nowrap; } .workspace-new-menu kbd { margin-left: 6px; padding: 0; border: 0; box-shadow: none; background: none; color: var(--text-3); font: inherit; } .workspace-pane { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--workspace-bg); } .workspace-navigation { padding: 8px 9px; display: flex; align-items: center; gap: 9px; flex: none; } -.workspace-history { display: flex; gap: 1px; align-items: center; background: var(--bg-elevated); border-radius: 30px; padding: 2px 5px; } +.workspace-history { display: flex; gap: 1px; align-items: center; background: var(--bg-elevated); border-radius: var(--radius-md); padding: 2px 5px; } .workspace-history > .history-separator { height: 17px; width: 1px; margin: 0 2px; background: var(--border-pane); } .workspace-address-form { flex: 1; min-width: 0; } -.workspace-address-form input { width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--border-composer); border-radius: 22px; outline: none; color: var(--text-1); background: var(--bg-row-hover); box-shadow: inset 0 0 0 1px #ffffff03; font: 14px var(--font-sans); } +.workspace-address-form input { width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--border-composer); border-radius: var(--radius-md); outline: none; color: var(--text-1); background: var(--bg-row-hover); box-shadow: inset 0 0 0 1px #ffffff03; font: 14px var(--font-sans); } .workspace-address-form input:focus { border-color: var(--accent); } .workspace-address-form input::placeholder { text-align: center; color: var(--text-placeholder); } -.workspace .icon-btn.workspace-circle { height: 34px; width: 34px; background: var(--bg-elevated); border-radius: 50%; color: var(--text-2); } +.workspace .icon-btn.workspace-circle { height: 34px; width: 34px; background: var(--bg-elevated); border-radius: var(--radius-sm); color: var(--text-2); } .workspace-start { padding: 31px 20px 20px; overflow-y: auto; } .workspace-start h2 { margin: 0 0 17px; font-size: 14px; font-weight: 500; } .workspace-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; } -.workspace-tools > button, .workspace-tools > span > button { width: 100%; height: 43px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; padding: 0 12px; background: var(--bg-sunken); font-size: 14px; text-align: left; } +.workspace-tools > button, .workspace-tools > span > button { width: 100%; height: 43px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: var(--radius-sm); padding: 0 12px; background: var(--bg-sunken); font-size: 14px; text-align: left; } .workspace-tools button:hover { background: var(--bg-elevated); } .workspace-tools button > span { flex: 1; white-space: nowrap; } .workspace-tools button > svg { flex: none; color: var(--text-3); } -.workspace-tools kbd { padding: 0 7px; font: 12px/18px var(--font-sans); border-radius: 14px; background: var(--bg-elevated); color: var(--text-3); white-space: nowrap; } +.workspace-tools kbd { padding: 0 7px; font: 12px/18px var(--font-sans); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-3); white-space: nowrap; } .workspace-error { color: var(--danger-text); padding: 10px 16px; margin: 0; overflow-wrap: anywhere; } .workspace-guest { flex: 1; min-height: 0; } .sheet.workspace-full { grid-template-columns: minmax(0, 1fr); } @@ -71,7 +71,7 @@ .review-file-heading .stat { font-family: inherit; font-size: 13px; } .file-code-icon { width: 17px; flex: none; color: var(--accent-warn); font: 13px var(--font-mono); } .review-tree { min-height: 0; min-width: 0; overflow: auto; border-left: 1px solid var(--border-pane); padding: 7px 7px 10px 4px; } -.review-filter { height: 28px; display: flex; align-items: center; gap: 7px; padding: 0 9px; margin-bottom: 6px; background: var(--bg-sunken); border: 1px solid var(--border-pane); border-radius: 9px; color: var(--text-3); } +.review-filter { height: 28px; display: flex; align-items: center; gap: 7px; padding: 0 9px; margin-bottom: 6px; background: var(--bg-sunken); border: 1px solid var(--border-pane); border-radius: var(--radius-sm); color: var(--text-3); } .review-filter input { min-width: 0; width: 100%; padding: 0; background: transparent; border: 0; outline: 0; color: var(--text-2); font-size: 13px; } .review-filter input::placeholder { color: var(--text-3); } .review-filter:focus-within { border-color: var(--accent); } @@ -79,7 +79,7 @@ .review-folder > summary::-webkit-details-marker { display: none; } .review-folder:not([open]) > summary svg { transform: rotate(-90deg); } .review-folder > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.review-file { display: flex; align-items: center; border-radius: 5px; height: 29px; } +.review-file { display: flex; align-items: center; border-radius: var(--radius-xs); height: 29px; } .review-file.selected, .workspace-file.selected { background: var(--bg-row-selected); } .review-file:hover { background: var(--bg-row-hover); } .review-file-select { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; height: 29px; background: transparent; border: 0; text-align: left; padding: 0 5px; font-size: 13px; } @@ -87,12 +87,12 @@ .review-file-select > svg { flex: none; color: var(--text-3); } .review-status { margin-left: auto; width: 14px; flex: none; text-align: center; font-size: 12px; } .review-status.add { color: var(--ok); } -.review-status.modified { color: var(--accent-warn); border: 1px solid var(--accent-warn); border-radius: 4px; line-height: 13px; } +.review-status.modified { color: var(--accent-warn); border: 1px solid var(--accent-warn); border-radius: var(--radius-xs); line-height: 13px; } .review-revert { width: 28px; height: 28px; flex: none; border: 0; background: transparent; color: var(--text-info) !important; opacity: 0; padding: 0; } .review-file:hover .review-revert, .review-file:focus-within .review-revert { opacity: 1; } .review-code { font: 12px/22px var(--font-mono); padding-bottom: 16px; min-width: fit-content; } .review-code.wrap { min-width: 0; } -.diff-fold { display: flex; align-items: center; gap: 9px; width: calc(100% - 13px); margin: 0 12px 0 1px; padding: 0; height: 32px; border: 0; border-radius: 7px; background: var(--bg-elevated); color: var(--text-3) !important; text-align: left; font: 12px/1 var(--font-sans); } +.diff-fold { display: flex; align-items: center; gap: 9px; width: calc(100% - 13px); margin: 0 12px 0 1px; padding: 0; height: 32px; border: 0; border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-3) !important; text-align: left; font: 12px/1 var(--font-sans); } .diff-fold svg { box-sizing: content-box; padding: 0 19px; height: 32px; border-right: 1px solid var(--border-pane); } .review-code-line { display: flex; align-items: flex-start; padding-right: 6px; } .line-number { width: 53px; flex: none; display: inline-block; padding-right: 10px; color: var(--text-4); text-align: right; font: italic 12px/22px var(--font-mono); user-select: none; } @@ -105,7 +105,7 @@ .syntax-string { color: var(--syntax-string); } .syntax-keyword { color: var(--syntax-keyword); } .syntax-number { color: var(--syntax-number); } -.workspace-file { width: 100%; border-radius: 5px; } +.workspace-file { width: 100%; border-radius: var(--radius-xs); } .workspace-file:hover { background: var(--bg-row-hover); } .workspace-file-content { margin: 0; font: 12px/22px var(--font-mono); } .workspace-file-content > div { display: flex; } @@ -144,7 +144,7 @@ .workspace-start h2, .workspace-tools > button, .workspace-tools > span > button { font-size: 12px; } .workspace-tools > button, .workspace-tools > span > button { gap: 4px; padding: 0 10px; } .workspace-tools .icon-svg { stroke-width: 1.25px; } -.workspace-tools > .workspace-terminal-tool { background: var(--bg-sunken); border-radius: 8px; } +.workspace-tools > .workspace-terminal-tool { background: var(--bg-sunken); border-radius: var(--radius-sm); } .workspace-tools > .workspace-terminal-tool > button:first-child { min-width: 0; flex: 1; padding-right: 4px; } .workspace-tools > .workspace-terminal-tool > .tooltip-anchor { flex: none; align-self: center; } .workspace-tools > .workspace-terminal-tool .icon-btn { width: 36px; height: 36px; flex: none; padding: 0; justify-content: center; } @@ -156,7 +156,7 @@ .workspace-canvas { display: flex; flex: 1; min-height: 0; flex-direction: column; position: relative; } .workspace-canvas[hidden] { display: none; } -.canvas-toolbar select { flex: 1; min-width: 0; max-width: 100%; color: var(--text-1); background: var(--workspace-raised); border: 1px solid var(--workspace-border); border-radius: 5px; padding: 4px; font: inherit; } +.canvas-toolbar select { flex: 1; min-width: 0; max-width: 100%; color: var(--text-1); background: var(--workspace-raised); border: 1px solid var(--workspace-border); border-radius: var(--radius-xs); padding: 4px; font: inherit; } .canvas-toolbar select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .canvas-loading { position: absolute; top: 45px; left: 12px; } .browser-tools-modal { width: min(620px, calc(100vw - 48px)); max-height: calc(100vh - 64px); overflow-y: auto; padding: 24px; } @@ -176,9 +176,9 @@ .review-summary svg { flex: none; } .review-summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .review-toolbar .stat, .review-count { flex: none; font-variant-numeric: tabular-nums; } -.review-count { color: var(--text-3); font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--bg-row-hover); } +.review-count { color: var(--text-3); font-size: 11px; padding: 0 5px; border-radius: var(--radius-xs); background: var(--bg-row-hover); } .workspace button:focus-visible, .workspace summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } -.workspace-tab [role="tab"] { border-radius: 6px; } +.workspace-tab [role="tab"] { border-radius: var(--radius-sm); } /* At the default width, a bounded file list sits above a full-width diff. Expanding the rail restores the side-by-side view without resetting selection or scroll. */ @container (max-width: 520px) { @@ -195,7 +195,7 @@ .subagent-list { width: 100%; max-width: 720px; margin: 0 auto; padding: 14px 24px 24px; } .subagent-list h3 { margin: 14px 8px 8px; font-size: var(--text-sm); font-weight: var(--weight-regular, 400); color: var(--text-3); } .subagent-list .hint { margin: 4px 8px 18px; color: var(--text-3); font-size: var(--text-sm); } -.subagent-row { width: 100%; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text-1); font: inherit; font-size: var(--text-md); text-align: left; cursor: pointer; } +.subagent-row { width: 100%; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-1); font: inherit; font-size: var(--text-md); text-align: left; cursor: pointer; } .subagent-row:hover { background: var(--bg-row-hover); } .subagent-row:focus-visible, .subagent-more:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } .subagent-name { flex: 1 1 60%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } @@ -217,21 +217,21 @@ /* Files: a breadcrumb whose crumbs open the folder tree, actions on the right, and the file below. */ .file-bar { position: relative; flex: none; display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 8px; border-bottom: 1px solid var(--border-pane); } -.file-crumbs { display: flex; align-items: center; min-width: 0; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--bg-composer); font-size: 13.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; } +.file-crumbs { display: flex; align-items: center; min-width: 0; height: 32px; padding: 0 12px; border-radius: var(--radius-md); background: var(--bg-composer); font-size: 13.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; } .file-crumbs > span { display: inline-flex; align-items: center; min-width: 0; } .file-crumbs svg { flex: none; margin: 0 8px; color: var(--text-4); } .workspace-files .file-crumbs button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; } .workspace-files .file-crumbs button:hover, .workspace-files .file-crumbs button[aria-expanded="true"] { color: var(--text-1); } .file-crumbs strong { overflow: hidden; text-overflow: ellipsis; color: var(--text-1); font-weight: 500; } -.workspace-files .file-pill { flex: none; display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 13px; border: 0; border-radius: 16px; background: var(--bg-composer); color: var(--text-1); font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; } +.workspace-files .file-pill { flex: none; display: inline-flex; align-items: center; gap: 9px; height: 32px; padding: 0 13px; border: 0; border-radius: var(--radius-md); background: var(--bg-composer); color: var(--text-1); font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; } .workspace-files .file-pill:hover { background: var(--bg-row-hover); } -.workspace-files .file-round { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--bg-composer); color: var(--text-2); } -.file-crumb-pop { position: absolute; z-index: 30; top: 46px; left: 8px; width: min(384px, calc(100% - 16px)); max-height: min(320px, 60vh); overflow: auto; padding: 5px; border: 1px solid var(--border-pane); border-radius: 14px; background: var(--bg-elevated); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); overscroll-behavior: contain; } +.workspace-files .file-round { flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: var(--bg-composer); color: var(--text-2); } +.file-crumb-pop { position: absolute; z-index: 30; top: 46px; left: 8px; width: min(384px, calc(100% - 16px)); max-height: min(320px, 60vh); overflow: auto; padding: 5px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: var(--bg-elevated); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); overscroll-behavior: contain; } .file-tree { list-style: none; margin: 0; padding: 0; } .file-tree .file-tree { position: relative; } .file-tree .file-tree::before { content: ""; position: absolute; top: 0; bottom: 0; left: 13px; width: 1px; background: var(--border-pane); } .file-tree .file-tree .file-tree::before { left: 30px; } -.workspace-files .file-tree-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--text-1); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; } +.workspace-files .file-tree-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--text-1); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; } .file-tree-row > svg { flex: none; color: var(--text-3); } .file-tree-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .workspace-files .file-tree-row:hover, .workspace-files .file-tree-row.selected { background: var(--bg-row-hover); } diff --git a/apps/store-desktop/src/renderer/store.css b/apps/store-desktop/src/renderer/store.css index 29e768cb..718f2d07 100644 --- a/apps/store-desktop/src/renderer/store.css +++ b/apps/store-desktop/src/renderer/store.css @@ -4,7 +4,7 @@ .store-demo-banner { position: absolute; inset: 0 0 auto; min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 84px; background: var(--bg-elevated); color: var(--text-1); border-bottom: 1px solid var(--border-pane); z-index: 10; } .store-demo-banner > div { display: grid; gap: 4px; flex: 1; font-size: 12px; } .store-demo-banner span { font-size: 11px; color: var(--text-3); } -.store-demo-banner button, .host-demo { background: transparent; color: #f386a1; border: 1px solid #f386a160; border-radius: 8px; padding: 9px 12px; cursor: pointer; } +.store-demo-banner button, .host-demo { background: transparent; color: #f386a1; border: 1px solid #f386a160; border-radius: var(--radius-sm); padding: 9px 12px; cursor: pointer; } .store-demo-banner button:focus-visible { outline: 2px solid #f386a1; outline-offset: 3px; } .host-demo { width: 100%; display: flex; justify-content: space-between; margin-top: 24px; min-height: 48px; align-items: center; font-weight: 600; } .host-connection { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 55% 20%, #1c1c302e, transparent 65%), #080c17f7; overflow: auto; padding: 60px 24px; color: #f3f1f5; } @@ -12,7 +12,7 @@ .host-card { width: min(100%, 440px); } .host-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 600; letter-spacing: -.6px; } .host-brand img { width: 27px; height: 34px; object-fit: contain; } -.host-preview { margin-left: auto; color: #b2b6c6; font-size: 10px; font-weight: 400; letter-spacing: .1px; border: 1px solid #ffffff1f; border-radius: 5px; padding: 5px 8px; } +.host-preview { margin-left: auto; color: #b2b6c6; font-size: 10px; font-weight: 400; letter-spacing: .1px; border: 1px solid #ffffff1f; border-radius: var(--radius-xs); padding: 5px 8px; } .host-eyebrow { color: #f386a1; font-size: 10px; letter-spacing: 1.8px; margin-top: 45px; } .host-card h1 { font-size: 34px; line-height: 1.2; letter-spacing: -1.3px; font-weight: 550; margin: 14px 0 20px; } .host-description { color: #b2b6c6; font-size: 15px; line-height: 1.65; } @@ -20,9 +20,9 @@ .host-instructions strong { font-weight: 500; color: #f3f1f5; } .host-card form { display: grid; gap: 10px; margin-top: 26px; } .host-card label { font-size: 12px; color: #b2b6c6; } -.host-card input { width: 100%; height: 48px; border: 1px solid #ffffff24; border-radius: 10px; background: #101625; padding: 0 14px; font-size: 13px; color: #f3f1f5; } +.host-card input { width: 100%; height: 48px; border: 1px solid #ffffff24; border-radius: var(--radius-sm); background: #101625; padding: 0 14px; font-size: 13px; color: #f3f1f5; } .host-card input:focus-visible, .host-card button:focus-visible { outline: 2px solid #f386a1; outline-offset: 3px; } -.host-connect, .host-card form button { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; min-height: 48px; border: none; border-radius: 10px; background: #f386a1; color: #12111a; font-size: 13px; font-weight: 600; margin-top: 6px; cursor: pointer; } +.host-connect, .host-card form button { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; min-height: 48px; border: none; border-radius: var(--radius-sm); background: #f386a1; color: #12111a; font-size: 13px; font-weight: 600; margin-top: 6px; cursor: pointer; } .host-card button:disabled { opacity: .45; cursor: default; } .host-footnote { color: #a3a9ba; font-size: 11px; line-height: 1.7; margin-top: 18px; } .host-error { border-left: 2px solid #f386a1; padding-left: 12px; color: #f3b3c4; line-height: 1.7; font-size: 12px; margin-top: 20px; } diff --git a/apps/web/src/web.css b/apps/web/src/web.css index 5c589bde..59a3cd1a 100644 --- a/apps/web/src/web.css +++ b/apps/web/src/web.css @@ -6,7 +6,7 @@ .web-banner p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; flex: 1 1 320px; min-width: 0; margin: 0; font-size: 12px; line-height: 1.5; } .web-banner strong { font: var(--weight-semibold) 10px/1.8 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); } .web-banner p span { color: var(--text-3); } -.web-banner button, .web-download { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; color: var(--text-1); font-size: 12.5px; font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--duration-fast) var(--ease-out); } +.web-banner button, .web-download { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--text-1); font-size: 12.5px; font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--duration-fast) var(--ease-out); } .web-banner button:hover { background: var(--bg-row-hover); } .web-banner .web-download { border-color: var(--accent-strong); background: var(--accent-strong); color: var(--accent-ink); font-weight: var(--weight-semibold); } .web-banner .web-download:hover { background: var(--accent-strong-hover); } @@ -17,12 +17,12 @@ .web-shell { display: block; height: auto; min-height: 100dvh; background: var(--bg-main); } .web-banner, .web-workspace { display: none; } .web-narrow { display: grid; align-content: center; min-height: 100dvh; padding: 24px 16px; } - .web-narrow section { padding: 24px; border: 1px solid var(--border-pane); border-radius: 12px; background: linear-gradient(145deg, var(--bg-composer-context), var(--bg-main)); box-shadow: 0 2px 4px #0002, 0 16px 36px #0002, inset 0 1px #ffffff0c; } - .web-narrow-mark { display: grid; place-items: center; width: 56px; height: 62px; margin-bottom: 24px; border: 1px solid var(--border-pane); border-radius: 10px; background: var(--bg-composer-context); box-shadow: 0 6px 0 var(--bg-sunken), 0 10px 20px #0003; } + .web-narrow section { padding: 24px; border: 1px solid var(--border-pane); border-radius: var(--radius-md); background: linear-gradient(145deg, var(--bg-composer-context), var(--bg-main)); box-shadow: 0 2px 4px #0002, 0 16px 36px #0002, inset 0 1px #ffffff0c; } + .web-narrow-mark { display: grid; place-items: center; width: 56px; height: 62px; margin-bottom: 24px; border: 1px solid var(--border-pane); border-radius: var(--radius-sm); background: var(--bg-composer-context); box-shadow: 0 6px 0 var(--bg-sunken), 0 10px 20px #0003; } .web-narrow-mark .brand-mark { width: 28px; height: 36px; } .web-kicker { margin: 0 0 12px; color: var(--accent); font: var(--weight-semibold) 10px/1.5 var(--font-mono); letter-spacing: .16em; } .web-narrow h1 { margin: 0; color: var(--text-1); font-size: 32px; font-weight: var(--weight-semibold); letter-spacing: -.045em; line-height: 1.12; text-wrap: balance; } .web-narrow p:not(.web-kicker) { margin: 16px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.65; } - .web-narrow .web-download { display: flex; justify-content: space-between; min-height: 48px; margin-top: 24px; padding: 10px 16px; border: 1px solid var(--accent-strong); border-radius: 8px; background: var(--accent-strong); color: var(--accent-ink); font-size: 14px; font-weight: var(--weight-semibold); text-decoration: none; } + .web-narrow .web-download { display: flex; justify-content: space-between; min-height: 48px; margin-top: 24px; padding: 10px 16px; border: 1px solid var(--accent-strong); border-radius: var(--radius-sm); background: var(--accent-strong); color: var(--accent-ink); font-size: 14px; font-weight: var(--weight-semibold); text-decoration: none; } .web-narrow .web-narrow-note { color: var(--text-3); font-size: 12px; } } diff --git a/docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md b/docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md new file mode 100644 index 00000000..4cb14a30 --- /dev/null +++ b/docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md @@ -0,0 +1,366 @@ +# Chat Refresh Foundation (PR 1 of 5) Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Give the renderer one radius scale, three tint tokens and one in-app confirm dialog that replaces every `window.confirm`, so the later chat-refresh PRs build on them. + +**Architecture:** Tokens change in `tokens.css` and every renderer stylesheet moves its hard-coded radii onto them, guarded by a file-scanning test. Confirmations go through a small module-level store (`confirmDialog(options): Promise`) rendered by one `ConfirmHost` mounted in `App`, so the desktop app, the Store edition and the web demo get it without each call site owning dialog state. + +**Tech Stack:** Existing TypeScript, React 19, Electron, Playwright, `node:test`; pinned pnpm. No new dependencies. + +**Spec:** `docs/superpowers/specs/2026-11-15-chat-prompts-refresh-design.md`, sections "Shared: tokens and buttons" and "1. Confirm dialog". PRs 2 to 5 (menus, transcript, request panel, composer) each get their own plan from the same spec. + +## Global Constraints + +- Radius scale, exact values: surface `8px` (`--radius-md`, `--radius-composer`, `--radius-sheet`), control `6px` (`--radius-sm`, `--radius-row`, `--radius-pill`), part `4px` (`--radius-xs`, new). +- New tokens live in the base `:root` block of `tokens.css` only. No theme block gains or changes a token (the brand plan asserts the `coven` block exactly). +- `--tint: color-mix(in srgb, var(--text-1) 5%, transparent)`, `--tint-strong` at `9%`, `--hairline` at `11%`. +- Nothing is circular or pill-shaped except status dots, progress dots and spinners. +- The sweep covers `apps/desktop/src/renderer`, `apps/web/src` and `apps/store-desktop/src`. `apps/site` (the landing page) is not touched. +- Every existing confirmation sentence keeps all of its facts, split across title, body, path and facts. No fact is dropped and none is invented. +- Strings shown in Streamer Mode keep going through `privateLabel` where they do today (thread delete, discard changes). +- No behavior change beyond the confirmation surface: the same actions run on accept, nothing runs on cancel. +- Repo rules (`AGENTS.md`): work in the `chat-refresh-foundation` worktree, signed commits, PR, `pnpm build && pnpm test && pnpm test:e2e` green before merge, `docs/status.md` updated in the PR. + +## Review Focus + +1. **A confirm opened from inside Settings** (Reset learning, Remove connection). Settings traps Tab and closes on Escape with a capture listener on `document`. Expected: Escape cancels only the confirm, Tab stays inside the confirm, Settings stays open. Pinned in Task 3 (e2e "a confirm over Settings…"). +2. **Two confirmations requested at once** (a second action fires while one is open). Expected: they are answered one at a time, first in first out; neither is lost. Pinned in Task 2 (unit). +3. **A keyboard shortcut pressed while a confirm is open** (⌘N, ⌘J, ⌘.). Expected: nothing behind the dialog reacts. Pinned in Task 3 (e2e). +4. **The element that opened the confirm is gone when it closes** (a menu row that unmounts). Expected: no error; focus falls back to the message box or stays on the body. Pinned in Task 3 (e2e delete from the thread menu). +5. **A circle that should stay a circle** (status dot, spinner, switch thumb is not one). Expected: dots and spinners keep `50%`; the count per file is pinned so a new circle is a deliberate edit. Pinned in Task 1. + +--- + +### Task 1: Radius scale and tint tokens + +**Files:** +- Modify: `apps/desktop/src/renderer/tokens.css` (base `:root`) +- Modify: every `*.css` under `apps/desktop/src/renderer`, `apps/web/src`, `apps/store-desktop/src` +- Modify: `apps/desktop/e2e/layout.spec.ts:114,168,203,223,245,266` +- Modify: `apps/desktop/design/tokens.md` (new section "Radius scale") +- Create: `scripts/test/radius-scale.test.mjs` + +**Interfaces:** +- Consumes: nothing. +- Produces: CSS custom properties `--radius-xs` (4px), `--tint`, `--tint-strong`, `--hairline`; changed values for `--radius-row` (6px), `--radius-md` (8px), `--radius-composer` (8px), `--radius-sheet` (8px), `--radius-pill` (6px). `--radius-sm` stays 6px. + +- [ ] **Step 1: Write the failing test** in `scripts/test/radius-scale.test.mjs` + +```js +import test from 'node:test'; +import assert from 'node:assert/strict'; +import fs from 'node:fs'; +import path from 'node:path'; + +const root = new URL('../../', import.meta.url).pathname; +const DIRS = ['apps/desktop/src/renderer', 'apps/web/src', 'apps/store-desktop/src']; +const files = DIRS.flatMap((dir) => fs.readdirSync(path.join(root, dir), { recursive: true }) + .filter((f) => f.endsWith('.css')).map((f) => path.join(dir, f))); +const read = (f) => fs.readFileSync(path.join(root, f), 'utf8'); +const radii = (css) => [...css.matchAll(/border(?:-(?:top|bottom)-(?:left|right))?-radius:\s*([^;}]+)/g)].map((m) => m[1].trim()); +const TOKEN = /^var\(--radius-(xs|sm|row|md|composer|sheet|pill)\)$/; +const PART = (v) => TOKEN.test(v) || ['0', '1px', '2px', 'inherit', '50%'].includes(v); + +test('the scale is 8 px surfaces, 6 px controls, 4 px parts', () => { + const base = read('apps/desktop/src/renderer/tokens.css').match(/:root\s*\{([^}]*)\}/)[1]; + const token = (name) => base.match(new RegExp(`${name}:\\s*([^;]+);`))?.[1].trim(); + assert.deepEqual( + ['--radius-xs', '--radius-sm', '--radius-row', '--radius-md', '--radius-composer', '--radius-sheet', '--radius-pill'].map(token), + ['4px', '6px', '6px', '8px', '8px', '8px', '6px']); + assert.equal(token('--tint'), 'color-mix(in srgb, var(--text-1) 5%, transparent)'); + assert.equal(token('--tint-strong'), 'color-mix(in srgb, var(--text-1) 9%, transparent)'); + assert.equal(token('--hairline'), 'color-mix(in srgb, var(--text-1) 11%, transparent)'); +}); + +test('no theme block redefines a radius or tint token', () => { + const css = read('apps/desktop/src/renderer/tokens.css'); + for (const [, block] of css.matchAll(/:root\[data-theme="[a-z]+"\]\s*\{([^}]*)\}/g)) assert.doesNotMatch(block, /--(radius|tint|hairline)/); +}); + +test('every radius in the renderer is a token, a hairline value or a dot', () => { + for (const file of files) for (const value of radii(read(file))) { + assert.ok(value.split(/\s+/).every(PART), `${file}: border-radius: ${value}`); + } +}); + +test('circles are limited to dots, spinners and markers', () => { + // A new circle is a deliberate edit to this table. + const CIRCLES = { 'apps/desktop/src/renderer/styles.css': 6, 'apps/desktop/src/renderer/usage/usage.css': 3, + 'apps/desktop/src/renderer/space/knowledge.css': 1, 'apps/desktop/src/renderer/workspace.css': 1, 'apps/store-desktop/src/renderer/store.css': 2 }; + const found = Object.fromEntries(files.map((f) => [f, radii(read(f)).filter((v) => v === '50%').length]).filter(([, n]) => n > 0)); + assert.deepEqual(found, CIRCLES); +}); +``` + +- [ ] **Step 2: Run it and confirm it fails** + +Run: `node --test scripts/test/radius-scale.test.mjs` +Expected: FAIL on the first test with `'10px'` for `--radius-row`. + +- [ ] **Step 3: Change the tokens** + +In base `:root` of `tokens.css`: set the five changed radius tokens, add `--radius-xs: 4px;` before `--radius-sm`, and add the three tint tokens after `--rule`. Update each token's trailing comment to say "radius scale" instead of "measured". + +- [ ] **Step 4: Sweep the stylesheets** + +Replace each hard-coded radius by value, per component of a multi-value radius: + +| Was | Becomes | +| --- | --- | +| `12px` and larger, except 15 and 17 | `var(--radius-md)` | +| `6px` to `11px`, and `15px`, `17px` | `var(--radius-sm)` | +| `3px` to `5px` | `var(--radius-xs)` | +| `999px` | `var(--radius-pill)` | +| `0`, `1px`, `2px`, `inherit` | unchanged | +| `50%` on a dot, spinner or marker (the selectors counted in the test) | unchanged | +| `50%` on a button, avatar or icon tile 18 px or larger | `var(--radius-sm)`; `.failure-icon`, `.space-comment-start svg`, `.st-switch::after` use `var(--radius-xs)` | + +Rewrite the comment above `.icon-btn.send-btn` in `styles.css`: the send button is a 34 px square with the control radius. + +- [ ] **Step 5: Update the layout assertions** + +`layout.spec.ts`: `"--radius-row": "6px", "--radius-composer": "8px"` (line 114); sheet `"8px"` (168); thread row `"6px"` (203); composer box `"8px"` (223); send `"6px"` (245); bubble `"8px"` (266). + +- [ ] **Step 6: Record the scale in `apps/desktop/design/tokens.md`** + +Add a "Radius scale" section: the three steps, their tokens and old values, the rule that only dots and spinners are round, and that `scripts/test/radius-scale.test.mjs` enforces it. + +- [ ] **Step 7: Run the test** + +Run: `node --test scripts/test/radius-scale.test.mjs` +Expected: PASS, 4 tests. + +- [ ] **Step 8: Commit** + +```bash +git add apps/desktop/src/renderer apps/web/src apps/store-desktop/src apps/desktop/e2e/layout.spec.ts apps/desktop/design/tokens.md scripts/test/radius-scale.test.mjs +git commit -S -m "feat(ui): one radius scale and tint tokens across the renderer" +``` + +--- + +### Task 2: Confirm store + +**Files:** +- Create: `apps/desktop/src/renderer/confirm.ts` +- Create: `apps/desktop/test/confirm.test.ts` + +**Interfaces:** +- Consumes: nothing. The file imports no DOM or React type, so `tsconfig.main.json` can compile it for the unit test. +- Produces: + +```ts +export type ConfirmTone = "neutral" | "warn" | "danger"; +export type ConfirmIcon = "info" | "alert" | "trash" | "changes" | "restart" | "folder" | "stack"; +export interface ConfirmFact { kind: "kept" | "lost"; text: string } +export interface ConfirmOptions { title: string; body?: string; path?: string; facts?: ConfirmFact[]; confirmLabel: string; tone?: ConfirmTone; icon?: ConfirmIcon } +export interface ConfirmRequest extends ConfirmOptions { id: number } +export function confirmDialog(options: ConfirmOptions): Promise; +export function currentConfirm(): ConfirmRequest | null; // the oldest unanswered request; stable identity until it settles +export function settleConfirm(id: number, accepted: boolean): void; // ignores an id that is not current +export function subscribeConfirm(listener: () => void): () => void; +export function resetConfirms(): void; // settles every pending request as false +``` + +- [ ] **Step 1: Write the failing test** in `apps/desktop/test/confirm.test.ts` + +```ts +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { confirmDialog, currentConfirm, resetConfirms, settleConfirm, subscribeConfirm } from "../src/renderer/confirm.js"; + +const ask = (title: string) => confirmDialog({ title, confirmLabel: "OK" }); + +test("a request is current until it is settled, and resolves with the answer", async () => { + resetConfirms(); + const answer = ask("one"); + const current = currentConfirm()!; + assert.equal(current.title, "one"); + assert.equal(currentConfirm(), current, "stable identity for useSyncExternalStore"); + settleConfirm(current.id, true); + assert.equal(await answer, true); + assert.equal(currentConfirm(), null); +}); + +test("requests are answered one at a time, first in first out", async () => { + resetConfirms(); + const first = ask("first"), second = ask("second"); + assert.equal(currentConfirm()!.title, "first"); + settleConfirm(currentConfirm()!.id, false); + assert.equal(await first, false); + assert.equal(currentConfirm()!.title, "second"); + settleConfirm(currentConfirm()!.id, true); + assert.equal(await second, true); +}); + +test("settling an id that is not current changes nothing", async () => { + resetConfirms(); + const answer = ask("only"); + const id = currentConfirm()!.id; + settleConfirm(id + 1, true); + assert.equal(currentConfirm()!.id, id); + settleConfirm(id, true); settleConfirm(id, false); + assert.equal(await answer, true); +}); + +test("listeners hear every change, and reset answers everything with false", async () => { + resetConfirms(); + let calls = 0; + const stop = subscribeConfirm(() => { calls++; }); + const a = ask("a"), b = ask("b"); + assert.equal(calls, 1, "the second request does not change what is current"); + resetConfirms(); + assert.deepEqual(await Promise.all([a, b]), [false, false]); + assert.equal(calls, 2); + stop(); + void ask("c"); + assert.equal(calls, 2); + resetConfirms(); +}); +``` + +- [ ] **Step 2: Run it and confirm it fails** + +Run: `cd apps/desktop && pnpm run build:main && node --test dist/test/confirm.test.js` +Expected: FAIL; the module does not exist. + +- [ ] **Step 3: Implement `confirm.ts`** with the signatures above: a module-level queue of `{ request, resolve }`, a `Set` of listeners, ids from a counter. Listeners are told only when `currentConfirm()` changes. + +- [ ] **Step 4: Run the test** + +Run: the same command. Expected: PASS, 4 tests. + +- [ ] **Step 5: Commit** + +```bash +git add apps/desktop/src/renderer/confirm.ts apps/desktop/test/confirm.test.ts +git commit -S -m "feat(ui): confirm request store" +``` + +--- + +### Task 3: Confirm dialog and its ten call sites + +**Files:** +- Create: `apps/desktop/src/renderer/components/ConfirmDialog.tsx` +- Modify: `apps/desktop/src/renderer/components/ui/Icon.tsx` (add `alert`) +- Modify: `apps/desktop/src/renderer/styles.css` (confirm styles) +- Modify: `apps/desktop/src/renderer/App.tsx` (mount `ConfirmHost`; lines 893, 922, 940, 971) +- Modify: `components/Composer.tsx:330`, `components/ThreadView.tsx:491`, `components/SettingsDialog.tsx:217`, `components/LocalModelsSettings.tsx:118`, `routines/RoutinesView.tsx:176,321` +- Modify: `apps/desktop/e2e/support.ts` (helper) +- Modify: `e2e/settings-transactions.spec.ts:78,295`, `project-remove.spec.ts:58,70,87`, `review.spec.ts:216-221,376-380`, `local-models.spec.ts:125`, `local-model-acceptance.spec.ts:132-139`, `terminal.spec.ts:169`, `sidebar-workspaces.spec.ts:10,43`, `approval-policy.spec.ts:41-46` +- Create: `apps/desktop/e2e/confirm-dialog.spec.ts` + +**Interfaces:** +- Consumes: Task 2's store; Task 1's tokens. +- Produces: `ConfirmHost(): JSX.Element | null`, rendered once inside `App`. Test ids: `confirm-dialog` (the `role="alertdialog"` element, with `data-tone`), `confirm-title`, `confirm-body`, `confirm-path`, `confirm-fact` (each has `data-kind`), `confirm-cancel`, `confirm-accept`. E2E helper `answerConfirm(page: Page, answer: "accept" | "cancel", text?: string | RegExp): Promise`: waits for the dialog, optionally asserts it contains `text`, clicks the button, waits for the dialog to go. + +Confirmation copy, exact. Tone and icon in brackets; `facts` as kept (✓) or lost (✕). + +| Site | Title | Body | Facts and path | Button | +| --- | --- | --- | --- | --- | +| YOLO (Composer, ThreadView) [warn, alert] | Turn on YOLO for this thread? | Every action in this thread is approved without asking, including access outside the sandbox. | ✓ Your Never rules still refuse. | Turn on YOLO | +| Cloud model (`App.tsx:893`) [neutral, stack] | Use cloud model `${cloud.label}`? | Future messages will go to that model in a fresh conversation. | path `${cloud.id}`; ✓ Existing messages will stay in the transcript. | Use cloud model | +| Delete thread with worktree (`:922`) [danger, trash] | Delete this thread and remove its worktree? | none | path `privateLabel(t.worktree.path)`; ✕ Uncommitted changes there will be lost. ✓ `privateLabel(\`The branch ${t.worktree.branch} is kept.\`)` | Delete thread | +| Remove project (`:940`) [warn, folder] | Remove this project from Modex? | none | ✓ Files on disk are not touched. ✓ Its notes stay in Space. (second only when `spaceEnabled`) | Remove project | +| Discard changes (`:971`) [danger, changes] | `privateLabel(\`Discard changes to ${path}?\`)` | This cannot be undone. | none | Discard changes | +| Reset learning (Settings) [danger, restart] | Reset Auto routing's learned preferences? | This applies immediately and cannot be undone. | none | Reset learning | +| Remove connection (Local models) [danger, trash] | Remove `${c.label}`? | Choose another model before sending on a thread that used this connection. | ✓ Past conversations stay readable. | Remove connection | +| Delete task (Routines, both) [danger, trash] | Delete the task “`${name}`”? | none | ✓ Its runs stay in All activity. ✓ Its page stays in Space. | Delete task | + +- [ ] **Step 1: Write the failing e2e spec** `apps/desktop/e2e/confirm-dialog.spec.ts` + +Launch with `seedHome()` and `launch(home)`, one project. Tests: + +```ts +test("removing a project asks in the app, Cancel has focus, and cancelling changes nothing", async () => { + let native = 0; page.on("dialog", (d) => { native++; void d.dismiss(); }); + await tid(page, "project").first().hover(); await tid(page, "project-menu").first().click(); await tid(page, "project-remove").click(); + const dialog = tid(page, "confirm-dialog"); + await expect(dialog).toHaveAttribute("role", "alertdialog"); + await expect(dialog).toHaveAttribute("data-tone", "warn"); + await expect(tid(dialog, "confirm-title")).toHaveText("Remove this project from Modex?"); + await expect(tid(dialog, "confirm-fact").first()).toHaveText("Files on disk are not touched."); + await expect(tid(dialog, "confirm-cancel")).toBeFocused(); + await page.keyboard.press("Tab"); await expect(tid(dialog, "confirm-accept")).toBeFocused(); + await page.keyboard.press("Tab"); await expect(tid(dialog, "confirm-cancel")).toBeFocused(); + await page.keyboard.press("Escape"); + await expect(dialog).toHaveCount(0); + await expect(tid(page, "project")).toHaveCount(1); + expect(native).toBe(0); +}); + +test("shortcuts do nothing behind an open confirm", async () => { + // open the same confirm, press Meta+j and Meta+n, assert changes-panel visibility and draft-view are unchanged, then cancel +}); + +test("a confirm over Settings: Escape cancels the confirm and Settings stays open", async () => { + // open-settings, click "Reset learning…" when the button exists (skip when routing has nothing to reset), + // Escape, expect confirm-dialog count 0 and tid(page, "settings") visible +}); + +test("accepting runs the action once and the dialog closes", async () => { + // project-remove, answerConfirm(page, "accept", "Remove this project"), expect project count 0 +}); +``` + +The two outlined tests assert exactly what their comments say. + +- [ ] **Step 2: Run it and confirm it fails** + +Run: `cd apps/desktop && pnpm run build && pnpm exec playwright test e2e/confirm-dialog.spec.ts` +Expected: FAIL; `confirm-dialog` never appears. + +- [ ] **Step 3: Add the `alert` icon** to `PATHS` in `ui/Icon.tsx`: `alert: "M8 2.5l6 10.5H2zM8 6.5v3M8 11.25h.01"`. + +- [ ] **Step 4: Implement `ConfirmHost` in `components/ConfirmDialog.tsx`** + +`useSyncExternalStore(subscribeConfirm, currentConfirm)`; render nothing without a request; otherwise `createPortal` to `document.body`: + +- Backdrop `.modal-backdrop.confirm-backdrop`; a pointer down on the backdrop itself cancels. +- Dialog `.modal.confirm.tone-` with `role="alertdialog"`, `aria-modal="true"`, `aria-labelledby`, `aria-describedby` (body when present, else title), `data-tone`. +- Default tone `neutral`; default icon `info`. The accept button is `.btn.primary` for neutral, `.btn.solid-warn` or `.btn.solid-danger` otherwise. +- On mount (keyed by request id): remember `document.activeElement`, focus Cancel. On unmount: focus the remembered element when it is still connected. +- One capture listener on `window` for `keydown` while open: Escape cancels; Tab and Shift+Tab move between the two buttons; every key event has `stopPropagation()` called so nothing behind the dialog handles it. Default actions are left alone, so Enter and Space still press the focused button. + +- [ ] **Step 5: Add the styles** to `styles.css` after the `.modal` rules: the confirm block from the prototype stylesheet (`claude/chat-refresh/prototype/proposed.css`, section "Confirm dialog" and the `.confirm .btn` rules), unscoped, with radii as `var(--radius-md)` and `var(--radius-sm)`. Add `forced-colors` and `prefers-reduced-motion` rules: no animation; borders `CanvasText`. + +- [ ] **Step 6: Mount it** as the last child of `App`'s root element in `App.tsx`: ``. + +- [ ] **Step 7: Replace the ten calls** with `confirmDialog({...})` using the copy table. Synchronous handlers become `void confirmDialog(...).then((ok) => { if (ok) … })`; `async` ones `await` it. In `SettingsDialog.resetLearning`, check `operationRef.current` before asking and again after the answer. In `ThreadView`, YOLO keeps today's behavior: on accept it calls `onPolicy("yolo")` only. + +- [ ] **Step 8: Add `answerConfirm` to `e2e/support.ts`** and update the specs listed under Files: remove each `page.once("dialog", …)` that answered a confirm and call `answerConfirm` after the click that opens it, passing the text the old handler asserted (`/Reset Auto routing's learned preferences/`, `"Discard changes to b.txt?"`, `"fixture-cloud"`). `sidebar-workspaces.spec.ts` drops its blanket handler and answers the one project removal. `approval-policy.spec.ts` drops both `window.confirm` stubs: cancel the first YOLO, accept the second. + +- [ ] **Step 9: Run the specs this task touched** + +Run: `cd apps/desktop && pnpm run build && pnpm exec playwright test e2e/confirm-dialog.spec.ts e2e/settings-transactions.spec.ts e2e/project-remove.spec.ts e2e/review.spec.ts e2e/local-models.spec.ts e2e/local-model-acceptance.spec.ts e2e/terminal.spec.ts e2e/sidebar-workspaces.spec.ts e2e/approval-policy.spec.ts e2e/layout.spec.ts` +Expected: PASS. Then `git grep -n "window.confirm" -- apps` prints nothing. + +- [ ] **Step 10: Commit** + +```bash +git add apps/desktop/src/renderer apps/desktop/e2e +git commit -S -m "feat(ui): in-app confirm dialog replaces window.confirm" +``` + +--- + +### Task 4: Documents and the full check + +**Files:** +- Create: `docs/superpowers/specs/2026-11-15-chat-prompts-refresh-design.md` (the approved design) +- Modify: `docs/status.md` ("In flight") + +- [ ] **Step 1:** Add the design document and an "In flight" entry: the chat refresh, PR 1 of 5, what it changes, and that PRs 2 to 5 follow the same spec. +- [ ] **Step 2: Run everything CI runs** + +Run: `pnpm build && pnpm test && pnpm test:e2e` +Expected: PASS. + +- [ ] **Step 3: Commit, push, open the PR** titled "Chat refresh 1/5: radius scale, tints and in-app confirm dialog". Do not merge without Val's review. + +```bash +git add docs +git commit -S -m "docs: chat refresh design, foundation plan and status" +``` diff --git a/scripts/test/radius-scale.test.mjs b/scripts/test/radius-scale.test.mjs new file mode 100644 index 00000000..b41f046e --- /dev/null +++ b/scripts/test/radius-scale.test.mjs @@ -0,0 +1,43 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import fs from 'node:fs'; +import path from 'node:path'; + +const root = new URL('../../', import.meta.url).pathname; +const DIRS = ['apps/desktop/src/renderer', 'apps/web/src', 'apps/store-desktop/src']; +const files = DIRS.flatMap((dir) => fs.readdirSync(path.join(root, dir), { recursive: true }) + .filter((f) => f.endsWith('.css')).map((f) => path.join(dir, f))); +const read = (f) => fs.readFileSync(path.join(root, f), 'utf8'); +const radii = (css) => [...css.matchAll(/border(?:-(?:top|bottom)-(?:left|right))?-radius:\s*([^;}]+)/g)].map((m) => m[1].trim()); +const TOKEN = /^var\(--radius-(xs|sm|row|md|composer|sheet|pill)\)$/; +const PART = (v) => TOKEN.test(v) || ['0', '1px', '2px', 'inherit', '50%'].includes(v); + +test('the scale is 8 px surfaces, 6 px controls, 4 px parts', () => { + const base = read('apps/desktop/src/renderer/tokens.css').match(/:root\s*\{([^}]*)\}/)[1]; + const token = (name) => base.match(new RegExp(`${name}:\\s*([^;]+);`))?.[1].trim(); + assert.deepEqual( + ['--radius-xs', '--radius-sm', '--radius-row', '--radius-md', '--radius-composer', '--radius-sheet', '--radius-pill'].map(token), + ['4px', '6px', '6px', '8px', '8px', '8px', '6px']); + assert.equal(token('--tint'), 'color-mix(in srgb, var(--text-1) 5%, transparent)'); + assert.equal(token('--tint-strong'), 'color-mix(in srgb, var(--text-1) 9%, transparent)'); + assert.equal(token('--hairline'), 'color-mix(in srgb, var(--text-1) 11%, transparent)'); +}); + +test('no theme block redefines a radius or tint token', () => { + const css = read('apps/desktop/src/renderer/tokens.css'); + for (const [, block] of css.matchAll(/:root\[data-theme="[a-z]+"\]\s*\{([^}]*)\}/g)) assert.doesNotMatch(block, /--(radius|tint|hairline)/); +}); + +test('every radius in the renderer is a token, a hairline value or a dot', () => { + for (const file of files) for (const value of radii(read(file))) { + assert.ok(value.split(/\s+/).every(PART), `${file}: border-radius: ${value}`); + } +}); + +test('circles are limited to dots, spinners and markers', () => { + // A new circle is a deliberate edit to this table. + const CIRCLES = { 'apps/desktop/src/renderer/styles.css': 6, 'apps/desktop/src/renderer/usage/usage.css': 3, + 'apps/desktop/src/renderer/space/knowledge.css': 1, 'apps/desktop/src/renderer/workspace.css': 1, 'apps/store-desktop/src/renderer/store.css': 2 }; + const found = Object.fromEntries(files.map((f) => [f, radii(read(f)).filter((v) => v === '50%').length]).filter(([, n]) => n > 0)); + assert.deepEqual(found, CIRCLES); +}); From 8ad53f2a48b6978d8bb7b980cf3a833b39208a54 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 22:26:47 -0600 Subject: [PATCH 2/3] feat(ui): confirm request store confirmDialog(options) resolves true on accept and false on cancel. Requests are answered one at a time, oldest first. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_011Ya6qvLmxrim1dK1KjEpJ7 --- apps/desktop/src/renderer/confirm.ts | 73 ++++++++++++++++++++++++++++ apps/desktop/test/confirm.test.ts | 52 ++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 apps/desktop/src/renderer/confirm.ts create mode 100644 apps/desktop/test/confirm.test.ts diff --git a/apps/desktop/src/renderer/confirm.ts b/apps/desktop/src/renderer/confirm.ts new file mode 100644 index 00000000..cf807c93 --- /dev/null +++ b/apps/desktop/src/renderer/confirm.ts @@ -0,0 +1,73 @@ +/** + * Confirmation requests, answered in the app by `ConfirmHost` (components/ConfirmDialog.tsx). + * + * `confirmDialog` replaces `window.confirm`: it resolves true when the person accepts and false when + * they cancel. Requests are answered one at a time, oldest first, so a second request made while one + * is open is neither lost nor shown over it. The store is module-level so any code in the window can + * ask, including `App`, which also renders the host. It imports nothing from the DOM or React. + */ + +export type ConfirmTone = "neutral" | "warn" | "danger"; +/** The subset of `ui/Icon` names a confirmation uses. */ +export type ConfirmIcon = "info" | "alert" | "trash" | "changes" | "restart" | "folder" | "stack"; +/** One consequence of accepting: something that is kept, or something that is lost. */ +export interface ConfirmFact { kind: "kept" | "lost"; text: string } + +export interface ConfirmOptions { + /** The question. */ + title: string; + /** One sentence of consequence. */ + body?: string; + /** A path or identifier, shown in monospace and never truncated. */ + path?: string; + facts?: ConfirmFact[]; + /** The accept button names the action ("Delete thread"), never "OK". */ + confirmLabel: string; + tone?: ConfirmTone; + icon?: ConfirmIcon; +} + +export interface ConfirmRequest extends ConfirmOptions { id: number } + +interface Pending { request: ConfirmRequest; resolve: (accepted: boolean) => void } + +const queue: Pending[] = []; +const listeners = new Set<() => void>(); +let nextId = 1; + +const notify = () => { for (const listener of [...listeners]) listener(); }; + +/** Asks the person to confirm. Resolves true on accept, false on cancel. */ +export function confirmDialog(options: ConfirmOptions): Promise { + return new Promise((resolve) => { + queue.push({ request: { ...options, id: nextId++ }, resolve }); + // A request behind another does not change what is on screen. + if (queue.length === 1) notify(); + }); +} + +/** The oldest unanswered request. Its identity is stable until it is settled. */ +export function currentConfirm(): ConfirmRequest | null { + return queue[0]?.request ?? null; +} + +/** Answers the current request. An id that is not current (already answered, or still queued) is ignored. */ +export function settleConfirm(id: number, accepted: boolean): void { + const head = queue[0]; + if (!head || head.request.id !== id) return; + queue.shift(); + head.resolve(accepted); + notify(); +} + +export function subscribeConfirm(listener: () => void): () => void { + listeners.add(listener); + return () => { listeners.delete(listener); }; +} + +/** Answers every pending request with false. For a window that is starting over, and for tests. */ +export function resetConfirms(): void { + if (queue.length === 0) return; + for (const pending of queue.splice(0)) pending.resolve(false); + notify(); +} diff --git a/apps/desktop/test/confirm.test.ts b/apps/desktop/test/confirm.test.ts new file mode 100644 index 00000000..4cb8fef9 --- /dev/null +++ b/apps/desktop/test/confirm.test.ts @@ -0,0 +1,52 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { confirmDialog, currentConfirm, resetConfirms, settleConfirm, subscribeConfirm } from "../src/renderer/confirm.js"; + +const ask = (title: string) => confirmDialog({ title, confirmLabel: "OK" }); + +test("a request is current until it is settled, and resolves with the answer", async () => { + resetConfirms(); + const answer = ask("one"); + const current = currentConfirm()!; + assert.equal(current.title, "one"); + assert.equal(currentConfirm(), current, "stable identity for useSyncExternalStore"); + settleConfirm(current.id, true); + assert.equal(await answer, true); + assert.equal(currentConfirm(), null); +}); + +test("requests are answered one at a time, first in first out", async () => { + resetConfirms(); + const first = ask("first"), second = ask("second"); + assert.equal(currentConfirm()!.title, "first"); + settleConfirm(currentConfirm()!.id, false); + assert.equal(await first, false); + assert.equal(currentConfirm()!.title, "second"); + settleConfirm(currentConfirm()!.id, true); + assert.equal(await second, true); +}); + +test("settling an id that is not current changes nothing", async () => { + resetConfirms(); + const answer = ask("only"); + const id = currentConfirm()!.id; + settleConfirm(id + 1, true); + assert.equal(currentConfirm()!.id, id); + settleConfirm(id, true); settleConfirm(id, false); + assert.equal(await answer, true); +}); + +test("listeners hear every change, and reset answers everything with false", async () => { + resetConfirms(); + let calls = 0; + const stop = subscribeConfirm(() => { calls++; }); + const a = ask("a"), b = ask("b"); + assert.equal(calls, 1, "the second request does not change what is current"); + resetConfirms(); + assert.deepEqual(await Promise.all([a, b]), [false, false]); + assert.equal(calls, 2); + stop(); + void ask("c"); + assert.equal(calls, 2); + resetConfirms(); +}); From c093a0b95b6b255c91465ea5d18f0e36b53ed5ba Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 22:30:43 -0600 Subject: [PATCH 3/3] feat(ui): in-app confirm dialog replaces window.confirm One ConfirmHost, mounted in App, answers every confirmation: YOLO, cloud model, delete thread, remove project, discard changes, reset learning, remove local connection and delete task. Cancel has focus when it opens, the action button names the action, Escape and the backdrop cancel, and nothing behind the dialog reacts to the keyboard. Each existing sentence keeps all of its facts. The specs that answered a native dialog now answer the in-app one through answerConfirm; a new spec covers focus, Escape, shortcuts and a confirm opened over Settings. Adds the approved design, this PR's plan and the status entry. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_011Ya6qvLmxrim1dK1KjEpJ7 --- apps/desktop/e2e/approval-policy.spec.ts | 6 +- apps/desktop/e2e/confirm-dialog.spec.ts | 106 +++++++ .../e2e/local-model-acceptance.spec.ts | 10 +- apps/desktop/e2e/local-models.spec.ts | 4 +- apps/desktop/e2e/project-remove.spec.ts | 8 +- apps/desktop/e2e/review.spec.ts | 12 +- .../desktop/e2e/settings-transactions.spec.ts | 6 +- apps/desktop/e2e/sidebar-workspaces.spec.ts | 4 +- apps/desktop/e2e/support.ts | 12 + apps/desktop/e2e/terminal.spec.ts | 4 +- apps/desktop/src/renderer/App.tsx | 24 +- .../src/renderer/components/Composer.tsx | 7 +- .../src/renderer/components/ConfirmDialog.tsx | 85 ++++++ .../components/LocalModelsSettings.tsx | 6 +- .../renderer/components/SettingsDialog.tsx | 6 +- .../src/renderer/components/ThreadView.tsx | 3 +- .../src/renderer/components/ui/Icon.tsx | 1 + apps/desktop/src/renderer/confirm.ts | 10 + .../src/renderer/routines/RoutinesView.tsx | 11 +- apps/desktop/src/renderer/styles.css | 32 +++ docs/status.md | 4 +- .../2026-11-15-chat-refresh-foundation.md | 1 + .../2026-11-15-chat-prompts-refresh-design.md | 266 ++++++++++++++++++ 23 files changed, 585 insertions(+), 43 deletions(-) create mode 100644 apps/desktop/e2e/confirm-dialog.spec.ts create mode 100644 apps/desktop/src/renderer/components/ConfirmDialog.tsx create mode 100644 docs/superpowers/specs/2026-11-15-chat-prompts-refresh-design.md diff --git a/apps/desktop/e2e/approval-policy.spec.ts b/apps/desktop/e2e/approval-policy.spec.ts index 93560110..7d6d2189 100644 --- a/apps/desktop/e2e/approval-policy.spec.ts +++ b/apps/desktop/e2e/approval-policy.spec.ts @@ -2,7 +2,7 @@ import { test, expect, type ElectronApplication, type Page } from "@playwright/t import fs from "node:fs"; import path from "node:path"; import { UpdateRecovery } from "../dist/src/main/engine/update-recovery.js"; -import { currentRow, items, launch, seedHome, tid } from "./support"; +import { answerConfirm, currentRow, items, launch, seedHome, tid } from "./support"; let app: ElectronApplication; let page: Page; @@ -38,12 +38,12 @@ test("Always allow in thread answers the waiting card, shows a chip that turns i await tid(page, "access-picker").click(); await expect(tid(page, "approvals-option").first()).toHaveAttribute("data-policy", "ask"); await expect(tid(page, "approvals-option").first()).toHaveAttribute("aria-checked", "true"); - await page.evaluate(() => { window.confirm = () => false; }); await page.locator('[data-testid="approvals-option"][data-policy="yolo"]').click(); + await answerConfirm(page, "cancel", "Turn on YOLO for this thread?"); await expect(chip).toHaveCount(0); await tid(page, "access-picker").click(); - await page.evaluate(() => { window.confirm = () => true; }); await page.locator('[data-testid="approvals-option"][data-policy="yolo"]').click(); + await answerConfirm(page, "accept", "Your Never rules still refuse."); await expect(chip).toHaveAttribute("data-policy", "yolo"); const stored = await page.evaluate(() => window.modex!.invoke("state:get", undefined)); expect(stored.threads[0]!.approvals).toBe("yolo"); diff --git a/apps/desktop/e2e/confirm-dialog.spec.ts b/apps/desktop/e2e/confirm-dialog.spec.ts new file mode 100644 index 00000000..0b92322b --- /dev/null +++ b/apps/desktop/e2e/confirm-dialog.spec.ts @@ -0,0 +1,106 @@ +import { test, expect, type ElectronApplication, type Page } from "@playwright/test"; +import fs from "node:fs"; +import { answerConfirm, launch, seedHome, tid } from "./support"; + +/** + * Confirmations are answered in the app (components/ConfirmDialog.tsx), never in the browser's own + * confirm box: Cancel has focus when one opens, Escape cancels, focus stays inside it, and nothing + * behind it reacts to the keyboard. + */ +let app: ElectronApplication; +let page: Page; +let home: string; +let repo: string; +let nativeDialogs = 0; + +test.beforeAll(async () => { + ({ home, repo } = seedHome()); + ({ app, page } = await launch(home)); + page.on("dialog", (dialog) => { nativeDialogs++; void dialog.dismiss(); }); +}); + +test.afterAll(async () => { + await app?.close(); + fs.rmSync(home, { recursive: true, force: true }); + fs.rmSync(repo, { recursive: true, force: true }); +}); + +async function askToRemoveProject() { + const project = tid(page, "project").first(); + await project.hover(); + await tid(project, "project-menu").click(); + await tid(project, "project-remove").click(); + const dialog = tid(page, "confirm-dialog"); + await expect(dialog).toBeVisible(); + return dialog; +} + +test("removing a project asks in the app, Cancel has focus, and cancelling changes nothing", async () => { + const dialog = await askToRemoveProject(); + await expect(dialog).toHaveAttribute("role", "alertdialog"); + await expect(dialog).toHaveAttribute("aria-modal", "true"); + await expect(dialog).toHaveAttribute("data-tone", "warn"); + await expect(tid(dialog, "confirm-title")).toHaveText("Remove this project from Modex?"); + await expect(tid(dialog, "confirm-fact").first()).toHaveText("Files on disk are not touched."); + await expect(tid(dialog, "confirm-fact").first()).toHaveAttribute("data-kind", "kept"); + await expect(tid(dialog, "confirm-accept")).toHaveText("Remove project"); + // Enter must never accept by default: the safe button holds focus, and Tab stays inside the dialog. + await expect(tid(dialog, "confirm-cancel")).toBeFocused(); + await page.keyboard.press("Tab"); + await expect(tid(dialog, "confirm-accept")).toBeFocused(); + await page.keyboard.press("Tab"); + await expect(tid(dialog, "confirm-cancel")).toBeFocused(); + await page.keyboard.press("Shift+Tab"); + await expect(tid(dialog, "confirm-accept")).toBeFocused(); + await page.keyboard.press("Escape"); + await expect(dialog).toHaveCount(0); + await expect(tid(page, "project")).toHaveCount(1); + expect(nativeDialogs).toBe(0); +}); + +test("shortcuts do nothing behind an open confirm", async () => { + const dialog = await askToRemoveProject(); + await page.keyboard.press("Meta+Shift+p"); + await expect(tid(page, "plan-chip")).toHaveCount(0); + await tid(dialog, "confirm-cancel").click(); + await expect(dialog).toHaveCount(0); + // The same shortcut works once the dialog is gone, so the assertion above is not vacuous. + await page.keyboard.press("Meta+Shift+p"); + await expect(tid(page, "plan-chip")).toBeVisible(); + await page.keyboard.press("Meta+Shift+p"); + await expect(tid(page, "plan-chip")).toHaveCount(0); +}); + +test("a confirm over Settings: Escape cancels the confirm and Settings stays open", async () => { + const current = await page.evaluate(() => window.modex!.invoke("routing:status", undefined)); + await app.evaluate(({ ipcMain }, status) => { + ipcMain.removeHandler("routing:status"); + ipcMain.handle("routing:status", async () => ({ ...status, fit: { ...status.fit, routes: 1 } })); + }, current); + await tid(page, "open-settings").click(); + const settings = tid(page, "settings"); + await settings.getByRole("button", { name: "Reset learning…" }).click(); + const dialog = tid(page, "confirm-dialog"); + await expect(tid(dialog, "confirm-title")).toHaveText("Reset Auto routing's learned preferences?"); + await expect(dialog).toHaveAttribute("data-tone", "danger"); + await expect(tid(dialog, "confirm-cancel")).toBeFocused(); + await page.keyboard.press("Tab"); + await expect(tid(dialog, "confirm-accept")).toBeFocused(); + await page.keyboard.press("Escape"); + await expect(dialog).toHaveCount(0); + await expect(settings).toBeVisible(); + await expect(settings.getByRole("button", { name: "Reset learning…" })).toBeVisible(); + await settings.getByRole("button", { name: "Cancel" }).click(); + await expect(settings).toHaveCount(0); +}); + +test("the backdrop cancels, and accepting runs the action once", async () => { + const dialog = await askToRemoveProject(); + await tid(page, "confirm-backdrop").click({ position: { x: 8, y: 8 } }); + await expect(dialog).toHaveCount(0); + await expect(tid(page, "project")).toHaveCount(1); + await askToRemoveProject(); + await answerConfirm(page, "accept", "Remove this project from Modex?"); + await expect(tid(page, "project")).toHaveCount(0); + expect(nativeDialogs).toBe(0); +}); diff --git a/apps/desktop/e2e/local-model-acceptance.spec.ts b/apps/desktop/e2e/local-model-acceptance.spec.ts index 596adf7a..d654f99e 100644 --- a/apps/desktop/e2e/local-model-acceptance.spec.ts +++ b/apps/desktop/e2e/local-model-acceptance.spec.ts @@ -3,7 +3,7 @@ import fs from "node:fs"; import path from "node:path"; import http from "node:http"; import type { AddressInfo } from "node:net"; -import { appDir, seedHome, tid } from "./support.js"; +import { answerConfirm, appDir, seedHome, tid } from "./support.js"; import { holdLocalDraftCreation, tryInputWhileLocalSelectionWaits, releaseLocalDraftCreation, restoreLocalDraftCreation } from "./fixtures/local-draft-selection.js"; // Full app composition with a scripted native transport injected by a temporary-home-only @@ -129,14 +129,12 @@ test("editing a connection invalidates its selected revision and cloud return co await expect(run.page.getByText(/changed or was deleted|destination changed/).first()).toBeVisible(); await choose(run.page); await tid(run.page, "model-picker").click(); - const dismissed = run.page.waitForEvent("dialog").then(async dialog => { - expect(dialog.message()).toContain("fixture-cloud"); await dialog.dismiss(); - }); - await tid(run.page, "model-local-clear").click(); await dismissed; + await tid(run.page, "model-local-clear").click(); + await answerConfirm(run.page, "cancel", "fixture-cloud"); expect((await run.page.evaluate(() => window.modex!.invoke("state:get", undefined))).threads.some(t => t.localTarget)).toBe(true); await tid(run.page, "model-picker").click(); - run.page.once("dialog", dialog => void dialog.accept()); await tid(run.page, "model-local-clear").click(); + await answerConfirm(run.page, "accept"); await expect.poll(async () => (await run.page.evaluate(() => window.modex!.invoke("state:get", undefined))).threads.some(t => t.localTarget)).toBe(false); expect((await run.page.evaluate(() => window.modex!.invoke("state:get", undefined))).threads[0]?.model).toBe("fixture-cloud"); } finally { await run.app.close(); } diff --git a/apps/desktop/e2e/local-models.spec.ts b/apps/desktop/e2e/local-models.spec.ts index 031aceff..46c60809 100644 --- a/apps/desktop/e2e/local-models.spec.ts +++ b/apps/desktop/e2e/local-models.spec.ts @@ -3,7 +3,7 @@ import http from "node:http"; import fs from "node:fs"; import path from "node:path"; import type { AddressInfo } from "node:net"; -import { launch, seedHome, tid } from "./support.js"; +import { answerConfirm, launch, seedHome, tid } from "./support.js"; import { holdLocalDraftCreation, tryInputWhileLocalSelectionWaits, releaseLocalDraftCreation, restoreLocalDraftCreation } from "./fixtures/local-draft-selection.js"; // LM-4 (#381), LM Studio first: Settings → Local models and the model menu's local section, through the @@ -122,8 +122,8 @@ test("Settings adds an LM Studio server, lists its models without loading one, a // Refresh lists again; Remove asks first and then deletes the profile in main. await tid(card.first(), "local-refresh").click(); await expect.poll(() => runtime.hits.length).toBe(2); - page.once("dialog", dialog => void dialog.accept()); await tid(stopped, "local-remove").click(); + await answerConfirm(page, "accept", "Past conversations stay readable."); await expect(tid(page, "local-connection")).toHaveCount(1); const listed = await page.evaluate(() => window.modex!.invoke("local-models:command", { op: "list" })); expect(listed.op === "list" && listed.connections.map(c => c.label)).toEqual(["LM Studio"]); diff --git a/apps/desktop/e2e/project-remove.spec.ts b/apps/desktop/e2e/project-remove.spec.ts index 94321043..fd78b242 100644 --- a/apps/desktop/e2e/project-remove.spec.ts +++ b/apps/desktop/e2e/project-remove.spec.ts @@ -3,7 +3,7 @@ import { execFileSync } from "node:child_process"; import fs from "node:fs"; import os from "node:os"; import path from "node:path"; -import { launch, seedHome, tid } from "./support"; +import { answerConfirm, launch, seedHome, tid } from "./support"; let app: ElectronApplication; let page: Page; @@ -55,10 +55,10 @@ test("removing a project protects its unsent draft, then replaces a cleared draf await tid(page, "composer-input").fill("Unsent draft message in p2"); // Remove project 2 - page.once("dialog", (d) => void d.accept()); await p2.hover(); await tid(p2, "project-menu").click(); await tid(p2, "project-remove").click(); + await answerConfirm(page, "accept"); if (await page.evaluate(() => Boolean(window.modex!.nativeDrafts))) { await expect(tid(page, "toast")).toContainText(/unsent draft/i); @@ -67,8 +67,8 @@ test("removing a project protects its unsent draft, then replaces a cleared draf expect(JSON.parse(fs.readFileSync(path.join(home, "app/update-recovery.json"), "utf8")).drafts.projects.find((row: any) => row.projectId === "p2").text).toBe("Unsent draft message in p2"); await tid(page, "toast").getByRole("button", { name: "Dismiss", exact: true }).click(); await tid(page, "composer-input").fill(""); - page.once("dialog", d => void d.accept()); await p2.hover(); await tid(p2, "project-menu").click(); await tid(p2, "project-remove").click(); + await answerConfirm(page, "accept"); } // Project 2 is removed from sidebar @@ -84,10 +84,10 @@ test("removing a project protects its unsent draft, then replaces a cleared draf // Remove the last project (project 1) const p1 = projects.filter({ hasText: path.basename(repo1) }); - page.once("dialog", (d) => void d.accept()); await p1.hover(); await tid(p1, "project-menu").click(); await tid(p1, "project-remove").click(); + await answerConfirm(page, "accept"); // All projects removed -> EmptyState is rendered immediately await expect(tid(page, "project")).toHaveCount(0); diff --git a/apps/desktop/e2e/review.spec.ts b/apps/desktop/e2e/review.spec.ts index 04eaeef9..a4be7552 100644 --- a/apps/desktop/e2e/review.spec.ts +++ b/apps/desktop/e2e/review.spec.ts @@ -1,7 +1,7 @@ import { test, expect, type ElectronApplication, type Page } from "@playwright/test"; import fs from "node:fs"; import path from "node:path"; -import { launch, seedHome, tid, items } from "./support"; +import { answerConfirm, launch, seedHome, tid, items } from "./support"; let app: ElectronApplication; let page: Page; @@ -212,13 +212,11 @@ test("Jev test health identifies the tested setup, stays explicit, and HTTP-only await tid(page, "open-settings").click(); const dialog = tid(page, "settings"); await expect(dialog.locator(".field").filter({ hasText: "jev executable" }).locator("small")).toContainText("not used or checked in HTTP-only mode"); - let resetMessage = ""; - page.once("dialog", async (dialog) => { resetMessage = dialog.message(); await dialog.dismiss(); }); await dialog.getByRole("button", { name: "Reset learning…" }).click(); - expect(resetMessage).toMatch(/Reset Auto routing's learned preferences/); + await answerConfirm(page, "cancel", /Reset Auto routing's learned preferences/); await expect(dialog.getByRole("button", { name: "Reset learning…" })).toBeVisible(); - page.once("dialog", async (confirmation) => { await confirmation.accept(); }); await dialog.getByRole("button", { name: "Reset learning…" }).click(); + await answerConfirm(page, "accept"); await expect(dialog.getByRole("button", { name: "Reset learning…" })).toHaveCount(0); await dialog.getByRole("button", { name: "Test judge" }).click(); await expect(tid(page, "routing-test")).toContainText("tested HTTPS"); @@ -373,10 +371,10 @@ test("local Discard still confirms and targets only the selected working-tree fi ipcMain.removeHandler("changes:revert"); ipcMain.handle("changes:revert", (_event, payload) => { g.__localDiscards.push(payload); }); }); - page.once("dialog", dialog => { expect(dialog.message()).toContain("Discard changes to b.txt?"); void dialog.accept(); }); await page.getByRole("button", { name: "Discard changes to b.txt", exact: true }).click(); + await answerConfirm(page, "accept", "Discard changes to b.txt?"); await expect.poll(() => app.evaluate(() => (globalThis as unknown as { __localDiscards: unknown[] }).__localDiscards)).toEqual([{ threadId: "one", path: "b.txt" }]); - page.once("dialog", dialog => { void dialog.dismiss(); }); await page.getByRole("button", { name: "Discard changes to a.txt", exact: true }).click(); + await answerConfirm(page, "cancel", "Discard changes to a.txt?"); expect(await app.evaluate(() => (globalThis as unknown as { __localDiscards: unknown[] }).__localDiscards)).toHaveLength(1); }); diff --git a/apps/desktop/e2e/settings-transactions.spec.ts b/apps/desktop/e2e/settings-transactions.spec.ts index 5d57bdf2..4f51c1d0 100644 --- a/apps/desktop/e2e/settings-transactions.spec.ts +++ b/apps/desktop/e2e/settings-transactions.spec.ts @@ -1,7 +1,7 @@ import { test, expect, type ElectronApplication, type Page } from "@playwright/test"; import fs from "node:fs"; import path from "node:path"; -import { launch, seedHome, tid } from "./support"; +import { answerConfirm, launch, seedHome, tid } from "./support"; let app: ElectronApplication; let page: Page; @@ -75,8 +75,8 @@ test("a failed learning reset stays in the dialog and explains how to check the await tid(page, "open-settings").click(); const dialog = tid(page, "settings"); - page.once("dialog", async (confirmation) => { await confirmation.accept(); }); await dialog.getByRole("button", { name: "Reset learning…" }).click(); + await answerConfirm(page, "accept"); await expect(tid(page, "routing-reset-error")).toContainText("fake reset persistence failure"); await expect(tid(page, "routing-reset-error")).toContainText("Reopen Settings to check the current learning state"); await expect(dialog).toBeVisible(); @@ -292,8 +292,8 @@ test("failed immediate key and reset actions show unavailable status and permit await tid(dialog, "jev-key").locator('input[type="password"]').fill("fake-test-key"); await dialog.getByRole("button", { name: "Save key now" }).click(); } else { - page.once("dialog", async (confirmation) => confirmation.accept()); await dialog.getByRole("button", { name: "Reset learning…" }).click(); + await answerConfirm(page, "accept"); } await expect(tid(dialog, "routing-status")).toContainText(`fake ${action} action failure`); await app.evaluate(() => (globalThis as any).__modexReleaseOpeningStatus()); diff --git a/apps/desktop/e2e/sidebar-workspaces.spec.ts b/apps/desktop/e2e/sidebar-workspaces.spec.ts index 00f2e854..1a51ca30 100644 --- a/apps/desktop/e2e/sidebar-workspaces.spec.ts +++ b/apps/desktop/e2e/sidebar-workspaces.spec.ts @@ -1,13 +1,12 @@ import { test, expect } from "@playwright/test"; import fs from "node:fs"; import path from "node:path"; -import { launch, seedHome, tid } from "./support"; +import { answerConfirm, launch, seedHome, tid } from "./support"; test("each project has notes, and a second workspace groups the sidebar's projects", async () => { const { home, repo } = seedHome(); const project = path.basename(repo); const { app, page } = await launch(home); - page.on("dialog", dialog => void dialog.accept()); try { // One workspace: the sidebar is the flat list it always was. await expect(tid(page, "project")).toHaveCount(1); @@ -41,6 +40,7 @@ test("each project has notes, and a second workspace groups the sidebar's projec // Removing the project keeps its notes, unlinked. await tid(page, "project-menu").click(); await tid(page, "project-remove").click(); + await answerConfirm(page, "accept", "Its notes stay in Space."); await expect(tid(page, "project")).toHaveCount(0); const marker = JSON.parse(fs.readFileSync(path.join(home, "notes", "Clients", project, ".modex-project.json"), "utf8")); expect(marker.modexProjectId).toBeNull(); diff --git a/apps/desktop/e2e/support.ts b/apps/desktop/e2e/support.ts index b2f1d59f..0a49eec3 100644 --- a/apps/desktop/e2e/support.ts +++ b/apps/desktop/e2e/support.ts @@ -157,6 +157,18 @@ export async function resizeWindow(app: ElectronApplication, page: Page, width: /** `data-testid` lookup, scoped to a page or a parent locator. */ export const tid = (scope: Page | Locator, id: string): Locator => scope.locator(`[data-testid="${id}"]`); +/** + * Answers the in-app confirmation that is open (components/ConfirmDialog.tsx). Call it after the click + * that asks. `text`, when given, must appear in the dialog before it is answered. + */ +export async function answerConfirm(page: Page, answer: "accept" | "cancel", text?: string | RegExp): Promise { + const dialog = tid(page, "confirm-dialog"); + await expect(dialog).toBeVisible(); + if (text !== undefined) await expect(dialog).toContainText(text); + await tid(dialog, answer === "accept" ? "confirm-accept" : "confirm-cancel").click(); + await expect(dialog).toHaveCount(0); +} + /** * Switches the theme the way a person does, in Settings → General, and waits for the window to show it. * `settings:update` alone saves the theme but leaves the window as it was until something refreshes it. diff --git a/apps/desktop/e2e/terminal.spec.ts b/apps/desktop/e2e/terminal.spec.ts index 671b7f72..45ab0e20 100644 --- a/apps/desktop/e2e/terminal.spec.ts +++ b/apps/desktop/e2e/terminal.spec.ts @@ -2,7 +2,7 @@ import { test, expect, type ElectronApplication, type Page } from "@playwright/t import fs from "node:fs"; import os from "node:os"; import path from "node:path"; -import { resizeWindow, createThread, launch, seedHome, tid } from "./support"; +import { answerConfirm, resizeWindow, createThread, launch, seedHome, tid } from "./support"; /** * The embedded terminal: a real PTY per thread (main process, engine/terminal.ts) shown in the right @@ -166,9 +166,9 @@ test("deleting a worktree thread with its terminal open ends the shell and remov await expect(tid(page, "terminal-screen")).toContainText(`WT=${fs.realpathSync(worktree)}`); const pid = await shellPid("worktree"); - page.once("dialog", (d) => void d.accept()); await tid(page, "thread-menu-toggle").click(); await tid(page, "action-delete").click(); + await answerConfirm(page, "accept", "Delete this thread and remove its worktree?"); // (Selection moves back to an earlier thread, whose own terminal may still be showing.) await expect(page.locator(`[data-testid="thread-row"][data-thread-id="${id}"]`)).toHaveCount(0); await expect.poll(() => alive(pid)).toBe(false); diff --git a/apps/desktop/src/renderer/App.tsx b/apps/desktop/src/renderer/App.tsx index 2f842cc6..9313286c 100644 --- a/apps/desktop/src/renderer/App.tsx +++ b/apps/desktop/src/renderer/App.tsx @@ -22,6 +22,8 @@ import { LIMITS } from "../shared/attachments"; import { ComposerAttachments, type AttachmentActions } from "./composer-attachments"; import { stageFiles, pickFiles } from "./attachments"; import { bridge } from "./bridge"; +import { confirmDialog } from "./confirm"; +import { ConfirmHost } from "./components/ConfirmDialog"; import { Sidebar } from "./components/Sidebar"; import { ThreadView } from "./components/ThreadView"; import { Workspace } from "./components/Workspace"; @@ -890,9 +892,9 @@ export function App({ persistPreferences = true, spaceEnabled = true, analyticsE const cloud = requested ?? models.codex?.models.find(m => m.id === state?.settings.default_model.codex) ?? models.codex?.models.find(m => m.isDefault) ?? models.codex?.models[0]; if (!cloud) { setError({ message: "Load the Codex cloud model list before returning to cloud models." }); return; } - if (window.confirm(`Use cloud model ${cloud.label} (${cloud.id})? Future messages will go to that model in a fresh conversation. Existing messages will stay in the transcript.`)) { - void updateThread({ localTarget: null, model: cloud.id, effort: cloud.defaultEffort }); - } + void confirmDialog({ title: `Use cloud model ${cloud.label}?`, body: "Future messages will go to that model in a fresh conversation.", path: cloud.id, facts: [{ kind: "kept", text: "Existing messages will stay in the transcript." }], confirmLabel: "Use cloud model", icon: "stack" }).then((ok) => { + if (ok) void updateThread({ localTarget: null, model: cloud.id, effort: cloud.defaultEffort }); + }); }, onManage: openLocalSettings, } : undefined; @@ -919,7 +921,11 @@ export function App({ persistPreferences = true, spaceEnabled = true, analyticsE else { setSurface("chat"); setLayout({ changes: true }); setTerminals((m) => ({ ...m, [threadId]: true })); } }; const deleteThread = (t: Thread) => act(async () => { - const removeWorktree = t.worktree ? window.confirm(privateLabel(`Delete this thread and remove its worktree?\n\n${t.worktree.path}\n\nUncommitted changes there will be lost; the branch ${t.worktree.branch} is kept.`)) : true; + const removeWorktree = t.worktree ? await confirmDialog({ + title: "Delete this thread and remove its worktree?", path: privateLabel(t.worktree.path), + facts: [{ kind: "lost", text: "Uncommitted changes there will be lost." }, { kind: "kept", text: privateLabel(`The branch ${t.worktree.branch} is kept.`) }], + confirmLabel: "Delete thread", tone: "danger", icon: "trash", + }) : true; if (t.worktree && !removeWorktree) return; const s = await bridge.invoke("thread:delete", { threadId: t.id, removeWorktree }); if (nativeRef.current) return; // The main-owned handshake already adopted selection and drafts. @@ -937,7 +943,11 @@ export function App({ persistPreferences = true, spaceEnabled = true, analyticsE if (selected === t.id) setSelected(s.threads.find((x) => x.projectId === t.projectId)?.id ?? s.threads[0]?.id ?? null); }); const removeProject = (projectId: string) => act(async () => { - if (!window.confirm(spaceEnabled ? "Remove this project from Modex? Files on disk are not touched, and its notes stay in Space." : "Remove this project from Modex? Files on disk are not touched.")) return; + if (!(await confirmDialog({ + title: "Remove this project from Modex?", + facts: [{ kind: "kept", text: "Files on disk are not touched." }, ...(spaceEnabled ? [{ kind: "kept" as const, text: "Its notes stay in Space." }] : [])], + confirmLabel: "Remove project", tone: "warn", icon: "folder", + }))) return; const removedThreads = state?.threads.filter((t) => t.projectId === projectId) ?? []; const s = await bridge.invoke("project:remove", { projectId }); if (nativeRef.current) return; // Do not overwrite canonical adoption with the pre-await draft closure. @@ -968,7 +978,7 @@ export function App({ persistPreferences = true, spaceEnabled = true, analyticsE } }); const revert = (path: string) => thread && act(async () => { - if (!window.confirm(privateLabel(`Discard changes to ${path}? This cannot be undone.`))) return; + if (!(await confirmDialog({ title: privateLabel(`Discard changes to ${path}?`), body: "This cannot be undone.", confirmLabel: "Discard changes", tone: "danger", icon: "changes" }))) return; await bridge.invoke("changes:revert", { threadId: thread.id, path }); await loadChanges(thread.id); }); @@ -1226,6 +1236,8 @@ export function App({ persistPreferences = true, spaceEnabled = true, analyticsE {!updateBlocked && (nativeLoading || nativeRecoveryError) &&
{nativeRecoveryError ?? "Restoring saved drafts…"}
} } {!state && streamerMode && } + {/* Every confirmation in the window is answered here (confirm.ts); it renders into a portal. */} + ); diff --git a/apps/desktop/src/renderer/components/Composer.tsx b/apps/desktop/src/renderer/components/Composer.tsx index 3106519d..b9116e76 100644 --- a/apps/desktop/src/renderer/components/Composer.tsx +++ b/apps/desktop/src/renderer/components/Composer.tsx @@ -5,6 +5,7 @@ import { APPROVAL_POLICIES, BACKENDS, MODES } from "../../shared/types"; import type { AttachmentActions } from "../composer-attachments"; import type { Attachment } from "../../shared/attachments"; import { hasFiles } from "../attachments"; +import { confirmDialog, YOLO_CONFIRM } from "../confirm"; import { AttachmentChips } from "./Attachments"; import { ModelMenu, type LocalMenu } from "./ModelMenu"; import { Icon } from "./ui/Icon"; @@ -327,7 +328,11 @@ function AccessMenu({ busy, mode, onMode, approvals, onApprovals }: { busy: bool {onApprovals && } {onApprovals && Approvals} {onApprovals && APPROVAL_POLICIES.map((p) => ( - { if (p !== "yolo" || window.confirm("YOLO approves every action in this thread without asking, including access outside the sandbox. Your Never rules still refuse.\n\nTurn on YOLO for this thread?")) onApprovals(p); setOpen(false); }}> + { + setOpen(false); + if (p !== "yolo") onApprovals(p); + else void confirmDialog(YOLO_CONFIRM).then((ok) => { if (ok) onApprovals(p); }); + }}> {APPROVAL_LABEL[p]} {APPROVAL_HINT[p]} diff --git a/apps/desktop/src/renderer/components/ConfirmDialog.tsx b/apps/desktop/src/renderer/components/ConfirmDialog.tsx new file mode 100644 index 00000000..438f5239 --- /dev/null +++ b/apps/desktop/src/renderer/components/ConfirmDialog.tsx @@ -0,0 +1,85 @@ +import { useEffect, useId, useRef, useSyncExternalStore } from "react"; +import { createPortal } from "react-dom"; +import { currentConfirm, settleConfirm, subscribeConfirm, type ConfirmRequest } from "../confirm"; +import { Icon } from "./ui/Icon"; + +/** + * Shows the confirmation `confirmDialog` asked for (../confirm.ts). Rendered once, by `App`, so the + * desktop app, the Store edition and the web demo all answer confirmations in the app instead of in + * the browser's own confirm box. + */ +export function ConfirmHost() { + const request = useSyncExternalStore(subscribeConfirm, currentConfirm); + if (!request) return null; + // A portal keeps the dialog above the content sheet, which isolates its own stacking context. + return createPortal(, document.body); +} + +/** + * One confirmation: what is asked, what follows from it, and two buttons. Cancel has focus when it + * opens, so Enter never accepts by default. Escape and the backdrop cancel. + */ +function ConfirmDialog({ request }: { request: ConfirmRequest }) { + const titleId = useId(); + const bodyId = useId(); + const dialog = useRef(null); + const cancel = useRef(null); + const tone = request.tone ?? "neutral"; + + useEffect(() => { + const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null; + cancel.current?.focus(); + // Capture on the window, ahead of every other handler: nothing behind the dialog (app shortcuts, + // an open Settings dialog's own Escape and Tab handling) reacts to a key while it is open. + // Default actions are left alone, so Enter and Space still press the focused button. + const onKey = (event: KeyboardEvent) => { + event.stopPropagation(); + if (event.key === "Escape") { + event.preventDefault(); + settleConfirm(request.id, false); + return; + } + if (event.key !== "Tab") return; + const buttons = Array.from(dialog.current?.querySelectorAll("button") ?? []); + if (buttons.length === 0) return; + event.preventDefault(); + const at = buttons.findIndex((button) => button === document.activeElement); + buttons[(at + (event.shiftKey ? buttons.length - 1 : 1) + buttons.length) % buttons.length]?.focus(); + }; + window.addEventListener("keydown", onKey, true); + return () => { + window.removeEventListener("keydown", onKey, true); + // The opener may be gone (a menu row that closed with its menu); focus then stays where it falls. + if (opener?.isConnected) opener.focus({ preventScroll: true }); + }; + }, [request.id]); + + return ( +
{ if (event.target === event.currentTarget) settleConfirm(request.id, false); }}> +
+
+ +
+

{request.title}

+ {request.body &&

{request.body}

} +
+
+ {request.path && {request.path}} + {request.facts && request.facts.length > 0 && ( +
    + {request.facts.map((fact) => ( +
  • + + {fact.text} +
  • + ))} +
+ )} +
+ + +
+
+
+ ); +} diff --git a/apps/desktop/src/renderer/components/LocalModelsSettings.tsx b/apps/desktop/src/renderer/components/LocalModelsSettings.tsx index 0f9a77db..0e5929ed 100644 --- a/apps/desktop/src/renderer/components/LocalModelsSettings.tsx +++ b/apps/desktop/src/renderer/components/LocalModelsSettings.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import type { LocalConnectionView, LocalModelDescriptor, LocalRuntime } from "../../shared/local-connections"; import { FAILURE_WORDS, RUNTIME_DEFAULTS, RUNTIME_NAMES, addConnection, cancelDiscovery, discover, discoverAll, entryModels, removeConnection, tokensLabel, updateConnection, useLocalModels, type LocalEntry } from "../local-models"; import { Icon } from "./ui/Icon"; +import { confirmDialog } from "../confirm"; /** * Settings → Local models (LM-4, #381): connect a model server running on this Mac, list its models, @@ -115,8 +116,9 @@ function ConnectionCard({ entry, busy, run }: { entry: LocalEntry; busy: boolean {c.credential.present && } diff --git a/apps/desktop/src/renderer/components/SettingsDialog.tsx b/apps/desktop/src/renderer/components/SettingsDialog.tsx index 05755dc0..f15fcc96 100644 --- a/apps/desktop/src/renderer/components/SettingsDialog.tsx +++ b/apps/desktop/src/renderer/components/SettingsDialog.tsx @@ -7,6 +7,7 @@ import type { BackendHealth, BackendId, ChatGPTStatus, EffortLevel, Mode, ModelI import { BACKENDS, EFFORT_LEVELS, MODES } from "../../shared/types"; import { sameJudgeSettings, testMatchesJudge } from "../../shared/judge-settings"; import { bridge } from "../bridge"; +import { confirmDialog } from "../confirm"; import { ApprovalRules } from "./ApprovalRules"; import { ConnectionStatus, TerminalLogin } from "./CliConnection"; import { Icon } from "./ui/Icon"; @@ -214,7 +215,10 @@ export function SettingsDialog({ settings, projects, currentProjectId, onSave, o } }; const resetLearning = async () => { - if (operationRef.current || !window.confirm("Reset Auto routing's learned preferences? This applies immediately and cannot be undone.")) return; + if (operationRef.current) return; + if (!(await confirmDialog({ title: "Reset Auto routing's learned preferences?", body: "This applies immediately and cannot be undone.", confirmLabel: "Reset learning", tone: "danger", icon: "restart" }))) return; + // Another Settings operation may have started while the question was open. + if (operationRef.current) return; operationRef.current = true; ++routingStatusRequestRef.current; setRoutingError(null); diff --git a/apps/desktop/src/renderer/components/ThreadView.tsx b/apps/desktop/src/renderer/components/ThreadView.tsx index eff8c059..d16f1603 100644 --- a/apps/desktop/src/renderer/components/ThreadView.tsx +++ b/apps/desktop/src/renderer/components/ThreadView.tsx @@ -9,6 +9,7 @@ import { parseWebSearch, splitSources, type SourceLink, type WebSearch } from ". import type { AttachmentActions } from "../composer-attachments"; import type { Attachment } from "../../shared/attachments"; import { bridge } from "../bridge"; +import { confirmDialog, YOLO_CONFIRM } from "../confirm"; import { AttachmentChips } from "./Attachments"; import { Composer } from "./Composer"; import type { LocalMenu } from "./ModelMenu"; @@ -488,7 +489,7 @@ function ApprovalItem({ item, onAnswer, onPolicy }: { item: ApprovalEntry; onAns {item.canAlways !== false && } {onPolicy && } - {onPolicy && } + {onPolicy && } )} diff --git a/apps/desktop/src/renderer/components/ui/Icon.tsx b/apps/desktop/src/renderer/components/ui/Icon.tsx index 73b54585..374abe48 100644 --- a/apps/desktop/src/renderer/components/ui/Icon.tsx +++ b/apps/desktop/src/renderer/components/ui/Icon.tsx @@ -72,6 +72,7 @@ const PATHS = { "thumb-up": "M5.5 7l2.5-4.5a1.3 1.3 0 0 1 1.5 1.5L9 6.5h3.2a1.2 1.2 0 0 1 1.2 1.5l-1 4a1.5 1.5 0 0 1-1.4 1H5.5zM5.5 7h-3v6h3", "thumb-down": "M5.5 9l2.5 4.5a1.3 1.3 0 0 0 1.5-1.5L9 9.5h3.2a1.2 1.2 0 0 0 1.2-1.5l-1-4a1.5 1.5 0 0 0-1.4-1H5.5zM5.5 9h-3V3h3", agents: "M3.5 5.5h9a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1v-5a1 1 0 0 1 1-1zM8 5.5V3M6 8.5v1M10 8.5v1", + alert: "M8 2.5l6 10.5H2zM8 6.5v3M8 11.25h.01", } as const; /** diff --git a/apps/desktop/src/renderer/confirm.ts b/apps/desktop/src/renderer/confirm.ts index cf807c93..8aa3e9b3 100644 --- a/apps/desktop/src/renderer/confirm.ts +++ b/apps/desktop/src/renderer/confirm.ts @@ -29,6 +29,16 @@ export interface ConfirmOptions { export interface ConfirmRequest extends ConfirmOptions { id: number } +/** Turning on YOLO for a thread is asked from the composer and from an approval card; both use these words. */ +export const YOLO_CONFIRM: ConfirmOptions = { + title: "Turn on YOLO for this thread?", + body: "Every action in this thread is approved without asking, including access outside the sandbox.", + facts: [{ kind: "kept", text: "Your Never rules still refuse." }], + confirmLabel: "Turn on YOLO", + tone: "warn", + icon: "alert", +}; + interface Pending { request: ConfirmRequest; resolve: (accepted: boolean) => void } const queue: Pending[] = []; diff --git a/apps/desktop/src/renderer/routines/RoutinesView.tsx b/apps/desktop/src/renderer/routines/RoutinesView.tsx index 0b5db531..0fc22b58 100644 --- a/apps/desktop/src/renderer/routines/RoutinesView.tsx +++ b/apps/desktop/src/renderer/routines/RoutinesView.tsx @@ -4,6 +4,7 @@ import type { Routine, RoutineDraft, RoutineRun, RoutinesState, RoutineUnit } fr import type { BackendId, Project } from "../../shared/types"; import { taskFromText } from "../../shared/routine-text"; import { bridge } from "../bridge"; +import { confirmDialog, type ConfirmOptions } from "../confirm"; import { useRedact } from "../streamer"; import { ErrorNotice } from "../components/ui/ErrorNotice"; import { Icon } from "../components/ui/Icon"; @@ -20,6 +21,12 @@ function toLocalInput(iso: string): string { return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`; } const fromLocalInput = (value: string) => new Date(value).toISOString(); +/** Deleting a task is offered from its row menu and from its page; both ask with these words. */ +const deleteTaskConfirm = (name: string): ConfirmOptions => ({ + title: `Delete the task “${name}”?`, + facts: [{ kind: "kept", text: "Its runs stay in All activity." }, { kind: "kept", text: "Its page stays in Space." }], + confirmLabel: "Delete task", tone: "danger", icon: "trash", +}); const when = (iso: string | null | undefined) => iso ? new Date(iso).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" }) : "—"; function schedule(routine: Pick): string { @@ -173,7 +180,7 @@ export function RoutinesView({ active, projects, onOpenThread, onOpenPage, onSho { setRowMenu(null); setComposing(null); setEditing(null); setDetails(false); setSelected(routine.id); void act(() => bridge.invoke("routines:run", { id: routine.id })); }}>Run now { setRowMenu(null); setComposing(null); setView("tasks"); setSelected(routine.id); setEditing(draftOf(routine)); }}>Edit - { setRowMenu(null); if (window.confirm(`Delete the task “${routine.name}”? Its runs stay in All activity, and its page stays in Space.`)) void act(async () => { await bridge.invoke("routines:delete", { id: routine.id }); if (selected === routine.id) setSelected(null); }); }}>Delete + { setRowMenu(null); void confirmDialog(deleteTaskConfirm(routine.name)).then((ok) => { if (ok) void act(async () => { await bridge.invoke("routines:delete", { id: routine.id }); if (selected === routine.id) setSelected(null); }); }); }}>Delete }
@@ -318,7 +325,7 @@ export function RoutinesView({ active, projects, onOpenThread, onOpenPage, onSho - +

{redact(current.instructions)}

Runs

diff --git a/apps/desktop/src/renderer/styles.css b/apps/desktop/src/renderer/styles.css index 29cf95e5..649f82e7 100644 --- a/apps/desktop/src/renderer/styles.css +++ b/apps/desktop/src/renderer/styles.css @@ -129,6 +129,38 @@ a { color: var(--accent); } .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 10; } .modal { background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 20px 22px; width: 520px; max-width: calc(100vw - 40px); box-shadow: 0 30px 80px rgba(0,0,0,.5); } .modal h2 { margin: 0 0 14px; font-size: 16px; } +/* Confirm dialog (components/ConfirmDialog.tsx): every confirmation in the app. It sits above menus, + tooltips and other modals, including Settings, which can open one. */ +.modal-backdrop.confirm-backdrop { z-index: 80; background: color-mix(in srgb, var(--bg-sunken) 62%, transparent); backdrop-filter: blur(6px); animation: confirm-fade var(--duration-fast) var(--ease-out) both; } +@keyframes confirm-fade { from { opacity: 0; } } +.modal.confirm { width: 440px; padding: 22px 22px 18px; border-color: var(--border-strong); border-radius: var(--radius-md); background: var(--bg-elevated); box-shadow: 0 30px 90px rgba(0, 0, 0, .55); animation: confirm-in var(--duration-base) var(--ease-out) both; } +@keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } } +.confirm-top { display: flex; align-items: flex-start; gap: 14px; } +.confirm-text { min-width: 0; } +.confirm-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); background: var(--tint-strong); color: var(--text-1); } +.confirm.tone-warn .confirm-icon { background: color-mix(in srgb, var(--accent-warn) 18%, transparent); color: var(--accent-warn); } +.confirm.tone-danger .confirm-icon { background: var(--danger-bg); color: var(--danger-text); } +.modal.confirm h2 { margin: 1px 0 6px; color: var(--text-1); font: var(--weight-semibold) 16px/22px var(--font-sans); overflow-wrap: anywhere; } +.confirm-body { margin: 0; color: var(--text-2); font-size: var(--text-sm); line-height: 1.55; } +/* A path or identifier is shown whole: it wraps and is never cut short. */ +.confirm .confirm-path { display: block; margin: 12px 0 0; padding: 8px 10px; overflow-wrap: anywhere; border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--bg-sunken); color: var(--text-1); font: 12px/1.5 var(--font-mono); user-select: text; } +.confirm-facts { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--text-sm); } +.confirm-facts li { display: flex; align-items: flex-start; gap: 8px; } +.confirm-facts .icon-svg { flex: none; margin-top: 2px; } +.confirm-facts .lost .icon-svg { color: var(--danger-text); } +.confirm-facts .kept .icon-svg { color: var(--ok); } +.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; } +/* One height and the control radius; one button is filled, in the tone of the action. */ +.confirm .btn { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 16px; border: 0; border-radius: var(--radius-sm); background: transparent; box-shadow: inset 0 0 0 1px var(--hairline); color: var(--text-2); font-size: var(--text-sm); font-weight: var(--weight-medium); transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); } +.confirm .btn:hover { background: var(--tint-strong); color: var(--text-1); } +.confirm .btn.primary { background: var(--accent-strong); box-shadow: none; color: var(--accent-ink); } +.confirm .btn.primary:hover { background: var(--accent-strong-hover); color: var(--accent-ink); } +.confirm .btn.solid-warn { background: var(--accent-warn); box-shadow: none; color: #1d1206; } +.confirm .btn.solid-danger { background: var(--danger); box-shadow: none; color: #260808; } +.confirm .btn.solid-warn:hover, .confirm .btn.solid-danger:hover { filter: brightness(1.08); } +.confirm .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } +@media (prefers-reduced-motion: reduce) { .modal-backdrop.confirm-backdrop, .modal.confirm { animation: none; } } +@media (forced-colors: active) { .modal.confirm { border-color: CanvasText; } .confirm .btn { box-shadow: none; border: 1px solid ButtonText; } } .field { display: grid; gap: 4px; margin-bottom: 12px; } .field > span { color: var(--fg-1); font-size: 12.5px; } .field input, .field select { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px; } diff --git a/docs/status.md b/docs/status.md index ce79c713..ce8e8213 100644 --- a/docs/status.md +++ b/docs/status.md @@ -4,7 +4,7 @@ The living map of what has shipped, what is on `main` but unreleased, what is in what is next. Update it in the same PR that changes any of those; a reader should be able to plan the next session from this page alone. Release evidence lives in [`reviews/`](reviews/); finished plans and older entries live in [`archive/`](archive/README.md). -_Last updated 2026-11-12 UTC._ +_Last updated 2026-11-16 UTC._ ## Shipped @@ -147,6 +147,8 @@ before relying on a tick. ## In flight +- **Chat and prompts refresh, PR 1 of 5** (branch `chat-refresh-foundation`). Val approved the design on 2026-11-15: [`superpowers/specs/2026-11-15-chat-prompts-refresh-design.md`](superpowers/specs/2026-11-15-chat-prompts-refresh-design.md). This first PR is the foundation, per [`superpowers/plans/2026-11-15-chat-refresh-foundation.md`](superpowers/plans/2026-11-15-chat-refresh-foundation.md): one radius scale for every renderer stylesheet (8 px surfaces, 6 px controls, 4 px parts; only dots and spinners stay round), the `--tint`, `--tint-strong` and `--hairline` tokens, and one in-app confirm dialog that replaces all ten `window.confirm` calls (YOLO, cloud model, delete thread, remove project, discard changes, reset learning, remove local connection, delete task). The source was written in a session that could not install dependencies: the radius guard (`scripts/test/radius-scale.test.mjs`) and the confirm store's logic were run there, and the build, unit suite and Electron specs were not, so CI is the first full run. Menus, transcript rows, the request panel and the composer follow in PRs 2 to 5. + - **Code Review person-run seed and header-panel focus.** The owned source candidate repairs the actual human-review seed: long description, 101 paged comments, checks/stack/deployment and coherent diffs for all listed synthetic PRs. A normal Electron regression reproduced header Review panel Close dropping focus; Review/Merge Close and scoped Escape now return to their own split-pane button, preserving instructions Escape. Build, workspace typechecks, 2,588 units with 36 skips, 531 desktop E2E cases with 17 opt-in skips, eight site cases and four web cases pass. The isolated seeded overview/activity/panel/diff journey passes; the final fixture-only D5 scroll-density correction passes actual wide/narrow PageDown checks with unchanged diff/inbox positions, its final full units also pass, and protected delivery is pending. Human Result cells stay blank. The checklist uses explicit private-home General opt-in, removes C07 and describes conditional tree folding. Initial signed source `1b2c58b` passed hosted units and iPhone suites but failed two desktop E2E cases. The immutable-comparison fixture race is reproduced and repaired with two deterministic request orderings; the unexplained Markdown ArrowRight failure has validated observation-only diagnostics, with all original assertions retained. The follow-up full build, workspace/E2E typechecks and 2,588 units with 36 skips pass. Full follow-up E2E passes 532 desktop cases with 17 opt-in skips, eight site cases and four web cases, zero failures/retries; exact-head hosted/protected qualification remains pending. The original human candidate is independently preserved and natively qualified in a portable runtime, with human rows still blank. State-change panel focus/Escape remains a named follow-up. [Repair and limits](reviews/2026-11-13-cr-human-seed-focus.md), [CI follow-up](reviews/2026-11-13-pr522-ci-followup.md). - **Code Review line comments integration** (#513, #520). Protected #520 delivered signed squash `967b703768d040d64456c7d118548b97a3bae35b`, tree `6a241c26d089ac4d7daf3e4b30b23a28257010c5`, from qualified source `f9bef70`; #513 is closed as superseded and its owner’s checkout/branch remain preserved. Activity loads the first 100 REST review comments with truthful file/line/reply/unavailable-location labels and partial/capped states. The actual protected checkout passed 2,587 units with 36 skips, 533 desktop cases with fourteen opt-in skips, eight site cases and four web cases, with no retry annotations; both artifacts passed digest/ZIP checks. Corrected source CI passed all twelve checks, including 65 native iPhone units and 43 ordinary UI cases plus one intentional expected-failure control. The first iPhone job’s 30-minute cancellation remains retained; the reviewed whole-job correction to 45 minutes changed no test assertions, individual waits or retries. Hosted simulator, scripted-provider installed CLI and real authenticated-read evidence remain distinct from physical phone, human, live-provider/write and activation acceptance. Resolved-thread state, inline placement and further comment pages remain separate requirements. [Integration and delivery receipt](reviews/2026-11-13-cr-inline-integration.md); [new real-PR benchmark](reviews/2026-11-13-cr-real-pr-benchmark.md). diff --git a/docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md b/docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md index 4cb14a30..6e0cca00 100644 --- a/docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md +++ b/docs/superpowers/plans/2026-11-15-chat-refresh-foundation.md @@ -161,6 +161,7 @@ export function currentConfirm(): ConfirmRequest | null; // the oldest una export function settleConfirm(id: number, accepted: boolean): void; // ignores an id that is not current export function subscribeConfirm(listener: () => void): () => void; export function resetConfirms(): void; // settles every pending request as false +export const YOLO_CONFIRM: ConfirmOptions; // the YOLO question, shared by the composer and the approval card ``` - [ ] **Step 1: Write the failing test** in `apps/desktop/test/confirm.test.ts` diff --git a/docs/superpowers/specs/2026-11-15-chat-prompts-refresh-design.md b/docs/superpowers/specs/2026-11-15-chat-prompts-refresh-design.md new file mode 100644 index 00000000..e9d1f78b --- /dev/null +++ b/docs/superpowers/specs/2026-11-15-chat-prompts-refresh-design.md @@ -0,0 +1,266 @@ +# Modex chat and prompts refresh: design + +Status: **approved by Val on 2026-11-15** on a throwaway prototype (a private page, not in this +repository). Written against `TypeSafeAI/modex` at `538d357`. PR 1 of 5 (radius scale, tints and +the confirm dialog) is implemented by +[`plans/2026-11-15-chat-refresh-foundation.md`](../plans/2026-11-15-chat-refresh-foundation.md); +PRs 2 to 5 each get their own plan from this document. Measurements below come from the +prototype's stylesheet; a later PR copies the rules it needs from this document's values. + +## Intent + +Val finds the chat, the approval prompts and the confirmation boxes clunky and unpolished, and +wants them to read like a modern coding-chat application: minimal, sleek and consistent. The +work is visual and structural. It changes how requests, menus and the composer are laid out. It +does not change what Modex can do, what is asked, or who decides. + +## Goals + +1. Approval and question requests are answered in one quiet panel joined to the composer. +2. Every confirmation uses one in-app dialog. The browser's `confirm` box is gone. +3. Menus are one line per row, with a single description at the foot. +4. The composer is one box: access as tabs (top left), where the thread runs (top right), + titled options along the bottom. +5. Transcript rows (thinking, tools, receipts) share one row style; the reading column and the + composer share one width. +6. All three themes (graphite, Jev, OpenCoven) get it, in the desktop app, the Store edition + and the web demo, because they share `apps/desktop/src/renderer`. + +## Non-goals + +- The shell's layout: sidebar, rail, title bar, Changes, terminal, Settings. (The radius scale + below does reach them, because Val asked for one radius everywhere.) +- New capabilities, new approval semantics, or any change to what main validates. +- Restructuring the model picker (search, groups, effort). It takes the new row styling only. +- The iPhone companion. +- A setting that keeps the old interface. + +## Anti-goals + +- A request that is easier to approve by accident than today. +- A command, path or diff that is cut short in the place where it is approved. +- A request state that exists today and has no place in the new panel (see "States"). +- Copying another product's layout. The prototype is Modex's own, in Modex's tokens. + +## Constraints found in the code + +- **An approval carries no structure.** A thread item has `question` (the CLI's sentence, such + as "Allow command: npm test?"), `detail` (preformatted text), `canAlways`, and `title` only + when a rule answered it. Main does hold more (`ApprovalAction`: `tool`, `title`, `cwd`, + `escalation`), but it does not reach the item. The prototype's "RUN COMMAND" label, bare + command line and diff assume fields that do not exist yet. +- `Composer` also serves `DraftView` (a new chat): no approvals policy there, and Local/Worktree + is a toggle. +- `ui/Menu` is used by 13 components. A global `.menu` restyle reaches all of them. +- `window.confirm` is called in 10 places (YOLO twice, cloud model, delete thread, remove + project, discard changes, reset routing, remove local connection, delete task twice). +- `e2e/layout.spec.ts` pins the composer at 960×109, its context strip and control insets, and + `design/tokens.md` records them as deliberate. About 40 spec and test files use the affected + test ids; 25 Playwright `dialog` handlers exist, and `approval-policy.spec.ts` stubs + `window.confirm`. +- `keyboard-answers.spec.ts` pins where focus goes after an answer (a CF-8 accessibility + finding). ⌘⏎ outside the message box already means "focus the message box" (`App.tsx`). +- `styles.css` reserves `--text-3` and `--text-4` for labels and decoration; small text that + carries information uses `--text-info`. +- The Phase 1 brand plan asserts the `coven` token block exactly, so new tokens belong in the + base `:root` only. +- `AGENTS.md`: worktree per session, signed commits, PR, `pnpm build && pnpm test`, and + `pnpm test:e2e` for UI changes; `docs/status.md` updated in the PR. + +## Approaches + +| | Approach | Trade-off | +| --- | --- | --- | +| **A (chosen)** | In place, one surface per PR, five PRs | Slower to finish; each step is reviewable, shippable, and touches only its own tests | +| B | Behind a "new chat interface" setting | Safe rollout, but two markup paths and two test matrices while the switch exists | +| C | One large PR | Least sequencing; about 40 test files at once, and it collides with the brand plan in the same stylesheets | + +Val steered by outcome and left the how to the builder, so A is the builder's call, stated to +Val on 2026-11-15. + +## Design + +### Shared: tokens and buttons + +Three derived tokens in base `:root` of `tokens.css`, so every theme inherits them: +`--tint` (5% of `--text-1`), `--tint-strong` (9%), `--hairline` (11%). One reading width, +`--chat-col: 760px` (down from 938). Buttons inside requests and dialogs are 32 px tall: one +filled (`--accent-strong` on `--accent-ink`), the rest plain text with a tint on hover. + +**One radius scale, for every button and component** (Val, 2026-11-15: less rounded, uniform). + +| Step | Value | Used for | Token | +| --- | --- | --- | --- | +| Surface | 8 px | Composer, request panel, menus, dialogs, user bubble, code blocks, the content sheet | `--radius-md`, `--radius-composer`, `--radius-sheet` (were 12, 20, 12) | +| Control | 6 px | Buttons, send and stop, icon buttons, rows, options, fields, the tab track | `--radius-sm`, `--radius-row`, `--radius-pill` (were 6, 10, 999) | +| Part | 4 px | Tabs, icon tiles, the switch, inline code, key hints, status chips | `--radius-xs` (new) | + +Nothing is pill-shaped or circular except status and progress dots. `styles.css` has 127 +radius declarations and 91 are hard-coded numbers; all of them move onto these three tokens, so +the scale holds across the whole app and not only on the surfaces this project lays out. + +### 1. Confirm dialog + +One `ConfirmDialog` component and a `useConfirm()` hook returning a promise, replacing all 10 +`window.confirm` calls. Contents: an icon tile in the tone of the action (warn for YOLO, danger +for destructive), a question as the title, one sentence of consequence, an optional path in +monospace, and an optional list of what is lost and what is kept. Cancel has focus when it +opens; the action button names the action ("Delete thread", "Turn on YOLO", "Discard changes"). +Escape and the backdrop cancel; focus is trapped and returns to the opener. `role="alertdialog"`. +The existing sentences are kept and split across title, consequence and facts; no fact is +dropped. + +### 2. Menus + +`.menu` becomes 264 px wide with the surface radius, a hairline border and 32 px single-line rows. +The selected row carries a check at the right and medium weight, no fill. Section labels are +11 px uppercase. `MenuItem` gains a `hint` prop; a menu with any hint renders one description +area at its foot showing the hint of the row under the pointer or focus (the selected row's +when it opens). Each row also carries its hint as `aria-description`. Toggles render as a small +switch. In this project the hint foot is used by the approvals menu, the `+` menu and the +request's "more" menu; other menus take the shell and row styling and keep their content. + +### 3. Transcript + +- Each turn is wrapped in one element (`TurnContent` returns a fragment today) so spacing and + hover can be scoped to a turn. +- "Worked for 38s" loses its rule and becomes a small inline toggle; a live turn shows a dot + (amber while waiting) and shimmer text. +- Thinking, tool and receipt rows: 34 px, a 22 px icon tile, verb plus monospace target + ("Ran `npm test`"), meta at the right. Tool glyph characters become icons from `ui/Icon`. +- Every human answer becomes a receipt row ("Approved `$ npm test` · by you"), the form rules + already use. Expanded, it shows the question and detail as today. +- User bubble: the surface radius on all four corners. Reply actions show on hover or + focus within the turn, and always on the newest turn. +- A streaming reply ends in a pulsing dot. "Jump to latest" is a square icon button with a + hidden text label. + +### 4. Request panel + +A `RequestDock` rendered by `ThreadView` directly above the composer (and above the retired or +archived notice when there is no composer). It shows the oldest unanswered request; when more +are waiting, the label reads "1 of 3". The transcript shows no card for a pending request: the +turn status line says "Waiting for approval" and the panel is always in view. + +Layout: a small uppercase label, then the subject, then the answer at the right. A one-line +subject and its buttons share a row; anything longer puts the buttons on their own row. The +panel and the composer share the surface radius and the same background, 6 px apart. The panel +animates in once per request, not each time its contents redraw. + +**Approval, first cut (renderer only).** Label "Approval". Subject: `question` as text, then +`detail` in monospace, wrapped, scrolling past 132 px, never truncated. When a rule sent it to +a person, the existing "asked because" line shows under the subject. + +**Approval, second cut (small engine change).** The runner copies three display-only fields +from `ApprovalAction` onto every approval item: `title`, `cwd` and `subject` +(`"command" | "edit" | "permissions" | "tool"`), all optional. They are never read back for a +decision, and the action digest is unchanged. With them the label reads "Run command · in +~/code/app" with the command as the subject, or "Edit file" with `detail` rendered by the +existing `Patch` component when it parses as one. Items without the fields (old threads) keep +the first-cut form. A permissions request is labelled "Extra access" in the warn tone. + +Controls: **Approve** (filled), **Deny** (text), and a "more" button opening: "Always allow +this command" (only when `canAlways`), "Always allow in this thread", and "YOLO…", which opens +the confirm dialog. The handlers are today's, unchanged. + +**Question.** Label "Question" (or "Question 1 of 2"), the header, the text, then borderless +numbered rows, one per option, with the description on the same line. When `allowOther`, the +last row is a text field; typing in it selects it. A question without options is a single +field; a secret one is a password field. Several questions stack in the panel, which scrolls +past half the window height. One **Send** button, disabled until every question has an answer. +Main's refusal reasons show beside Send in the danger tone. Drafts keep using +`QuestionDraftContext`. + +### 5. Composer + +One box, three rows. + +- **Top left:** access as a segmented control (Read only, Agent, Full access), a radio group + with arrow-key movement. Each tab is an icon (eye, agent, open lock). Its word slides out + beside the icon over the base duration when the tab is selected, hovered or keyboard-focused, + and slides back otherwise, so at rest only the selected tab shows its word. The name is always + the tab's accessible label, and the mode's description stays its tooltip. Full access is + orange and shows "No sandbox, no prompts" beside it. `ui/Icon` gains `eye` and `unlock`; + `agents` exists. +- **Top right:** project, Local or Worktree, and branch as a caption. In a draft, Local/Worktree + stays a button. +- **Middle:** the message field (44 px minimum, 180 px maximum). +- **Bottom:** `+` (Attach files, Backend); "Approvals *value*" opening the approvals menu, + absent in a draft; Plan and Auto as inline toggles that tint when on; then "Model *value + effort*" and the square send or stop button. + +The context strip above the box and the Plan, Auto and approvals chips go away: the controls +show their own state. Below 640 px of composer width the titles, the caption beside the tabs +and all but the branch drop out (a container query; this covers the Space chat panel). For a +thread pinned to a local model, Plan, Auto and Backend are disabled with the existing note as +their tooltip. + +## States the prototype did not show + +| State today | In the new design | +| --- | --- | +| `delivery: "sending"` | The panel stays, buttons disabled, label "Sending decision…" | +| `delivery: "uncertain"` | Receipt row stays visible, warn tone, "Delivery uncertain — not resent" | +| `withdrawn` (native, stopped, ended) | Neutral receipt row with the existing sentence | +| Rule or policy answered | Receipt row, as today | +| Question refused by main | Message beside Send; the panel stays open | +| Thread retired or archived | No panel can be pending; receipts read as elsewhere | +| Reduced motion, forced colors | No entrance or pulse animation; borders fall back to system colors | + +## Keyboard, focus and accessibility + +- ⌘⏎ approves, or sends a complete answer, only while a request is waiting, the message box has + no unsent text, and the request has been on screen for at least 400 ms. Otherwise ⌘⏎ keeps + today's meaning. Number keys pick a question option when focus is not in a field. +- After an answer, focus moves to the message box and a polite live region announces the result + ("Approved", "Denied", "Answer sent"). This replaces today's move to the card's answer line + and updates `keyboard-answers.spec.ts` deliberately. +- Information-bearing small text (menu hint, "in ~/code/app", option descriptions) uses + `--text-info`. A unit test checks 4.5:1 for each new text and surface pair in every theme. + +## Tests + +- Existing `data-testid`s stay on the element that keeps the meaning (`approval-question`, + `approval-answer`, `approval-reason`, `question-submit`, `access-picker` (now the tab group), + `access-option`, `approvals-option`, `composer-box`, `composer-input`, `send`, `stop`, + `turn-label`). Ids for removed elements + (`composer-context`, the three chips) are retired with their assertions. +- `layout.spec.ts` composer geometry and `design/tokens.md` are rewritten to the new numbers in + the composer PR. Its radius assertions (`--radius-row: 10px`, `--radius-composer: 20px`, the + box's 20 px corner) change with the radius scale in the first PR. +- A `confirmWith(page, "accept" | "cancel")` helper in `e2e/support.ts` replaces each + `dialog` handler that answered a confirm; guards that only dismiss stray dialogs stay. +- New: confirm dialog focus and Escape; menu hint follows hover and focus; the panel's states + from the table above; the ⌘⏎ guards; the 640 px composer breakpoint; old thread items without + the display fields. + +## Sequence + +1. Tokens (tints, hairline, the radius scale and the sweep of hard-coded radii), buttons, the + confirm dialog and its 10 call sites. +2. Menus (`Menu`, `MenuItem` hint, switch) and the composer's menus. +3. Transcript: turn wrapper, rows, receipts, bubble, reply actions. +4. Request panel, first cut; then the engine's display fields and the second cut. +5. Composer, with `layout.spec.ts` and `design/tokens.md`. + +Each PR updates `docs/status.md`. The work is independent of the brand-system plan apart from +shared files; whichever lands second rebases. + +## Left to the builder + +Component file layout; exact easing; whether the hint foot reserves two or three lines per +menu; how `Patch` detection decides that `detail` is a diff; test names. + +## Calls made by the builder, for Val to check + +1. Approach A, five PRs. +2. The request panel ships in two cuts because of the missing structure. +3. ⌘⏎ guards (no unsent text, 400 ms). +4. Focus goes to the message box after an answer, with a spoken result. +5. Full access is one click on a tab; its warning shows after selection and as a tooltip. The + unselected tabs are icons only until hovered or focused. +6. The reading column narrows to 760 px. +7. The model picker is restyled, not restructured. +8. Several pending requests are answered one at a time, oldest first. +9. The radius scale is applied app-wide, including Settings, the sidebar and Code Review, which + this project otherwise leaves alone.