- {isConversation ? (
- // berd labels every agent turn with a small identity row above the
- // prose — 20px round avatar + name at `text-xs`, `mb-0.5`, `gap-1`
- // (MessageBubble.tsx:961-981). Without it the reply reads as
- // unattributed body text in a full-cover view, which was the largest
- // single divergence from berd. Only the conversation variant gets it:
- // the other variants' markup is pinned by the byte-for-byte fixture.
-
- {/*
- * The avatar is decorative here: `UserAvatar` exposes either an
- * image named `${displayName} avatar` or its fallback initials, and
- * the agent's name already follows as visible text, so an
- * unhidden avatar makes a screen reader announce the same identity
- * twice for every agent turn. The visible name is the row's single
- * accessible identity. Hidden at this call site rather than by
- * teaching the shared `UserAvatar` a decorative mode: other rows
- * that pair an avatar with adjacent name text (for example
- * `ForumPostCard.tsx:91-99`) have the same shape and would want the
- * same treatment, but changing the shared component's accessible
- * name affects all 45 of its call sites and is not this PR's scope.
- *
- * `size="xs"` is already 20px (`h-5 w-5`) in UserAvatar.
- */}
-
-
-
-
- {resolvedAgentName}
-
-
- ) : null}
` `open` property rather than by clicking
- * a toggle, because the fold's markup and any toggle test id belong to the
- * transcript variants being restyled in parallel. `open` is the DOM contract
- * underneath whatever they render, and it survives their changes.
+ * Drive the product's summary buttons rather than reaching through the old
+ * `` implementation. This keeps the reference flow exercising the same
+ * disclosure state a reader uses.
*/
async function expandTranscriptRows(page: Page) {
- const expanded = await page
- .getByTestId("agent-session-thread-panel")
- .evaluate((panel) => {
- const rows = panel.querySelectorAll("details:not([open])");
- for (const row of rows) {
- (row as HTMLDetailsElement).open = true;
- }
- return rows.length;
- });
- // A zero here would mean the folds moved and the shot silently became a
- // duplicate of the collapsed one, which is the failure worth catching.
- expect(expanded).toBeGreaterThan(0);
+ const summaries = page.getByTestId("transcript-work-block-summary");
+ const count = await summaries.count();
+ expect(count).toBeGreaterThan(0);
+ for (let index = 0; index < count; index += 1) {
+ const summary = summaries.nth(index);
+ if ((await summary.getAttribute("aria-expanded")) !== "true") {
+ await summary.click();
+ }
+ }
}
/**