Skip to content

Commit 51ca460

Browse files
A11y: set explicit AutomationName on CompactSummary header button and body
In the CompactSummary tool-burst style, the header is a standalone Button and the expanded body (step rows) is a sibling element outside the Button's automation subtree. This meant Narrator only announced the button's visual content (a FlexRow with text nodes that may not compose cleanly) without context about the task state. Changes: - Build a headerAutomationName string: "<summary>, <N step(s)>, <status>, expanded/collapsed" and pass it to .AutomationName() on headerButton. Narrator now announces the full card state when the button is focused. - Add .AutomationName("Tool steps for: <summary>") on the body Border so scan-mode navigation gives the body region a clear label linking it back to the task the header describes. Fixes #590 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent eb06fba commit 51ca460

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/OpenClaw.Tray.WinUI/Chat/OpenClawChatTimeline.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,18 @@ string Truncate(string s, int max)
20532053
.Set(t => { t.FontSize = 11; }).VAlign(VerticalAlignment.Center)
20542054
) with { ColumnGap = 8 }).Margin(0, 0, 0, 0);
20552055

2056-
var headerButton = Button(headerContent, toggleTaskList).Set(b =>
2056+
// A11y: provide an explicit automation name so Narrator announces
2057+
// the full card state when the header button is focused. The body
2058+
// content sits outside the Button's automation subtree (it is a
2059+
// sibling, not a child), so the button name must summarise the
2060+
// entire card — including task description, step count, and status.
2061+
var headerAutomationName = effectiveExpanded
2062+
? $"{summaryLine}, {stepCountLabel}, {taskStatusText}, expanded"
2063+
: $"{summaryLine}, {stepCountLabel}, {taskStatusText}, collapsed";
2064+
2065+
var headerButton = Button(headerContent, toggleTaskList)
2066+
.AutomationName(headerAutomationName)
2067+
.Set(b =>
20572068
{
20582069
b.HorizontalAlignment = HorizontalAlignment.Stretch;
20592070
b.HorizontalContentAlignment = HorizontalAlignment.Stretch;
@@ -2072,8 +2083,11 @@ string Truncate(string s, int max)
20722083
{
20732084
// Body sits inside the same card; thin top border so the
20742085
// header + body read as one unit but the divide is clear.
2086+
// A11y: label the body region so Narrator scan-mode users
2087+
// understand its relationship to the header above it.
20752088
cardChildren.Add(
20762089
Border(VStack(8, stepRows.ToArray()))
2090+
.AutomationName($"Tool steps for: {summaryLine}")
20772091
.Set(b =>
20782092
{
20792093
b.Padding = bubblePadding;

0 commit comments

Comments
 (0)