Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

fix: keep approval controls within their pane (#1175)

Joshua France2f6c28aad142
diff --git a/plugins/web-ui/src/shell.css b/plugins/web-ui/src/shell.css
index d396308d3..54fa89bb2 100644
--- a/plugins/web-ui/src/shell.css
+++ b/plugins/web-ui/src/shell.css
@@ -2319,6 +2319,7 @@ a.chat-row-open {
padding: 10px 12px;
}
.approval-text {
+ overflow-wrap: anywhere;
display: flex;
flex-direction: column;
gap: 6px;
@@ -3079,10 +3080,11 @@ a.chat-row-open {
}
.composer-approval-panel {
display: grid;
+ grid-template-columns: minmax(0, 1fr);
gap: 10px;
margin: 0 0 10px;
- max-height: calc(100dvh - 130px);
+ max-height: min(calc(100dvh - 130px), calc(100cqh - 130px));
overflow-y: auto;
overscroll-behavior: contain;
}
@@ -3096,6 +3098,8 @@ a.chat-row-open {
}
.composer-approval-copy {
display: grid;
+ grid-template-columns: minmax(0, 1fr);
+ overflow-wrap: anywhere;
width: 100%;
gap: 5px;
min-width: 0;
@@ -7998,6 +8002,7 @@ h3.ambient-field-label {
}
.split-pane-content {
+ container-type: size;
position: relative;
width: 100%;
height: 100%;
diff --git a/plugins/web-ui/test/pane-approval-overflow.test.ts b/plugins/web-ui/test/pane-approval-overflow.test.ts
index 7afd95585..5bae8d9fb 100644
--- a/plugins/web-ui/test/pane-approval-overflow.test.ts
+++ b/plugins/web-ui/test/pane-approval-overflow.test.ts
@@ -26,7 +26,9 @@ test("phone approval actions use full-width touch targets", () => {
test("approval panel caps to the pane viewport and scrolls instead of clipping", () => {
const panel = css.match(/\.composer-approval-panel \{[^}]*\}/)?.[0] ?? "";
- assert.match(panel, /max-height: calc\(100dvh - \d+px\);/, "panel needs a viewport-relative height cap");
+ assert.match(panel, /max-height: min\(calc\(100dvh - 130px\), calc\(100cqh - 130px\)\);/);
+ const pane = css.match(/\.split-pane-content \{[^}]*\}/)?.[0] ?? "";
+ assert.match(pane, /container-type: size;/, "approval height must follow the pane, not the whole window");
assert.match(panel, /overflow-y: auto;/, "panel must scroll once the cap binds");
});
@@ -40,3 +42,17 @@ test("pane glance renders no placeholder text for an empty chat", () => {
"card omits the last-reply row when empty",
);
});
+
+test("approval grid tracks cannot grow wider than their container", () => {
+ for (const selector of [".composer-approval-panel", ".composer-approval-copy"]) {
+ const rule = css.slice(css.indexOf(`${selector} {`)).split("}")[0];
+ assert.match(rule, /grid-template-columns: minmax\(0, 1fr\);/, selector);
+ }
+});
+
+test("long approval text wraps in both the composer and transcript", () => {
+ for (const selector of [".composer-approval-copy", ".approval-text"]) {
+ const rule = css.slice(css.indexOf(`${selector} {`)).split("}")[0];
+ assert.match(rule, /overflow-wrap: anywhere;/, selector);
+ }
+});