Skip to content

Commit 03d4b8a

Browse files
fix(ui): expose active split pane to assistive tech (#127213)
1 parent 7d83ff7 commit 03d4b8a

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎ui/src/pages/chat/chat-page-pane-render.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { html } from "lit";
1+
import { html, nothing } from "lit";
22
import { repeat } from "lit/directives/repeat.js";
33
import type { ApplicationContext } from "../../app/context.ts";
44
import { nativeGatewaysCapability } from "../../app/native-gateways.runtime.ts";
@@ -55,6 +55,7 @@ export function renderChatPagePaneCell(options: ChatPagePaneRenderOptions) {
5555
class="chat-split-view__cell ${options.splitMode && options.active
5656
? "chat-split-view__cell--active"
5757
: ""} ${options.narrow && !options.active ? "chat-split-view__cell--narrow-hidden" : ""}"
58+
aria-current=${options.splitMode && options.active ? "true" : nothing}
5859
style="flex: ${options.weight} 1 0"
5960
@pointerdown=${() => options.onFocusPane(options.pane.id)}
6061
@focusin=${() => options.onFocusPane(options.pane.id)}

‎ui/src/pages/chat/chat-page.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,11 @@ describe("chat page split layout host", () => {
654654
await page.updateComplete;
655655

656656
const panes = [...page.querySelectorAll<RenderedPane>("openclaw-chat-pane")];
657+
const cells = [...page.querySelectorAll<HTMLElement>(".chat-split-view__cell")];
657658
const dividers = page.querySelectorAll<RenderedDivider>("resizable-divider");
658659
expect(panes.map((pane) => pane.paneId)).toEqual(["p1", "p2"]);
659660
expect(panes.map((pane) => pane.active)).toEqual([false, true]);
661+
expect(cells.map((cell) => cell.getAttribute("aria-current"))).toEqual([null, "true"]);
660662
expect(dividers).toHaveLength(1);
661663
expect(itemAt(dividers, 0, "split divider").orientation).toBe("vertical");
662664
expect(
@@ -666,6 +668,15 @@ describe("chat page split layout host", () => {
666668
).toBe(true);
667669
expect(panes.every((pane) => pane.onOpenSplitView === undefined)).toBe(true);
668670
expect(panes[0]?.chatMessagesBySession).toBe(panes[1]?.chatMessagesBySession);
671+
672+
itemAt(cells, 0, "split cell").dispatchEvent(new Event("pointerdown"));
673+
await page.updateComplete;
674+
675+
expect(
676+
[...page.querySelectorAll<HTMLElement>(".chat-split-view__cell")].map((cell) =>
677+
cell.getAttribute("aria-current"),
678+
),
679+
).toEqual(["true", null]);
669680
});
670681

671682
it("declares split panes, session switches, pane closes, and page disposal", async () => {

0 commit comments

Comments
 (0)