diff --git a/web/PARITY.md b/web/PARITY.md index 98fa88a6..d84ee44e 100644 --- a/web/PARITY.md +++ b/web/PARITY.md @@ -65,6 +65,22 @@ restoration. No deployed service, live workflow or device was used. ### Chat audit follow-up (2026-10-20, partial — fresh UI captures pending) +Composer fit follow-up (2026-10-20): CSS-only alignment of attachment, Send and +Stop controls (44px square; 48px with a coarse pointer), a matching single-line +input, and six complete auto-grown text lines before scrolling. Send remains +available while running; its adjacent Stop slot is reserved even while idle so +state changes do not rewrap a draft. Monochrome CSS SVG masks replace the +platform-dependent button glyph rendering, preserving existing accessible names. +Back/title, chat view/protocol code and keyboard geometry are untouched. +`node test/composer-fit-browser.mjs ../.ui-composer-fit-after` verifies the real +chat view and input handlers using deterministic fixtures at 390/420/1100px: +empty, single/multiline, running, six/ten-line drafts, attachments and simulated +keyboard geometry. `--before` serves HEAD's CSS for comparison (run before +committing, or on the parent revision). Captures and `geometry.json` are in +`.ui-composer-fit-before/` and `.ui-composer-fit-after/` in the isolated composer +worktree. This is scratch-browser evidence, not a live-server parity upgrade; +real iOS/Android keyboards and deployed services were not tested. + Codex model follow-up (partial, fixture-tested; fresh UI captures pending): model controls now include Codex, using the app-server `model/list` catalog and current `thread/read`/`thread/list` model metadata. Selecting a model saves a diff --git a/web/chat.css b/web/chat.css index 85ede400..81d84e88 100644 --- a/web/chat.css +++ b/web/chat.css @@ -844,8 +844,18 @@ } /* The composer at the foot of a conversation (C8/C9). The field grows 1–6 rows; - the primary control turns from Send to Stop while a turn is in flight. */ -.chat-composer { flex: 0 0 auto; display: grid; gap: var(--space-xs); padding-top: var(--space-xs); border-top: 1px solid var(--color-divider); } + Stop joins Send while a turn is in flight. */ +.chat-composer { + --composer-control: 44px; + --composer-line: 22px; + --composer-padding: 10px; + flex: 0 0 auto; + min-width: 0; + display: grid; + gap: var(--space-xs); + padding-top: var(--space-xs); + border-top: 1px solid var(--color-divider); +} .chat-queued { font-size: 12px; color: var(--muted); } .chat-attachment-strip { display: flex; flex-wrap: wrap; gap: 8px; } @@ -853,6 +863,7 @@ display: inline-flex; align-items: center; gap: 8px; + max-width: 100%; padding: 4px 6px 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-control); @@ -865,7 +876,7 @@ .chat-attachment-thumb { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; } .chat-attachment-glyph { width: 28px; text-align: center; font-size: 18px; line-height: 1; } .chat-attachment-body { display: grid; gap: 1px; min-width: 0; max-width: 220px; } -.chat-attachment-name { font-size: 12px; } +.chat-attachment-name { font-size: 12px; overflow-wrap: anywhere; } .chat-attachment-meta { font-size: 11px; color: var(--muted); } .chat-attachment-error { color: var(--bad); } .chat-attachment-remove { padding: 1px 6px; font-size: 12px; line-height: 1; } @@ -915,29 +926,69 @@ .chat-command-notice-actions { display: flex; gap: 8px; } .chat-command-notice-actions button { padding: 3px 10px; font-size: 12px; } -.chat-composer-row { display: flex; gap: 8px; align-items: flex-end; } +.chat-composer-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; } .chat-file-input { display: none; } -.chat-attach { padding: 6px 10px; font-size: 16px; line-height: 1; } +.chat-attach { color: var(--muted); } .chat-composer-input { flex: 1 1 auto; min-width: 0; + min-height: var(--composer-control); resize: none; - padding: 8px 12px; + padding: var(--composer-padding) 12px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-control); font: inherit; - line-height: 20px; - max-height: 132px; - overflow-y: hidden; -} -.chat-composer-input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; } -.chat-composer-primary { display: inline-flex; align-items: flex-end; gap: 6px; } -.chat-send, .chat-stop { - padding: 8px 12px; font-size: 16px; + line-height: var(--composer-line); + /* Match growComposerTextarea's six full lines, padding and border. */ + max-height: calc(6 * var(--composer-line) + 2 * var(--composer-padding) + 2px); + overflow-y: hidden; + overflow-wrap: anywhere; +} +.chat-composer-input::placeholder { color: var(--muted); opacity: 1; } +.chat-composer-input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; } +.chat-composer-primary { + /* Stop is added beside Send, not instead of it. Keep both slots reserved so + a running-state update cannot rewrap a draft or move the caret vertically. */ + display: inline-flex; + flex: 0 0 calc(2 * var(--composer-control) + 8px); + align-items: flex-end; + gap: 8px; +} +.chat-attach, .chat-send, .chat-stop { + display: inline-flex; + flex: 0 0 var(--composer-control); + align-items: center; + justify-content: center; + width: var(--composer-control); + height: var(--composer-control); + min-width: var(--composer-control); + min-height: var(--composer-control); + padding: 0; + /* Use monochrome masks rather than platform-dependent emoji/glyph metrics. + The existing button aria-labels and titles remain the accessible names. */ + font-size: 0; line-height: 1; +} +.chat-attach::before, .chat-send::before, .chat-stop::before { + content: ""; + width: 20px; + height: 20px; + background: currentColor; + mask: var(--composer-icon) center / contain no-repeat; +} +.chat-attach { + --composer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8 13 6-6a3 3 0 0 1 4 4l-8 8a5 5 0 0 1-7-7l9-9a1 1 0 0 1 1.4 1.4l-9 9a3 3 0 0 0 4.2 4.2l8-8a1 1 0 0 0-1.4-1.4l-6 6a1 1 0 0 0 1.4 1.4l5-5 1.4 1.4-5 5a3 3 0 0 1-4.2-4.2Z'/%3E%3C/svg%3E"); +} +.chat-send { + --composer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m3 3 19 9-19 9 3-8 9-1-9-1Z'/%3E%3C/svg%3E"); +} +.chat-stop { + --composer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='5' width='14' height='14' rx='2'/%3E%3C/svg%3E"); +} +.chat-send, .chat-stop { border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-2); @@ -1139,10 +1190,6 @@ .chat-bar-title { font-size: 18px; } .chat-model-button { max-width: 118px; min-height: 36px; } .chat-activity { font-size: 12px; } - .chat-send, - .chat-stop { min-width: 44px; min-height: 44px; font-size: 18px; } - .chat-attach { min-width: 44px; min-height: 44px; } - .chat-composer-input { padding: 10px 12px; font-size: 16px; } .chat-turn { font-size: 15px; } } @@ -1193,6 +1240,7 @@ /* Input capability, not just screen width, selects touch-sized controls. */ @media (any-pointer: coarse) { + .chat-composer { --composer-control: 48px; --composer-padding: 12px; } .chat-reasoning-toggle, .chat-tool-chip, .chat-group-toggle, .chat-send, .chat-stop, .chat-attach, .chat-model-button, .chat-model-option, .chat-new { min-height: 48px; } diff --git a/web/test/composer-fit-browser.mjs b/web/test/composer-fit-browser.mjs new file mode 100644 index 00000000..0352672f --- /dev/null +++ b/web/test/composer-fit-browser.mjs @@ -0,0 +1,115 @@ +// Scratch-only ui-smoke extension: real chat view/input handlers, no backend, +// workflows, services or devices. --before serves HEAD's CSS for comparison. +import assert from 'node:assert/strict'; +import { createServer } from 'node:http'; +import { readFile, mkdir, writeFile } from 'node:fs/promises'; +import { execFileSync } from 'node:child_process'; +import { resolve, extname } from 'node:path'; +import { launchChrome } from './browser.mjs'; + +const root = resolve(import.meta.dirname, '..'); +const out = resolve(process.argv[2] || '.ui-composer-fit'); +const before = process.argv.includes('--before'); +await mkdir(out, { recursive: true }); +const html = ` +${['design/tokens/tokens','base','shell','lists','run-detail','chat','dialogs'].map(n => ``).join('')} +