Skip to content

Commit 049f494

Browse files
fix(ui): keep effort in the composer row (#130788)
* refactor(ui): keep effort out of model picker * fix(ui): restore mobile composer effort trigger * fix(ui): keep effort reachable with animated mobile gauge Preserve separate model and effort controls across chat, New session, and narrow desktop split panes. Let long model names ellipsize and remove the obsolete model-menu bridge and focus fallback. Co-authored-by: vyctorbrzezowski <[email protected]> * test(ui): expect model-only loading labels --------- Co-authored-by: Peter Steinberger <[email protected]>
1 parent 1847e9a commit 049f494

15 files changed

Lines changed: 440 additions & 498 deletions

‎docs/web/control-ui.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ The folder defaults to the agent workspace. Write-scoped connections can browse,
266266

267267
For a remote target, the Control UI creates the managed-worktree session with an empty initial message and no `execNode`, dispatches it by exact `deviceId`, `autoDevice: true`, or `profileId` (plus an optional cloud machine class), waits for active placement, and then sends the first message and attachments with the same idempotency key used by recovery. Explicit and automatic device dispatch require `operator.write`; cloud profile dispatch requires `operator.admin`. The composer footer chooses the new session's model and reasoning level.
268268

269+
Model and **Effort** are separate adjacent composer controls in chat and New session, on desktop and mobile. The model picker never contains Effort or Fast-mode controls. Long model labels ellipsize to leave room for the other controls; the full name remains in the picker, accessible label, and tooltip. Mobile Effort uses a gauge whose needle reflects the current level, with a lightning badge when Fast mode is active. In chat, Fast mode stays in the Effort menu, or appears as the adjacent control when reasoning is unavailable. Models with neither available control omit it.
270+
269271
Once the session is created, chat opens immediately. Remote startup uses the same transcript progress indicator and elapsed timer as GitHub workspace preparation, showing provisioning, workspace preparation, startup, and first-message delivery as they happen. The composer stays disabled until the first message is accepted; normal startup is not an error. Startup failures remain visible in the session, with **Retry** when recovery is available.
270272

271273
Canceling or recovering an interrupted remote-placement startup reclaims the placement by session key. Cleanup archives a newly created draft before deleting it with the write-scoped archived-only contract, and any cleanup error remains visible for recovery.

‎ui/src/components/icons.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,6 @@ export const icons = {
144144
d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"
145145
/>
146146
<circle cx="12" cy="12" r="3" />`),
147-
slidersHorizontal: strokeIcon(svg` <line x1="4" x2="14" y1="7" y2="7" />
148-
<line x1="18" x2="20" y1="7" y2="7" />
149-
<line x1="4" x2="6" y1="17" y2="17" />
150-
<line x1="10" x2="20" y1="17" y2="17" />
151-
<line x1="14" x2="14" y1="4" y2="10" />
152-
<line x1="8" x2="8" y1="14" y2="20" />`),
153147
bug: strokeIcon(svg` <path d="m8 2 1.88 1.88" />
154148
<path d="M14.12 3.88 16 2" />
155149
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1" />

‎ui/src/e2e/chat-composer-redesign.e2e.test.ts‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ suite.define(() => {
4949
buffer: Buffer.from("mobile composer attachment"),
5050
});
5151
await composer.locator(".chat-attachments-preview").waitFor({ state: "visible" });
52-
const mobileModelSettings = composer.locator('[data-chat-model-settings="true"]');
53-
5452
for (const picker of [
5553
{
5654
menu: ".chat-controls__model-menu",
@@ -61,17 +59,10 @@ suite.define(() => {
6159
trigger: '[data-chat-thinking-select="true"]',
6260
},
6361
]) {
64-
if (picker.menu === ".chat-controls__effort-menu") {
65-
await mobileModelSettings.click();
66-
await composer.locator(".chat-controls__mobile-effort-option").click();
67-
} else {
68-
await composer.locator(picker.trigger).click();
69-
}
62+
const visibleTrigger = composer.locator(picker.trigger);
63+
await expect.poll(() => visibleTrigger.isVisible()).toBe(true);
64+
await visibleTrigger.click();
7065
await page.waitForTimeout(100);
71-
const visibleTrigger =
72-
picker.menu === ".chat-controls__effort-menu"
73-
? mobileModelSettings
74-
: composer.locator(picker.trigger);
7566
const [composerBox, footerBox, menuBox, triggerBox] = await Promise.all([
7667
composer.boundingBox(),
7768
composer.locator(".agent-chat__composer-footer").boundingBox(),
@@ -94,10 +85,12 @@ suite.define(() => {
9485
expect(footerBox.y + footerBox.height).toBeLessThanOrEqual(853);
9586
await page.keyboard.press("Escape");
9687
}
97-
await mobileModelSettings.press("Enter");
98-
const mobileEffortOption = composer.locator(".chat-controls__mobile-effort-option");
99-
await expect.poll(() => mobileEffortOption.isVisible()).toBe(true);
100-
await mobileEffortOption.press("Enter");
88+
const effort = composer.locator('[data-chat-thinking-select="true"]');
89+
await effort.press("Enter");
90+
await expect
91+
.poll(() => composer.locator(".chat-controls__effort-menu").isVisible())
92+
.toBe(true);
93+
await effort.press("Tab");
10194
const focusedEffortControl = composer.locator(
10295
"[data-chat-thinking-slider]:not([disabled]), [data-chat-speed-toggle]:not([disabled])",
10396
);
@@ -108,7 +101,7 @@ suite.define(() => {
108101
.toBe(true);
109102
await page.keyboard.press("Escape");
110103
await expect
111-
.poll(() => mobileModelSettings.evaluate((node) => node === document.activeElement))
104+
.poll(() => effort.evaluate((node) => node === document.activeElement))
112105
.toBe(true);
113106
});
114107
});
@@ -613,7 +606,7 @@ suite.define(() => {
613606
await expect
614607
.poll(() => stop.evaluate((node) => getComputedStyle(node).backgroundColor))
615608
.not.toBe(brandFill);
616-
const mobileModelSettings = composer.locator('[data-chat-model-settings="true"]');
609+
const mobileModelSettings = composer.locator('[data-chat-model-select="true"]');
617610
await expect.poll(() => mobileModelSettings.isVisible()).toBe(true);
618611
const [activeMobileSettingsBox, activeMobileStopBox] = await Promise.all([
619612
mobileModelSettings.boundingBox(),
@@ -664,7 +657,7 @@ suite.define(() => {
664657
})
665658
.toBeLessThanOrEqual(393);
666659
await expect.poll(() => mobileModelSettings.isVisible()).toBe(true);
667-
await expect.poll(() => effort.isVisible()).toBe(false);
660+
await expect.poll(() => effort.isVisible()).toBe(true);
668661
await permission.click();
669662
await expect
670663
.poll(() => composer.locator(".chat-controls__permission-option").first().isVisible())
@@ -764,7 +757,14 @@ suite.define(() => {
764757
}
765758
expect(mobilePickerBox.x).toBeGreaterThanOrEqual(0);
766759
expect(mobilePickerBox.x + mobilePickerBox.width).toBeLessThanOrEqual(393);
767-
await composer.locator(".chat-controls__mobile-effort-option").click();
760+
expect(
761+
await composer
762+
.locator(".chat-controls__model-menu")
763+
.getByText(/Effort|Fast mode/)
764+
.count(),
765+
).toBe(0);
766+
await page.keyboard.press("Escape");
767+
await effort.click();
768768
await expect
769769
.poll(() => composer.locator(".chat-controls__effort-menu").isVisible())
770770
.toBe(true);

0 commit comments

Comments
 (0)