web: keep empty composer on one line and verify touch sizing
This commit is contained in:
+9
-3
@@ -65,13 +65,15 @@ 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
|
||||
Composer fit follow-up (2026-10-20): aligned 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.
|
||||
Back/title, protocol and keyboard geometry are untouched. The visible placeholder
|
||||
is shortened to `Message the agent…` so an empty field stays one aligned line;
|
||||
the full slash-command hint remains its accessible name.
|
||||
`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
|
||||
@@ -79,7 +81,11 @@ 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.
|
||||
real iOS/Android keyboards were not tested. Integration additionally captured
|
||||
28 states under the approved OpenCode temporary `final-composer-fit/` directory,
|
||||
including browser-emulated coarse pointers at 390/420px: empty input and buttons
|
||||
are exactly 48px, and adding Stop does not shift the input. Normal-pointer empty
|
||||
fields and controls are exactly 44px. These are not real-phone keyboard claims.
|
||||
|
||||
Codex model follow-up (partial, fixture-tested; fresh UI captures pending):
|
||||
model controls now include Codex, using the app-server `model/list` catalog and
|
||||
|
||||
@@ -3934,7 +3934,9 @@ function renderChatComposer(thread, session, sessionId) {
|
||||
id: "chatInput",
|
||||
class: "chat-composer-input",
|
||||
rows: "1",
|
||||
placeholder: CHAT_COMPOSER_PLACEHOLDER,
|
||||
// Keep the empty single-line field aligned with its controls on phones.
|
||||
// The full command hint remains the accessible name below.
|
||||
placeholder: "Message the agent…",
|
||||
"aria-label": CHAT_COMPOSER_PLACEHOLDER,
|
||||
title: "Enter adds a new line · Ctrl/Cmd+Enter sends",
|
||||
spellcheck: "false",
|
||||
|
||||
@@ -186,6 +186,10 @@ export async function launchChrome({ width = 1440, height = 900, chromePath } =
|
||||
|
||||
const api = {
|
||||
targetId,
|
||||
/** Emulate pointer capability only; this is not an OS keyboard test. */
|
||||
async emulateTouch(enabled = true) {
|
||||
await session("Emulation.setTouchEmulationEnabled", { enabled, maxTouchPoints: 1 });
|
||||
},
|
||||
/** Resize the emulated viewport at the driver's fixed device scale. */
|
||||
async resize(width, height) {
|
||||
await session("Emulation.setDeviceMetricsOverride", {
|
||||
|
||||
@@ -70,7 +70,8 @@ try {
|
||||
await page.resize(width,900);
|
||||
await page.goto(`http://127.0.0.1:${server.address().port}/`);
|
||||
await page.waitForSelector('#chatInput');
|
||||
await capture(`empty-${width}`);
|
||||
const empty=await capture(`empty-${width}`);
|
||||
if(!before) assert.equal(empty.input.height,empty.send.height,'empty placeholder must fit one aligned line');
|
||||
await page.fill('#chatInput','Review this draft');
|
||||
await capture(`single-${width}`);
|
||||
await page.fill('#chatInput','First draft line\nSecond draft line\nThird draft line');
|
||||
@@ -107,6 +108,18 @@ try {
|
||||
await page.evaluate('setAttachment()');
|
||||
await capture(`attachment-${width}`);
|
||||
}
|
||||
if(!before) {
|
||||
await page.emulateTouch(true);
|
||||
for(const width of [390,420]) {
|
||||
await page.resize(width,900);await page.goto(`http://127.0.0.1:${server.address().port}/`);await page.waitForSelector('#chatInput');
|
||||
assert.equal(await page.evaluate("matchMedia('(any-pointer: coarse)').matches"),true);
|
||||
const touch=await capture(`touch-empty-${width}`);
|
||||
assert.equal(touch.send.width,48);assert.equal(touch.input.height,48);
|
||||
await page.evaluate('setRunning(true)');
|
||||
const running=await capture(`touch-running-${width}`);
|
||||
assert.equal(running.stop.width,48);assert.deepEqual(running.input,touch.input);
|
||||
}
|
||||
}
|
||||
await writeFile(resolve(out,'geometry.json'),JSON.stringify(measurements,null,2));
|
||||
console.log(`${measurements.length} scratch captures and geometry: ${out}`);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user