Skip to content

Commit 3cd39dc

Browse files
fix(ui): fill pinned session icon (#134775)
1 parent 0ccc900 commit 3cd39dc

2 files changed

Lines changed: 38 additions & 3 deletions

File tree

‎ui/src/e2e/session-management.sidebar.e2e.test.ts‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from "node:path";
2+
import type { Locator } from "playwright";
23
import { expect, it } from "vitest";
34
import {
45
waitForControlUiGatewayReady,
@@ -23,6 +24,19 @@ import {
2324

2425
const suite = createSessionManagementE2eSuite();
2526

27+
function sessionActionPresentation(button: Locator) {
28+
return button.evaluate((element) => {
29+
const icon = element.querySelector("svg");
30+
if (!icon) {
31+
throw new Error("expected session action icon");
32+
}
33+
return {
34+
color: getComputedStyle(element).color,
35+
fill: getComputedStyle(icon).fill,
36+
};
37+
});
38+
}
39+
2640
suite.define(() => {
2741
it("expands and manages child sessions inline before opening a child chat", async () => {
2842
const baseTime = Date.parse("2026-07-01T16:00:00.000Z");
@@ -600,8 +614,9 @@ suite.define(() => {
600614
}
601615
});
602616

603-
it("does not duplicate the active chat when its only session is pinned", async () => {
617+
it("keeps the only pinned chat unique and presents its pin state", async () => {
604618
const context = await suite.browser.newContext({
619+
colorScheme: "dark",
605620
locale: "en-US",
606621
serviceWorkers: "block",
607622
viewport: { height: 900, width: 1280 },
@@ -629,6 +644,26 @@ suite.define(() => {
629644
.toEqual(["Pinned only"]);
630645
await expect.poll(() => chatsGroup.locator(".sidebar-recent-session").count()).toBe(0);
631646
await expect.poll(() => page.locator(".sidebar-recent-session--active").count()).toBe(1);
647+
const pin = pinnedEntry.getByRole("button", { name: "Unpin session" });
648+
const menu = pinnedEntry.getByRole("button", { name: "Open session menu" });
649+
await pinnedEntry.hover();
650+
await captureUiProof(suite, page, "pinned-session-icon.png");
651+
const revealedPin = await sessionActionPresentation(pin);
652+
const revealedMenu = await sessionActionPresentation(menu);
653+
expect(revealedPin.color).toBe(revealedMenu.color);
654+
expect(revealedPin.fill).toBe(revealedPin.color);
655+
656+
await pin.hover();
657+
await expect
658+
.poll(async () => (await sessionActionPresentation(pin)).color)
659+
.not.toBe(revealedPin.color);
660+
await expect
661+
.poll(async () => {
662+
const hoveredPin = await sessionActionPresentation(pin);
663+
return hoveredPin.fill === hoveredPin.color;
664+
})
665+
.toBe(true);
666+
632667
// The empty Threads section only materializes after dragstart. Move the
633668
// real pointer first so Playwright does not wait for a hidden target.
634669
const pinnedRow = pinnedEntry.locator(".sidebar-recent-session");

‎ui/src/styles/components.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5917,8 +5917,8 @@ td.data-table-key-col {
59175917
}
59185918
}
59195919

5920-
.session-row-host--pinned .session-action--pin {
5921-
color: var(--accent);
5920+
.session-row-host--pinned .session-action--pin svg {
5921+
fill: currentColor;
59225922
}
59235923

59245924
.session-run-spinner {

0 commit comments

Comments
 (0)