Skip to content

Commit e3d5c9f

Browse files
fix(ui): keep inactive split-pane status visible
1 parent b0080e7 commit e3d5c9f

4 files changed

Lines changed: 7 additions & 57 deletions

File tree

‎ui/src/e2e/chat-flow.navigation-presentation.e2e.test.ts‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -284,24 +284,13 @@ suite.define(() => {
284284
await expect.poll(() => headers.first().locator(".chat-side-panel-toggle").count()).toBe(1);
285285
await expect.poll(() => page.locator(".chat-workspace-rail").count()).toBe(0);
286286

287+
// Keyboard focus on a header action marks the pane active.
288+
await headers.first().getByRole("button", { name: "Close pane" }).focus();
287289
const cells = page.locator(".chat-split-view__cell");
288-
const actionRows = headers.locator(".chat-pane__actions");
289-
await expect.poll(() => actionRows.first().isVisible()).toBe(false);
290-
await expect.poll(() => actionRows.last().isVisible()).toBe(true);
291-
expect(
292-
await headers
293-
.first()
294-
.locator(".chat-pane__close-pane")
295-
.evaluate((button) => {
296-
(button as HTMLElement).focus();
297-
return document.activeElement === button;
298-
}),
299-
).toBe(false);
300-
301-
await panes.first().click({ position: { x: 20, y: 80 } });
302290
await expect.poll(() => cells.first().getAttribute("class")).toContain("--active");
303-
await expect.poll(() => actionRows.first().isVisible()).toBe(true);
304-
await expect.poll(() => actionRows.last().isVisible()).toBe(false);
291+
await expect
292+
.poll(() => headers.last().getByRole("button", { name: "Close pane" }).isVisible())
293+
.toBe(true);
305294
const paneEmphasis = await cells.evaluateAll((nodes) =>
306295
nodes.map((cell) => {
307296
const style = getComputedStyle(cell);
@@ -321,8 +310,6 @@ suite.define(() => {
321310
const lastPane = page.locator(".chat-split-view__pane").last();
322311
await lastPane.click({ position: { x: 20, y: 80 } });
323312
await expect.poll(() => cells.last().getAttribute("class")).toContain("--active");
324-
await expect.poll(() => actionRows.first().isVisible()).toBe(false);
325-
await expect.poll(() => actionRows.last().isVisible()).toBe(true);
326313
const targetHeader = headers.first();
327314
await expect
328315
.poll(() =>

‎ui/src/styles/base-theme-contrast.node.test.ts‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const SENDER_TINT_BUBBLE_RULE = ".chat-group.user.chat-group--sender-tint .chat-
7373
// Light mode resets both bubble skins back to flat surfaces, and those rules win
7474
// on source order (see the order contract in chat/grouped.css). Asserting the
7575
// dark fills against light palettes would guard a surface nothing paints.
76-
const LIGHT_USER_BUBBLE_RULE = ':root[data-theme-mode="light"] .chat-group.user .chat-bubble';
76+
const LIGHT_USER_BUBBLE_RULE = ':root[data-theme-mode="light"] .chat-bubble';
7777
const LIGHT_SENDER_TINT_BUBBLE_RULE =
7878
':root[data-theme-mode="light"] .chat-group.user.chat-group--sender-tint .chat-bubble';
7979

@@ -316,7 +316,6 @@ function readChatLinkTokens(chatTextCss: string): { link: string; hover: string
316316
function readBubbleBackgrounds(groupedCss: string): {
317317
user: string;
318318
lightUser: string;
319-
lightUserText: string;
320319
senderTint: string;
321320
lightSenderTint: string;
322321
} {
@@ -330,9 +329,6 @@ function readBubbleBackgrounds(groupedCss: string): {
330329
return {
331330
user: readBackground(USER_BUBBLE_RULE),
332331
lightUser: readBackground(LIGHT_USER_BUBBLE_RULE),
333-
lightUserText:
334-
readRuleBody(groupedCss, LIGHT_USER_BUBBLE_RULE).match(/color:\s*var\((--[\w-]+)\)/u)?.[1] ??
335-
"",
336332
senderTint: readBackground(SENDER_TINT_BUBBLE_RULE),
337333
lightSenderTint: readBackground(LIGHT_SENDER_TINT_BUBBLE_RULE),
338334
};
@@ -442,17 +438,6 @@ describe("Control UI theme contrast", () => {
442438
const senderTint = isLight ? bubbleBackgrounds.lightSenderTint : bubbleBackgrounds.senderTint;
443439
const userBubble = composite(resolveColor(userFill, tokens), page);
444440

445-
if (isLight) {
446-
expect(bubbleBackgrounds.lightUserText).not.toBe("");
447-
const foreground = resolveOpaqueColor(`var(${bubbleBackgrounds.lightUserText})`, tokens);
448-
const ratio = contrastRatio(foreground, userBubble);
449-
if (ratio < AA_NORMAL_TEXT_MIN) {
450-
failures.push(
451-
`${themeName}: text ${bubbleBackgrounds.lightUserText} on user bubble ${userFill} = ${ratio.toFixed(2)}:1 (< ${AA_NORMAL_TEXT_MIN}:1)`,
452-
);
453-
}
454-
}
455-
456441
for (const [state, token] of [
457442
["link", linkTokens.link],
458443
["link hover", linkTokens.hover],

‎ui/src/styles/chat/grouped.css‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,7 @@ img.chat-avatar.chat-avatar--logo {
869869

870870
:root[data-theme-mode="light"] .chat-group.user .chat-bubble {
871871
border-color: transparent;
872-
background: color-mix(in srgb, var(--accent) 15%, var(--bg));
873-
color: var(--text-strong);
872+
background: var(--accent-subtle);
874873
box-shadow: none;
875874
}
876875

‎ui/src/styles/chat/split-view.css‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,6 @@ openclaw-chat-pane {
5050
filter: saturate(0.45);
5151
}
5252

53-
.chat-split-view:has(> .chat-split-view__column > .chat-split-view__cell--active)
54-
> .chat-split-view__column
55-
> .chat-split-view__cell:not(.chat-split-view__cell--active)
56-
.chat-pane__header
57-
:is(
58-
.chat-pane__nav-toggle,
59-
.chat-pane__incognito,
60-
openclaw-session-owner-chip,
61-
.chat-pane__participants,
62-
.chat-pane__placement-control,
63-
.chat-pane__presence,
64-
.chat-pane__face-switch,
65-
.chat-pane__sharing-menu,
66-
.chat-pane__draft-indicator,
67-
.chat-pane__branches-menu,
68-
.chat-pane__gateway-menu,
69-
.chat-pane__actions
70-
) {
71-
display: none;
72-
}
73-
7453
.chat-pane-cache {
7554
display: grid;
7655
flex: 1 1 0;

0 commit comments

Comments
 (0)