From d1a300cedd715349b60fa2742be4325d5fbf3798 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Tue, 3 Nov 2026 10:25:47 -0800 Subject: [PATCH 1/3] gallery: sent-row plays click the stacked first line; minimal received-row shift rows follow #33249 #33249 made message rows stacked by default: the verb, recipient and chevron on the row, the message's first line on its own line under it. A send's first line left the row's accessible name and a shut AgentMessageRow's toggle holds no words, so the plays for sent-message-rows#with-preview and agent-message-row#sent-opened(-long) click that first line, which toggles the row. Opening "Received N messages" in Minimal Mode now draws three 40px lines instead of 22px ones, so the rows under it move further (0.0175 -> 0.0318, the same ratio); the two shift rows follow. Co-Authored-By: Claude Opus 5.5 Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5 --- scripts/gallery-matrix/shift-baseline.json | 4 ++-- .../acpmux/conversation/AgentMessageRow.gallery.ts | 6 ++++-- .../acpmux/conversation/SentMessageLine.gallery.ts | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/gallery-matrix/shift-baseline.json b/scripts/gallery-matrix/shift-baseline.json index eb94cf2c3248..991219acaa30 100644 --- a/scripts/gallery-matrix/shift-baseline.json +++ b/scripts/gallery-matrix/shift-baseline.json @@ -957,8 +957,8 @@ "agent-pane.incoming-message#messages": 0, "agent-pane.incoming-message#mid-turn": 0, "agent-pane.incoming-message#minimal": 0, - "agent-pane.incoming-message#minimal-fade-count": 0.0175, - "agent-pane.incoming-message#minimal-inline-name": 0.0175, + "agent-pane.incoming-message#minimal-fade-count": 0.0318, + "agent-pane.incoming-message#minimal-inline-name": 0.0318, "agent-pane.incoming-message#minimal-off": 0, "agent-pane.incoming-message#minimal-open": 0.0624, "agent-pane.incoming-message#notice": 0, diff --git a/webviews/src/agent-session/acpmux/conversation/AgentMessageRow.gallery.ts b/webviews/src/agent-session/acpmux/conversation/AgentMessageRow.gallery.ts index 4e0253fca8cd..9ee861701f58 100644 --- a/webviews/src/agent-session/acpmux/conversation/AgentMessageRow.gallery.ts +++ b/webviews/src/agent-session/acpmux/conversation/AgentMessageRow.gallery.ts @@ -334,7 +334,9 @@ export default agentPaneEntry({ note: "Opened, the message grows in place under its line, with no box, and nothing else draws: no status block, no result JSON.", snapshot: sends(), play: async (ctx) => { - await ctx.click({ selector: ".cv-agentmsg__toggle" }); + // Stacked (#33249), a shut row's toggle holds no words and sits on the recipient's chip, which + // opens the subagent; the person clicks the message's first line under the row, which toggles it. + await ctx.click({ selector: ".cv-agentmsg__below" }); await ctx.waitFor(() => ctx.document.querySelector(".cv-agentmsg__card")); }, }, @@ -342,7 +344,7 @@ export default agentPaneEntry({ note: "A long message opens capped near eight lines, the rest a scroll away under a fade.", snapshot: long(), play: async (ctx) => { - await ctx.click({ selector: ".cv-agentmsg__toggle" }); + await ctx.click({ selector: ".cv-agentmsg__below" }); await ctx.waitFor(() => ctx.document.querySelector(".cv-message__text")); }, }, diff --git a/webviews/src/agent-session/acpmux/conversation/SentMessageLine.gallery.ts b/webviews/src/agent-session/acpmux/conversation/SentMessageLine.gallery.ts index 4f15215f76a1..324be65b89a5 100644 --- a/webviews/src/agent-session/acpmux/conversation/SentMessageLine.gallery.ts +++ b/webviews/src/agent-session/acpmux/conversation/SentMessageLine.gallery.ts @@ -206,8 +206,9 @@ export default agentPaneEntry({ snapshot: sent(), play: async (ctx) => { await openTurn(ctx); - // Trusted clicks settle before the next step, so Raw is clicked where it rests. - await ctx.click({ role: "button", name: /net-retries: done/ }); + // Trusted clicks settle before the next step, so Raw is clicked where it rests. Stacked + // (#33249), the message's first line sits under its row, out of the row's name; it toggles too. + await ctx.click({ text: /^net-retries: done$/ }); await ctx.waitFor(() => ctx.document.querySelector(".cv-subsession__under .cv-md h2")); await ctx.click({ selector: ".cv-subsession__under .cv-subsession__toggle" }); await ctx.waitFor(() => ctx.document.querySelector(".cv-subsession__under .cv-shell")); From 840cbbc8984448ded72adafc0b7740cd09ad157e Mon Sep 17 00:00:00 2001 From: Leo Li Date: Tue, 3 Nov 2026 11:48:39 -0800 Subject: [PATCH 2/3] Transcript: a click on a message row's first line holds the row's line #33249's stacked rows put a message's first line on its own line under the row (.cv-msgline__preview), and it toggles the row, but it is no fold toggle: a click there held nothing, the first line left as the row opened, and the transcript followed the bottom instead, moving the opened row up (116px in agent-message-row#sent-opened-long). foldToggleAt now maps a click on a first line to its row's line, the toggle it stands for. Co-Authored-By: Claude Opus 5.5 Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5 --- .../acpmux/conversation/foldAnchor.test.ts | 23 +++++++++++++++++++ .../acpmux/conversation/foldAnchor.ts | 8 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/webviews/src/agent-session/acpmux/conversation/foldAnchor.test.ts b/webviews/src/agent-session/acpmux/conversation/foldAnchor.test.ts index 2e65a54cbbcd..2130b76eaa2c 100644 --- a/webviews/src/agent-session/acpmux/conversation/foldAnchor.test.ts +++ b/webviews/src/agent-session/acpmux/conversation/foldAnchor.test.ts @@ -152,6 +152,29 @@ describe("foldToggleAt", () => { expect(folding).toBe(false); }); } + // A stacked message row's first line sits under the row and toggles it (messageLineLook.ts); it + // goes as the row opens, so the click holds the row's line, never the first line itself. + for (const [kind, html] of [ + [ + "a sent message", + '
first
', + ], + [ + "an agent message", + '
to
first
', + ], + [ + "a folded group's head", + '
a, b
', + ], + ] as const) { + test(`holds ${kind}'s line for a click on its first line`, () => { + const { document, at } = row(html); + const line = document.querySelector("b")!.parentElement; + expect(at("i")).toBe(line as HTMLElement); + expect(at(".cv-msgline__preview")).toBe(line as HTMLElement); + }); + } test("leaves a menu's trigger alone", () => { expect(row('').at("button")).toBeUndefined(); }); diff --git a/webviews/src/agent-session/acpmux/conversation/foldAnchor.ts b/webviews/src/agent-session/acpmux/conversation/foldAnchor.ts index c60df5e03e3d..434fe4361826 100644 --- a/webviews/src/agent-session/acpmux/conversation/foldAnchor.ts +++ b/webviews/src/agent-session/acpmux/conversation/foldAnchor.ts @@ -83,10 +83,16 @@ export type FoldAnchor = { until: number; }; +/// A message row's first line, on its own line under the row (messageLineLook.ts, stacked: a sent +/// message, an agent message, a received line, a folded group's head). It toggles its row, so a click +/// on it holds the row's line, as a click on the line does; the first line itself goes as the row opens. +const FIRST_LINE = ".cv-msgline__preview"; + /// The disclosure line `target` is on, inside one of `scroller`'s rows; undefined for anything else. export function foldToggleAt(target: EventTarget | null, scroller: HTMLElement): HTMLElement | undefined { const element = target && typeof (target as Element).closest === "function" ? (target as Element) : null; - const toggle = element?.closest(FOLD_TOGGLE); + const line = element?.closest(FIRST_LINE)?.previousElementSibling; + const toggle = line?.matches(FOLD_TOGGLE) ? (line as HTMLElement) : element?.closest(FOLD_TOGGLE); if (!toggle || !scroller.contains(toggle) || !toggle.closest(".acpmux-row")) return undefined; // A control of its own inside the toggle (a sent line's recipient, its Copy) opens nothing there. const control = element?.closest(NESTED_CONTROL); From 0fbf9043ea496a33ee7ef732bf09407ea076bd83 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Tue, 3 Nov 2026 16:39:07 -0800 Subject: [PATCH 3/3] gallery: minimal-open's shift row follows #33249's stacked lines; drop its mended center-line rows The Landing report click scores 0.0411 or 0.0498 depending on whether the settle catches one more frame of the fold; a render with this PR's foldAnchor.ts reverted scores the same 0.0729/0.0816 (cmux-ci run 41747022740), so the rise is #33249's taller lines, not the code change. Co-Authored-By: Claude Opus 5.5 Agent-Session: https://cmux.com/deeplink/agent?id=aid-3bab30503f0b9a7059e5 --- scripts/gallery-matrix/invariant-baseline.json | 6 +----- scripts/gallery-matrix/shift-baseline.json | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/gallery-matrix/invariant-baseline.json b/scripts/gallery-matrix/invariant-baseline.json index 2482150c6e02..1a02de5b9798 100644 --- a/scripts/gallery-matrix/invariant-baseline.json +++ b/scripts/gallery-matrix/invariant-baseline.json @@ -1272,11 +1272,7 @@ "center-line:row user-8", "center-line:row user-9" ], - "agent-pane.incoming-message#minimal-open": [ - "center-line:row user-10", - "center-line:row user-8", - "center-line:row user-9" - ], + "agent-pane.incoming-message#minimal-open": [], "agent-pane.incoming-message#notice": [], "agent-pane.incoming-message#opened": [ "center-line:row user-52" diff --git a/scripts/gallery-matrix/shift-baseline.json b/scripts/gallery-matrix/shift-baseline.json index 31164774dabe..37497fceaf9f 100644 --- a/scripts/gallery-matrix/shift-baseline.json +++ b/scripts/gallery-matrix/shift-baseline.json @@ -960,7 +960,7 @@ "agent-pane.incoming-message#minimal-fade-count": 0.0318, "agent-pane.incoming-message#minimal-inline-name": 0.0318, "agent-pane.incoming-message#minimal-off": 0, - "agent-pane.incoming-message#minimal-open": 0.0624, + "agent-pane.incoming-message#minimal-open": 0.0817, "agent-pane.incoming-message#notice": 0, "agent-pane.incoming-message#opened": 0, "agent-pane.incoming-message#reply": 0,