Skip to content

Commit 6a31c5e

Browse files
fix(ui): align task progress and goal chevrons (#130834)
* fix(ui): share trailing chevron alignment * test(ui): assert observable chevron alignment * test(ui): tolerate subpixel row geometry
1 parent a4ef572 commit 6a31c5e

4 files changed

Lines changed: 19 additions & 10 deletions

File tree

‎ui/src/e2e/board-split-transcript.e2e.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ describeControlUiE2e("Board split transcript restore", () => {
256256
expect(
257257
frame.rowGap,
258258
`first frame width=${frame.width}px; assistant-to-user gap=${frame.assistantUserGap}px`,
259-
).toBeGreaterThanOrEqual(0);
259+
).toBeGreaterThanOrEqual(-0.01);
260260
expect(
261261
frame.assistantUserGap,
262262
`assistant text overlaps the user bubble at width=${frame.width}px`,
263-
).toBeGreaterThanOrEqual(0);
263+
).toBeGreaterThanOrEqual(-0.01);
264264
} finally {
265265
contexts.delete(context);
266266
await context.close();

‎ui/src/pages/chat/chat-responsive.browser.test.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4001,7 +4001,9 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
40014001
<span class="agent-chat__goal-objective">Ship the aligned stack</span>
40024002
</span>
40034003
<span class="agent-chat__goal-elapsed">14m</span>
4004-
<span class="agent-chat__goal-actions"></span>
4004+
<span class="agent-chat__goal-actions">
4005+
<button class="agent-chat__goal-action agent-chat__goal-expand">${iconSvg()}</button>
4006+
</span>
40054007
</div>
40064008
</div>
40074009
</div>
@@ -4094,6 +4096,9 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
40944096
left(".chat-queue__copy"),
40954097
left(".agent-chat__goal-label"),
40964098
],
4099+
trailingCenterDelta:
4100+
centerX(".session-progress-card__summary-chevron svg") -
4101+
centerX(".agent-chat__goal-expand svg"),
40974102
};
40984103
});
40994104
expect(
@@ -4102,6 +4107,7 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
41024107
expect(
41034108
Math.max(...openStackAxes.contentLefts) - Math.min(...openStackAxes.contentLefts),
41044109
).toBeLessThan(0.5);
4110+
expect(Math.abs(openStackAxes.trailingCenterDelta)).toBeLessThan(0.5);
41054111
expect(
41064112
await page
41074113
.locator(".session-progress-card__body")
@@ -4186,13 +4192,17 @@ describeBrowserLayout.concurrent("chat responsive browser layout", () => {
41864192
iconCenter(".chat-queue__leading svg"),
41874193
iconCenter(".agent-chat__goal-icon svg"),
41884194
],
4195+
trailingCenterDelta:
4196+
iconCenter(".session-progress-card__summary-chevron svg") -
4197+
iconCenter(".agent-chat__goal-expand svg"),
41894198
};
41904199
});
41914200
expect(collapsed.countLeft).toBeGreaterThan(collapsed.currentRight);
41924201
expect(collapsed.countRight).toBeLessThanOrEqual(collapsed.chevronLeft);
41934202
expect(Math.max(...collapsed.iconCenters) - Math.min(...collapsed.iconCenters)).toBeLessThan(
41944203
0.5,
41954204
);
4205+
expect(Math.abs(collapsed.trailingCenterDelta)).toBeLessThan(0.5);
41964206
const closedRowCenters = await page.evaluate(() => {
41974207
const centerY = (selector: string) => {
41984208
const bounds = document.querySelector<HTMLElement>(selector)!.getBoundingClientRect();

‎ui/src/styles/chat/composer-progress.css‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@
324324
display: inline-flex;
325325
align-items: center;
326326
justify-content: center;
327-
width: 24px;
328-
height: 24px;
327+
width: var(--chat-stack-trailing-control-size);
328+
height: var(--chat-stack-trailing-control-size);
329329
padding: 0;
330330
color: var(--muted);
331331
background: none;
@@ -471,9 +471,7 @@
471471
width: 100%;
472472
min-width: 0;
473473
min-height: 42px;
474-
/* The chevron is 18px while queue/goal actions occupy 24px. The 3px
475-
compensation keeps all trailing centers on one vertical stack column. */
476-
padding: 8px calc(var(--chat-stack-trailing-inset) + 3px) 8px var(--chat-stack-leading-inset);
474+
padding: 8px var(--chat-stack-trailing-inset) 8px var(--chat-stack-leading-inset);
477475
border: 0;
478476
border-radius: 0;
479477
background: transparent;
@@ -543,8 +541,8 @@
543541

544542
.session-progress-card__summary-chevron {
545543
display: grid;
546-
width: 18px;
547-
height: 18px;
544+
width: var(--chat-stack-trailing-control-size);
545+
height: var(--chat-stack-trailing-control-size);
548546
place-items: center;
549547
color: var(--muted);
550548
transition:

‎ui/src/styles/chat/composer-queue.css‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
--chat-queue-divider: color-mix(in srgb, var(--text-strong) 6%, transparent);
55
--chat-stack-icon-size: 14px;
66
--chat-stack-leading-inset: 13px;
7+
--chat-stack-trailing-control-size: 24px;
78
--chat-stack-trailing-inset: 8px;
89
}
910

0 commit comments

Comments
 (0)