Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(composer): adapt controls to narrow chat columns

QAyong4a62118056fd
diff --git a/apps/desktop/src/styles/composer.css b/apps/desktop/src/styles/composer.css
index bd6871f13..2f61806b4 100644
--- a/apps/desktop/src/styles/composer.css
+++ b/apps/desktop/src/styles/composer.css
@@ -9,8 +9,6 @@
display: flex;
justify-content: center;
width: 100%;
- container-type: inline-size;
- container-name: composer-stack;
}
/* Thread mode: floating bottom dock. The transcript already reserves the
@@ -46,6 +44,8 @@
flex-direction: column;
align-items: stretch;
gap: 0;
+ container-type: inline-size;
+ container-name: composer-stack;
transition: width var(--chat-width-transition, var(--motion-duration-normal) var(--motion-ease-out));
}
diff --git a/apps/desktop/src/styles/responsive.css b/apps/desktop/src/styles/responsive.css
index 13405a3e9..08e7c65a6 100644
--- a/apps/desktop/src/styles/responsive.css
+++ b/apps/desktop/src/styles/responsive.css
@@ -18,6 +18,82 @@
}
}
+/*
+ Composer controls share one row, but the model chip is the first surface to
+ give up descriptive text as the chat column gets narrower. Keep the action
+ buttons at their normal hit target and let the combined model/reasoning
+ trigger carry the full selection in its menu and accessible name.
+*/
+.composer-left,
+.composer-right {
+ min-width: 0;
+}
+
+.composer-left,
+.composer-right,
+.composer-model-thinking {
+ flex: 0 1 auto;
+}
+
+.composer-right {
+ justify-content: flex-end;
+}
+
+.composer-model-thinking {
+ min-width: 0;
+}
+
+@container composer-stack (max-width: 560px) {
+ .composer-model-thinking-dot,
+ .composer-model-thinking-level {
+ display: none;
+ }
+
+ .composer-model-thinking-model {
+ max-width: 136px;
+ }
+}
+
+@container composer-stack (max-width: 480px) {
+ .composer-model-thinking-model {
+ max-width: 96px;
+ }
+}
+
+@container composer-stack (max-width: 450px) {
+ .composer-right .composer-model-thinking-chip {
+ width: 32px;
+ max-width: 32px;
+ flex: 0 0 32px;
+ justify-content: center;
+ gap: 3px !important;
+ padding: 0 !important;
+ }
+
+ .composer-model-thinking-model {
+ display: none;
+ }
+
+ .composer-right .context-inspector-trigger {
+ gap: 0;
+ padding-inline: 3px;
+ }
+
+ .composer-right .context-inspector-ring-value {
+ display: none;
+ }
+
+ .composer-enhance-btn.is-loading {
+ width: 28px;
+ max-width: 28px;
+ padding-inline: 0;
+ }
+
+ .composer-enhance-btn.is-loading > span:not(.tool-spinner) {
+ display: none;
+ }
+}
+
@media (prefers-reduced-motion: reduce) {
.plugins-menu,
.plugins-sheet,
diff --git a/apps/desktop/test/composer-responsive.test.mjs b/apps/desktop/test/composer-responsive.test.mjs
new file mode 100644
index 000000000..a6455c038
--- /dev/null
+++ b/apps/desktop/test/composer-responsive.test.mjs
@@ -0,0 +1,48 @@
+import assert from "node:assert/strict";
+import { readFile } from "node:fs/promises";
+import test from "node:test";
+import { loadStyles } from "./helpers/styles.mjs";
+
+const styles = await loadStyles();
+const [toolbarSource, modelPickerSource] = await Promise.all([
+ readFile(
+ new URL("../src/features/chat/composer/ComposerToolbar.tsx", import.meta.url),
+ "utf8",
+ ),
+ readFile(
+ new URL("../src/features/chat/composer/ComposerModelPicker.tsx", import.meta.url),
+ "utf8",
+ ),
+]);
+const composerSource = `${toolbarSource}\n${modelPickerSource}`;
+
+test("narrow composer containers progressively simplify the model controls", () => {
+ assert.match(
+ styles,
+ /\.composer-stack\s*\{[\s\S]*?container-type:\s*inline-size;[\s\S]*?container-name:\s*composer-stack;/,
+ );
+ assert.match(styles, /\.composer-left,\s*\.composer-right\s*\{[\s\S]*?min-width:\s*0;/);
+ assert.match(styles, /\.composer-model-thinking\s*\{[\s\S]*?min-width:\s*0;/);
+ assert.match(
+ styles,
+ /@container composer-stack \(max-width: 560px\)[\s\S]*?\.composer-model-thinking-dot,[\s\S]*?\.composer-model-thinking-level[\s\S]*?display:\s*none;/,
+ );
+ assert.match(
+ styles,
+ /@container composer-stack \(max-width: 480px\)[\s\S]*?\.composer-model-thinking-model\s*\{[\s\S]*?max-width:\s*96px;/,
+ );
+ assert.match(
+ styles,
+ /@container composer-stack \(max-width: 450px\)[\s\S]*?\.composer-right \.composer-model-thinking-chip[\s\S]*?width:\s*32px;/,
+ );
+ assert.match(styles, /\.composer-model-thinking-model\s*\{[\s\S]*?display:\s*none;/);
+});
+
+test("responsive rules preserve the semantic model trigger and action controls", () => {
+ assert.match(composerSource, /className=\{`icon-btn composer-model-thinking-chip/);
+ assert.match(composerSource, /ariaLabel=\{`\$\{t\("chat\.model"\)\}: \$\{modelLabel\}\./);
+ assert.match(composerSource, /ContextUsageInspector/);
+ assert.match(composerSource, /className=\{`icon-btn icon-btn-square composer-enhance-btn/);
+ assert.match(composerSource, /className="send-btn"/);
+ assert.match(composerSource, /className="stop-btn"/);
+});
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index f47b68c49..2f3121dce 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -2460,11 +2460,17 @@ reasoning-level control.
`.tool-spinner` and localized `Enhancing…` label while running, and remains
a one-shot draft rewrite action. Inline file-reference chips, including
pasted image chips, do not disable this action and remain in the draft.
-- MainPane and the chat surface keep a 450px hard minimum so the composer toolbar
- retains a usable single-row layout. The left and right control groups do not
- shrink; mode and permission labels stay on one line and ellipsize within their
- chips, so a sidebar or work-panel resize cannot vertically split, squeeze, or
- overlap toolbar content.
+- MainPane and the chat surface keep a 450px hard minimum. The composer toolbar
+ remains a single, non-wrapping row as its container narrows: the mode and
+ permission labels stay on one line and ellipsize within their chips, while
+ the combined model × reasoning trigger progressively gives up detail. At
+ 560px it hides the reasoning level label, at 480px it tightens the model label
+ cap, and at the 450px floor it becomes a 32px icon-only trigger. The trigger's
+ menu and accessible name retain the complete model/reasoning selection. The
+ context inspector hides its percentage at the floor and the enhancement
+ loading state becomes icon-only, preserving the action hit targets without
+ clipping or overlapping toolbar content. Home and thread-docked composers
+ use the same responsive rules.
- The combined chip opens one anchored menu above itself. The menu starts with
only Model and Reasoning level entries, each showing its current value and a
chevron. Selecting an entry replaces the menu contents in place with a back
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 8c6e02b97..0c7724b4c 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -1531,6 +1531,29 @@ identify the platform validation still needed.
- **Milestone**: M2
- **Status**: Draft
+#### E2E-COMPOSER-narrow-controls: Composer controls adapt to a narrow chat column
+
+- **Preconditions**: Chat route active; a configured model is selected; the
+ composer is rendered in both empty-home and thread-docked variants.
+- **Steps**: 1) Set the Composer container to 560px and inspect the combined
+ model × reasoning trigger. 2) Set it to 480px, then 450px. 3) At each width,
+ inspect the mode, permission, context, enhancement, and Send/Stop controls;
+ open the model menu from the narrow trigger; repeat the visual check in the
+ other Composer variant.
+- **Expected**: The toolbar remains one non-wrapping row and does not overflow
+ its container. At 560px the reasoning label and separator yield first; at
+ 480px the model label is further capped; at the 450px floor the combined
+ model × reasoning trigger is a 32px icon-only control. The full selection is
+ still available through the trigger's menu, tooltip, and accessible name.
+ Mode and permission labels remain single-line and ellipsized, the context
+ ring and action controls retain usable hit targets, and the single Send/Stop
+ slot remains reachable. Home and thread-docked composers match.
+- **Specs linked**: `04-ux/08-component-spec.md` (§11)
+- **Acceptance**: C (send/UI), Quality
+- **Milestone**: M2
+- **Status**: Source-covered (`composer-responsive.test.mjs`); rendered
+ validation on the integrated `main` remains pending
+
#### E2E-090: Transcript bottom reserve tracks the docked composer height
- **Preconditions**: Chat route active; a session with a transcript that
@@ -7459,7 +7482,7 @@ identify the platform validation still needed.
| B / F / Security — Provider copy | E2E-PROVIDER-copy-config-without-credentials |
| A — App startup | E2E-001, E2E-002, E2E-003, E2E-004, E2E-067, E2E-076, E2E-079, E2E-092, E2E-097, E2E-143, E2E-150, E2E-168, E2E-204 |
| B — Model config | E2E-005, E2E-006, E2E-007, E2E-038, E2E-050, E2E-052, E2E-055, E2E-066, E2E-080, E2E-082, E2E-102c, E2E-102d, E2E-102e, E2E-151, E2E-154, E2E-163, E2E-166, E2E-172, E2E-174, E2E-197, E2E-005G, E2E-005J, E2E-199, E2E-201, E2E-202, E2E-203, E2E-205, E2E-206, E2E-209 |
-| C — Conversation & stream | E2E-008, E2E-008d, E2E-008a, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-031, E2E-040, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-052, E2E-053, E2E-054, E2E-055, E2E-059, E2E-059a, E2E-060c, E2E-060d, E2E-061, E2E-061a, E2E-062, E2E-064, E2E-065, E2E-068, E2E-071, E2E-073, E2E-074, E2E-075, E2E-081, E2E-083, E2E-084, E2E-086, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-106, E2E-109, E2E-111, E2E-114, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-121, E2E-218, E2E-219, E2E-AGENTS-001, E2E-142, E2E-144, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-161, E2E-162, E2E-166, E2E-172, E2E-173, E2E-174, E2E-177, E2E-178, E2E-179, E2E-180, E2E-182, E2E-183, E2E-187, E2E-198, E2E-199, E2E-202, E2E-203, E2E-207, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-102i, E2E-PLUGIN-session-orchestrator-real-workers, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-SUBAGENT-resume-a-settled-delegation |
+| C — Conversation & stream | E2E-008, E2E-008d, E2E-008a, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-031, E2E-040, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-052, E2E-053, E2E-054, E2E-055, E2E-059, E2E-059a, E2E-060c, E2E-060d, E2E-061, E2E-061a, E2E-062, E2E-064, E2E-065, E2E-068, E2E-071, E2E-073, E2E-074, E2E-075, E2E-081, E2E-083, E2E-084, E2E-086, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-094, E2E-095, E2E-096, E2E-097, E2E-098, E2E-099, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102g, E2E-106, E2E-109, E2E-111, E2E-114, E2E-116, E2E-117, E2E-118, E2E-119, E2E-120, E2E-121, E2E-218, E2E-219, E2E-AGENTS-001, E2E-142, E2E-144, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-151, E2E-154, E2E-155, E2E-158, E2E-159, E2E-161, E2E-162, E2E-166, E2E-172, E2E-173, E2E-174, E2E-177, E2E-178, E2E-179, E2E-180, E2E-182, E2E-183, E2E-187, E2E-198, E2E-199, E2E-202, E2E-203, E2E-207, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-102i, E2E-PLUGIN-session-orchestrator-real-workers, E2E-SUBAGENT-settlement-updates-before-parent-poll, E2E-SUBAGENT-resume-a-settled-delegation |
| D — Workspace | E2E-012, E2E-013, E2E-022B, E2E-024I, E2E-047, E2E-049, E2E-057, E2E-058, E2E-060, E2E-068, E2E-075, E2E-078, E2E-153, E2E-158, E2E-182, E2E-187, E2E-252 |
| D — Workspace (project ordering) | E2E-253 |
| E — Tools & permissions | E2E-008a, E2E-014, E2E-015, E2E-016, E2E-017, E2E-018, E2E-019, E2E-024I, E2E-024K, E2E-040, E2E-049, E2E-074, E2E-093, E2E-097, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102d, E2E-102e, E2E-102g, E2E-103, E2E-105, E2E-106, E2E-107, E2E-111, E2E-112, E2E-113, E2E-114, E2E-115, E2E-116, E2E-119, E2E-121, E2E-122, E2E-142, E2E-145, E2E-147, E2E-155, E2E-158, E2E-166, E2E-181, E2E-PLUGIN-imported-pi-package-skills |
@@ -7509,7 +7532,7 @@ identify the platform validation still needed.
| Milestone | Scenarios |
|---|---|
| M1 | E2E-001, E2E-002, E2E-003, E2E-028, E2E-029 |
-| M2 | E2E-004, E2E-005, E2E-006, E2E-007, E2E-008, E2E-008d, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-020, E2E-021, E2E-021a, E2E-027, E2E-031, E2E-036, E2E-037, E2E-042, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-144, E2E-005J, E2E-201, E2E-202, E2E-207, E2E-206 |
+| M2 | E2E-004, E2E-005, E2E-006, E2E-007, E2E-008, E2E-008d, E2E-009, E2E-010, E2E-011, E2E-011a, E2E-011b, E2E-011d, E2E-011e, E2E-011g, E2E-020, E2E-021, E2E-021a, E2E-027, E2E-031, E2E-036, E2E-037, E2E-042, E2E-087, E2E-088, E2E-088b, E2E-089, E2E-090, E2E-COMPOSER-narrow-controls, E2E-144, E2E-005J, E2E-201, E2E-202, E2E-207, E2E-206 |
| M3 | E2E-012, E2E-013, E2E-014, E2E-015, E2E-016, E2E-017, E2E-018, E2E-019, E2E-040 |
| M4 | E2E-022, E2E-023, E2E-024, E2E-025, E2E-026, E2E-030, E2E-038 |
| M5 | E2E-008a, E2E-032, E2E-033, E2E-034, E2E-039, E2E-043, E2E-044, E2E-045, E2E-046, E2E-047, E2E-048, E2E-048A, E2E-049, E2E-050, E2E-051, E2E-052, E2E-053, E2E-054, E2E-055, E2E-056, E2E-057, E2E-058, E2E-059, E2E-060, E2E-061, E2E-062, E2E-063, E2E-064, E2E-065, E2E-066, E2E-067, E2E-068, E2E-069, E2E-070, E2E-071, E2E-072, E2E-073, E2E-074, E2E-075, E2E-076, E2E-077, E2E-078, E2E-079, E2E-080, E2E-081, E2E-082, E2E-083, E2E-084, E2E-085, E2E-086, E2E-092, E2E-093, E2E-096, E2E-097, E2E-098, E2E-099, E2E-100, E2E-101, E2E-102, E2E-102a, E2E-102b, E2E-102c, E2E-102d, E2E-102e, E2E-AGENTS-001, E2E-059a, E2E-060b, E2E-060c, E2E-061a, E2E-073a, E2E-094, E2E-095, E2E-143, E2E-145, E2E-146, E2E-146a, E2E-147, E2E-177, E2E-178, E2E-180, E2E-181, E2E-182, E2E-183, E2E-186, E2E-187, E2E-194, E2E-195, E2E-204, E2E-208, E2E-CHAT-content-width-handles, E2E-250, E2E-252, E2E-102i |
diff --git a/scripts/e2e-three-column-layout.mjs b/scripts/e2e-three-column-layout.mjs
index 8267edc66..7c19379e4 100644
--- a/scripts/e2e-three-column-layout.mjs
+++ b/scripts/e2e-three-column-layout.mjs
@@ -597,21 +597,39 @@ async function main() {
);
const composer = await cdp.evaluate(`(() => {
+ const stack = document.querySelector(".composer-stack");
const bar = document.querySelector(".composer-toolbar");
const left = document.querySelector(".composer-left");
const right = document.querySelector(".composer-right");
- if (!bar || !left || !right) return null;
- return {
+ const modelChip = document.querySelector(".composer-model-thinking-chip");
+ const modelLabel = document.querySelector(".composer-model-thinking-model");
+ if (!stack || !bar || !left || !right || !modelChip || !modelLabel) return null;
+
+ const originalWidth = stack.style.width;
+ const originalTransition = stack.style.transition;
+ stack.style.transition = "none";
+ stack.style.width = "450px";
+ const modelLabelStyles = getComputedStyle(modelLabel);
+ const result = {
width: Math.round(bar.getBoundingClientRect().width),
clipped: bar.scrollWidth > bar.clientWidth + 1,
sameRow:
Math.round(left.getBoundingClientRect().top) ===
Math.round(right.getBoundingClientRect().top),
+ modelLabelHidden: modelLabelStyles.display === "none",
+ modelChipWidth: Math.round(modelChip.getBoundingClientRect().width),
};
+ stack.style.width = originalWidth;
+ stack.style.transition = originalTransition;
+ return result;
})()`);
check(
- composer !== null && composer.clipped === false && composer.sameRow === true,
- "the composer toolbar stays on one unfolded row at the MainChat floor",
+ composer !== null &&
+ composer.clipped === false &&
+ composer.sameRow === true &&
+ composer.modelLabelHidden === true &&
+ composer.modelChipWidth <= 32,
+ "the composer toolbar stays on one row and collapses the model to its icon at the 450px Composer floor",
JSON.stringify(composer),
);