Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Restore the two-row chat composer layout (#1183)

Eve Bouffard3e03f603b8a1
diff --git a/plugins/web-ui/src/shell.css b/plugins/web-ui/src/shell.css
index da51ae2ad..cb67578e2 100644
--- a/plugins/web-ui/src/shell.css
+++ b/plugins/web-ui/src/shell.css
@@ -3042,9 +3042,11 @@ a.chat-row-open {
margin: 0 auto max(18px, calc(10px + env(safe-area-inset-bottom)));
padding: var(--composer-pad-block) var(--composer-pad-end) var(--composer-pad-block) var(--composer-pad-inline);
border: 1px solid var(--border);
- border-radius: 24px;
+ border-radius: 20px;
background: var(--background);
- box-shadow: var(--chat-surface-shadow);
+ box-shadow:
+ 0 2px 5px rgb(0 0 0 / 0.05),
+ 0 8px 24px rgb(0 0 0 / 0.06);
}
.composer-input {
width: 100%;
@@ -3063,7 +3065,7 @@ a.chat-row-open {
font: inherit;
font-size: var(--composer-font-size);
line-height: 1.5;
- padding: 3px 4px 8px;
+ padding: 7px 8px 8px;
box-sizing: border-box;
}
.composer-input::placeholder {
@@ -8258,33 +8260,6 @@ h3.ambient-field-label {
display: none;
}
-[data-density] .composer-wrap {
- --composer-pad-block: 6px;
- --composer-pad-inline: 8px;
- display: flex;
- flex-wrap: wrap;
- align-items: flex-end;
- gap: 2px;
- /* Chrome only: the column width and side gutters stay with the rules above, which key off
- the surface's own width — a pane that fills a wide window centres the composer on the
- transcript column instead of stretching across it, and a narrow one still runs full-bleed. */
- margin-bottom: 10px;
- padding: var(--composer-pad-block) var(--composer-pad-end) var(--composer-pad-block) var(--composer-pad-inline);
- border-radius: 16px;
-}
-[data-density] .composer-input {
- flex: 1 1 120px;
- min-height: 0;
- max-height: 120px;
- padding: 6px 6px 7px;
-}
-[data-density] .composer-toolbar {
- display: contents;
-}
-[data-density] .composer-left,
-[data-density] .composer-right {
- width: auto;
-}
[data-density] .composer-toolbar .icon-btn,
[data-density] .composer-toolbar .menu-button,
[data-density] .composer-toolbar .send-btn {
@@ -10448,13 +10423,13 @@ h3.ambient-field-label {
--composer-pad-inline: 10px;
--composer-pad-end: 8px;
padding: var(--composer-pad-block) var(--composer-pad-end) var(--composer-pad-block) var(--composer-pad-inline);
- border-radius: 22px;
+ border-radius: 20px;
}
.composer-input {
line-height: 1.4;
min-height: 40px;
max-height: 32vh;
- padding: 8px 6px 6px;
+ padding: 12px 10px 6px;
}
.composer-wrap.compact .composer-toolbar {
flex-wrap: nowrap;
diff --git a/plugins/web-ui/test/chat-elevation.test.ts b/plugins/web-ui/test/chat-elevation.test.ts
index 3108c617a..7f4626acd 100644
--- a/plugins/web-ui/test/chat-elevation.test.ts
+++ b/plugins/web-ui/test/chat-elevation.test.ts
@@ -15,7 +15,7 @@ test("the pinned prompt and composer have elevated solid surfaces", () => {
const composer = css.match(/^\.composer-wrap \{[^}]*\}/m)?.[0] ?? "";
assert.match(pinned, /box-shadow: var\(--chat-surface-shadow\);/);
assert.match(composer, /background: var\(--background\);/);
- assert.match(composer, /box-shadow: var\(--chat-surface-shadow\);/);
+ assert.match(composer, /box-shadow:\s*0 2px 5px rgb\(0 0 0 \/ 0\.05\),\s*0 8px 24px rgb\(0 0 0 \/ 0\.06\);/);
});
test("prompt elevation uses the shared surface shadow only while stuck", () => {
diff --git a/plugins/web-ui/test/css-vars.test.ts b/plugins/web-ui/test/css-vars.test.ts
index ba83a2c4d..5b8203b99 100644
--- a/plugins/web-ui/test/css-vars.test.ts
+++ b/plugins/web-ui/test/css-vars.test.ts
@@ -33,17 +33,20 @@ test("every drop zone the canvas renders has a positioning rule in shell.css", (
});
test("only the elevated chat surfaces paint a shadow", () => {
- const elevated = [".pinned-strip", ".message-stack .user-row.stuck > .user-bubble", ".composer-wrap"];
+ const elevated = [".pinned-strip", ".message-stack .user-row.stuck > .user-bubble"];
const rules = shellCss.replace(/\/\*[\s\S]*?\*\//g, "");
const painted = [...rules.matchAll(/([^{}]+)\{([^{}]*)\}/g)].flatMap((rule) =>
[...rule[2].matchAll(/(box|text)-shadow\s*:\s*([^;}]+)/g)]
.filter((shadow) => shadow[2].trim() !== "none")
- .map((shadow) => [rule[1].trim(), shadow[1], shadow[2].trim()]),
+ .map((shadow) => [rule[1].trim(), shadow[1], shadow[2].trim().replace(/\s+/g, " ")]),
);
assert.deepEqual(
painted,
- elevated.map((selector) => [selector, "box", "var(--chat-surface-shadow)"]),
- "only the pinned strip, latest prompt bubble, and composer may use the shared elevation shadow",
+ [
+ ...elevated.map((selector) => [selector, "box", "var(--chat-surface-shadow)"]),
+ [".composer-wrap", "box", "0 2px 5px rgb(0 0 0 / 0.05), 0 8px 24px rgb(0 0 0 / 0.06)"],
+ ],
+ "only pinned surfaces use the shared shadow; the composer keeps its softer shadow",
);
const inlineShadows = [...tsSource.matchAll(/(?:box|text)-shadow\s*:\s*([^;}]+)/g)]
.map((m) => m[1].trim())
diff --git a/plugins/web-ui/test/pane-composer-source.test.ts b/plugins/web-ui/test/pane-composer-source.test.ts
index 9b44a5070..69fa8e928 100644
--- a/plugins/web-ui/test/pane-composer-source.test.ts
+++ b/plugins/web-ui/test/pane-composer-source.test.ts
@@ -5,19 +5,21 @@ import test from "node:test";
const css = readFileSync(new URL("../src/shell.css", import.meta.url), "utf8");
const composer = readFileSync(new URL("../src/composer.ts", import.meta.url), "utf8");
-test("pane composer collapses to a single line — keyed off the pane, not a whole-document layout class", () => {
+test("pane composers keep the full-width input above a separate toolbar", () => {
assert.doesNotMatch(css, /\.embed-layout/, "panes are elements now, not framed documents");
- assert.match(css, /\[data-density\] \.composer-wrap \{[^}]*display: flex;/);
- assert.match(css, /\[data-density\] \.composer-toolbar \{\s*display: contents;/);
- assert.match(css, /\[data-density\] \.composer-input \{[^}]*min-height: 0;/);
+ const wrap = css.match(/^\.composer-wrap \{[^}]*\}/m)?.[0] ?? "";
+ assert.doesNotMatch(wrap, /display: flex;/);
+ assert.match(css, /^\.composer-input \{[^}]*width: 100%;[^}]*min-height: 48px;/m);
+ assert.match(css, /^\.composer-toolbar \{[^}]*display: flex;[^}]*justify-content: space-between;/m);
+ assert.doesNotMatch(css, /\[data-density[^\]]*\] \.composer-(?:wrap|input|toolbar)\s*\{/);
assert.match(composer, /Math\.max\(ctx\.pane \? 0 : 48, content\)/);
});
-test("a pane's composer tracks the transcript column instead of the whole surface", () => {
- const block = css.match(/\[data-density\] \.composer-wrap \{[^}]*\}/)?.[0] ?? "";
- assert.doesNotMatch(block, /width:/, "the column width comes from the surface-width rules, not the tier");
- assert.doesNotMatch(block, /margin(-inline|-left|-right)?:/, "so do the side gutters");
- assert.match(block, /margin-bottom: 10px;/, "the tier only tightens the dock's own chrome");
+test("a pane's composer inherits the shared transcript column and surface gutters", () => {
+ const block = css.match(/^\.composer-wrap \{[^}]*\}/m)?.[0] ?? "";
+ assert.match(block, /width: min\(var\(--content-w\), calc\(100% - 32px\)\);/);
+ assert.match(block, /margin: 0 auto max\(18px, calc\(10px \+ env\(safe-area-inset-bottom\)\)\);/);
+ assert.match(css, /@container chat \(max-width: 860px\) \{[^]*?\.composer-wrap \{[^}]*width: auto;/);
});
test("phone touch layout cannot inflate a pane's composer controls", () => {
@@ -25,7 +27,7 @@ test("phone touch layout cannot inflate a pane's composer controls", () => {
css,
/\[data-density\] \.composer-toolbar \.icon-btn,\s*\[data-density\] \.composer-toolbar \.menu-button,\s*\[data-density\] \.composer-toolbar \.send-btn \{\s*width: 34px;\s*height: 34px;\s*min-height: 34px;/,
);
- assert.match(css, /\[data-density\] \.composer-left,\s*\[data-density\] \.composer-right \{\s*width: auto;/);
+ assert.doesNotMatch(css, /\[data-density[^\]]*\] \.composer-(?:left|right)[^{]*\{/);
});
test("pane settings control is visible without hover", () => {
diff --git a/plugins/web-ui/test/tab-switch-scroll-snap.test.ts b/plugins/web-ui/test/tab-switch-scroll-snap.test.ts
index f7332ff20..1c8429725 100644
--- a/plugins/web-ui/test/tab-switch-scroll-snap.test.ts
+++ b/plugins/web-ui/test/tab-switch-scroll-snap.test.ts
@@ -51,12 +51,9 @@ test("hidden panes retain their last meaningful density, and every measure write
);
});
-test("pane composer sizing hangs off the density attribute, so writing it is load-bearing", () => {
+test("pane density still controls compact transcript spacing", () => {
const css = readFileSync(new URL("../src/shell.css", import.meta.url), "utf8");
- const block = css.match(/\[data-density\] \.composer-input \{[^}]*\}/)?.[0] ?? "";
- assert.match(
- block,
- /min-height: 0;/,
- "without the attribute the pane composer falls back to the main-window min-height",
- );
+ const block = css.match(/\[data-density="compact"\] \.chat-scroll \{[^}]*\}/)?.[0] ?? "";
+ assert.match(block, /--chat-scroll-pad-top: 8px;/);
+ assert.match(block, /padding: var\(--chat-scroll-pad-top\) var\(--chat-pad\) var\(--chat-scroll-pad-bottom\);/);
});