Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Restore single-pane composer and text sizing (#1414)

Regan Bell54a7601016dc
diff --git a/docs/screenshots/multipane-scope/multipane-after.png b/docs/screenshots/multipane-scope/multipane-after.png
new file mode 100644
index 000000000..2c0e8f3ef
Binary files /dev/null and b/docs/screenshots/multipane-scope/multipane-after.png differ
diff --git a/docs/screenshots/multipane-scope/single-after.png b/docs/screenshots/multipane-scope/single-after.png
new file mode 100644
index 000000000..bc578f096
Binary files /dev/null and b/docs/screenshots/multipane-scope/single-after.png differ
diff --git a/docs/screenshots/multipane-scope/single-before.png b/docs/screenshots/multipane-scope/single-before.png
new file mode 100644
index 000000000..b4d8d6118
Binary files /dev/null and b/docs/screenshots/multipane-scope/single-before.png differ
diff --git a/plugins/web-ui/src/shell.css b/plugins/web-ui/src/shell.css
index 095fdfcae..a95da344e 100644
--- a/plugins/web-ui/src/shell.css
+++ b/plugins/web-ui/src/shell.css
@@ -1198,6 +1198,9 @@ a.chat-row-open {
grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr);
}
.custom-chat-shell.in-pane.empty-chat {
+ grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
+}
+.split-canvas:not(.single-pane) .custom-chat-shell.in-pane.empty-chat {
grid-template-rows: minmax(0, 1fr) auto;
}
.drop-overlay {
@@ -8252,35 +8255,38 @@ h3.ambient-field-label {
}
.split-pane-chat {
- --chat-pad: 13px;
- --composer-inset: 10px;
- --meta-lane: 19px;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
- font-size: 12px;
overflow: hidden;
}
-.split-pane-chat .assistant-body,
-.split-pane-chat .message-bubble,
-.split-pane-chat .message-stack {
+.split-canvas:not(.single-pane) .split-pane-chat {
+ --chat-pad: 13px;
+ --composer-inset: 10px;
+ --meta-lane: 19px;
+ font-size: 12px;
+}
+
+.split-canvas:not(.single-pane) .split-pane-chat .assistant-body,
+.split-canvas:not(.single-pane) .split-pane-chat .message-bubble,
+.split-canvas:not(.single-pane) .split-pane-chat .message-stack {
font-size: 12px;
}
-.split-pane-chat .chat-cta {
+.split-canvas:not(.single-pane) .split-pane-chat .chat-cta {
font-size: 21px;
}
-.dockview-theme-qm .dv-tabs-and-actions-container .icon-btn {
+.split-canvas:not(.single-pane) .dockview-theme-qm .dv-tabs-and-actions-container .icon-btn {
width: 27px;
height: 27px;
min-width: 27px;
border-radius: 0;
}
-.dockview-theme-qm .dv-tabs-and-actions-container:not(.dv-single-tab) .dv-tab {
+.split-canvas:not(.single-pane) .dockview-theme-qm .dv-tabs-and-actions-container:not(.dv-single-tab) .dv-tab {
height: 27px;
border-radius: 0;
}
@@ -8542,7 +8548,7 @@ h3.ambient-field-label {
display: none;
}
-.split-pane-chat .custom-chat-shell .composer-wrap {
+.split-canvas:not(.single-pane) .split-pane-chat .custom-chat-shell .composer-wrap {
--composer-font-size: 12px;
--composer-pad-block: 10px;
--composer-pad-inline: 10px;
diff --git a/plugins/web-ui/test/pane-composer-source.test.ts b/plugins/web-ui/test/pane-composer-source.test.ts
index b3a231a85..206318bcd 100644
--- a/plugins/web-ui/test/pane-composer-source.test.ts
+++ b/plugins/web-ui/test/pane-composer-source.test.ts
@@ -1,6 +1,7 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";
+import { JSDOM } from "jsdom";
const css = readFileSync(new URL("../src/shell.css", import.meta.url), "utf8");
const composer = readFileSync(new URL("../src/composer.ts", import.meta.url), "utf8");
@@ -15,8 +16,11 @@ test("pane composers default to the full-width input above a separate toolbar",
assert.match(composer, /Math\.max\(ctx\.pane \? 0 : 48, content\)/);
});
-test("a pane's composer fills the surface with square edges and no outer gutter", () => {
- const block = css.match(/\.split-pane-chat \.custom-chat-shell \.composer-wrap \{[^}]*\}/)?.[0] ?? "";
+test("a multipane composer fills the surface with square edges and no outer gutter", () => {
+ const block =
+ css.match(
+ /\.split-canvas:not\(\.single-pane\) \.split-pane-chat \.custom-chat-shell \.composer-wrap \{[^}]*\}/,
+ )?.[0] ?? "";
assert.match(block, /width: 100%;/);
assert.match(block, /margin: 0;/);
assert.match(block, /border-radius: 0;/);
@@ -62,3 +66,34 @@ test("the smallest short panes leave text space even with stop controls", () =>
assert.match(minimum, /\.composer-toolbar \.stop-btn \{\s*width: 28px;\s*height: 28px;\s*min-height: 28px;/);
assert.match(minimum, /\.composer-attach \{\s*transform: none;/);
});
+
+test("compact overrides stop matching when the canvas returns to one pane", () => {
+ const dom = new JSDOM(`<div class="split-canvas single-pane">
+ <div class="split-pane-chat">
+ <div class="custom-chat-shell in-pane empty-chat">
+ <div class="message-stack"><div class="assistant-body"></div><div class="message-bubble"></div></div>
+ <div class="chat-cta"></div><div class="composer-wrap"></div>
+ </div>
+ </div>
+ </div>`);
+ const canvas = dom.window.document.querySelector(".split-canvas")!;
+ const rules = [...css.matchAll(/([^{}]+)\{([^{}]*)\}/g)];
+ const overrides = rules.filter(
+ ([, selector, declarations]) =>
+ selector.includes(".split-pane-chat") &&
+ /(?:font-size: 12px|--composer-font-size: 12px|font-size: 21px)/.test(declarations),
+ );
+ assert.equal(overrides.length, 4);
+ for (const [, selector] of overrides) {
+ assert.equal(canvas.querySelector(selector.trim()), null, selector);
+ }
+ canvas.classList.remove("single-pane");
+ for (const [, selector] of overrides) {
+ assert.ok(canvas.querySelector(selector.trim()), selector);
+ }
+ canvas.classList.add("single-pane");
+ for (const [, selector] of overrides) {
+ assert.equal(canvas.querySelector(selector.trim()), null, selector);
+ }
+ dom.window.close();
+});
diff --git a/plugins/web-ui/test/pinned-composer-polish.test.ts b/plugins/web-ui/test/pinned-composer-polish.test.ts
index f7b170c66..2d343334c 100644
--- a/plugins/web-ui/test/pinned-composer-polish.test.ts
+++ b/plugins/web-ui/test/pinned-composer-polish.test.ts
@@ -29,7 +29,7 @@ test("thinking shares input sizing while background activity stays compact", ()
);
assert.deepEqual(sizes, [
[".composer-wrap", 15],
- [".split-pane-chat .custom-chat-shell .composer-wrap", 12],
+ [".split-canvas:not(.single-pane) .split-pane-chat .custom-chat-shell .composer-wrap", 12],
[".composer-wrap", 16],
["body.app-edit-embed .composer-wrap", 13],
]);