Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions webviews/src/agent-session/acpmux/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ import { configureLiveLineBelow, useLiveLineBelow } from "./liveLineBelow";
import { configureToolRunLook } from "./toolRunLook";
import { configureSentLook } from "./conversation/SentMessageLine";
import { configureInboxNoticeLook } from "./conversation/inboxNoticeLook";
import { configureMessageLineLook } from "./conversation/messageLineLook";
import { configureNoticeLook } from "./conversation/noticeLook";
import { InboxNoticeCard } from "./conversation/InboxNoticeCard";
import { mergeInboxNotices, type InboxMessage } from "./conversation/inboxNotice";
Expand Down Expand Up @@ -10587,6 +10588,7 @@ function AcpmuxPane() {
configureToolRunLook(theme.toolRunLook);
configureSentLook(theme.sentLook);
configureInboxNoticeLook(theme.inboxNoticeLook);
configureMessageLineLook(theme.messageLineLook);
configureNoticeLook(theme.noticeLook);
configureTurnActionsPlacement(theme.turnActionsPlacement);
configureSubagentTray(theme.subagentTray);
Expand Down
4 changes: 2 additions & 2 deletions webviews/src/agent-session/acpmux/composer.gallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1692,8 +1692,8 @@ export default agentPaneEntry({
],
}),
play: async (ctx) => {
// It waits in the one collapsed group of waiting messages (PendingMessagesCard.tsx).
await ctx.click({ selector: ".cv-pending__toggle" });
// It waits as its own line; with others it waits in their one collapsed group (PendingMessagesCard.tsx).
if (ctx.document.querySelector(".cv-pending__toggle")) await ctx.click({ selector: ".cv-pending__toggle" });
await ctx.waitFor(() => ctx.document.querySelector('[data-queued-message="q1"] .cv-disclosure__toggle'));
await ctx.click({ selector: '[data-queued-message="q1"] .cv-disclosure__toggle' });
await ctx.waitFor(() =>
Expand Down
35 changes: 35 additions & 0 deletions webviews/src/agent-session/acpmux/conversation/AgentMessageRow.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ button.cv-agentmsg__name:focus-visible {
> .cv-agentmsg__chevron {
color: var(--cv-text);
}
/* Stacked or opened, the toggle holds no words and has no box of its own: the line, which the
pointer already toggles, shows its focus. */
.cv-agentmsg__line:has(.cv-agentmsg__toggle:focus-visible > .cv-agentmsg__preview:empty) {
outline: 1.5px solid color-mix(in srgb, var(--agent-accent) 55%, transparent);
outline-offset: -1.5px;
border-radius: 6px;
}
.cv-agentmsg__toggle:focus-visible {
/* Inset: the transcript row clips paint (`contain: paint`). */
outline: 1.5px solid color-mix(in srgb, var(--agent-accent) 55%, transparent);
Expand Down Expand Up @@ -216,3 +223,31 @@ button.cv-agentmsg__name:focus-visible {
.cv-agentmsg__line:is(:hover, :active, :focus-within):not(:has(.cv-agent-tag.is-open:is(:hover, :focus))) {
color: var(--cv-text);
}

/* A stacked message row's first line (messageLineLook.ts, the default): on its own line under the
row's verb, recipient and count, at the text column, dim, cut there with one ellipsis (Leo said
yes, 2026-11-02, to splitting "Sent to <chip> · and 5 more commands <preview>" so the chip and
count read on the first line and the preview below). The row's one tone, never lit on hover.
model.ts adds its --cv-message-preview-line (MESSAGE_PREVIEW_LINE_PT) under the 22px row. */
.cv-msgline__preview {
box-sizing: border-box;
height: var(--cv-message-preview-line);
min-width: 0;
padding-inline-start: var(--cv-tool-text-inset);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--cv-text-dim);
font-size: var(--text-detail);
line-height: var(--cv-message-preview-line);
letter-spacing: var(--text-detail--letter-spacing);
cursor: default;
user-select: none;
}
/* In a column that spaces its parts by the tool group's inner gap (`.cv-agentmsg`, `.cv-disclosure`),
the first line still sits right under its row, as a send's does: the row and its first line are
one entry (model.ts `messagePreviewLine`, 18px under the row). */
.cv-agentmsg > .cv-msgline__preview,
.cv-disclosure > .cv-msgline__preview {
margin-top: calc(-1 * var(--grid-gap-inner));
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ChevronRight } from "./icons";
import { clipMessagePreview } from "./clipMessagePreview";
import { HEADER_TOGGLE_ATTRIBUTE, headerToggleClick } from "./headerToggle";
import { AgentTag } from "./AgentTag";
import { useMessageLineLook } from "./messageLineLook";
import "./AgentMessageRow.css";

/// The message's first line of text as it reads, its spaces collapsed and its Markdown marks (a
Expand Down Expand Up @@ -81,6 +82,10 @@ export function AgentMessageRow({
}) {
const bodyId = useId();
const [before = "", after = ""] = sentence.split("\u0000");
// Stacked (the default, messageLineLook.ts): the first line under the row, on its own line.
const look = useMessageLineLook();
const inline = look === "single" && !open ? preview : "";
const below = look === "stacked" && !open ? preview : "";
return (
<div
className={`cv-agentmsg${failed ? " is-failed" : ""}${className ? ` ${className}` : ""}`}
Expand Down Expand Up @@ -129,7 +134,7 @@ export function AgentMessageRow({
onClick={onToggle}
>
{/* Open, the message is under the line: its first line here would say it twice. */}
<span className="cv-agentmsg__preview">{open ? "" : preview}</span>
<span className="cv-agentmsg__preview">{inline}</span>
</button>
{/* The hover row stays in the sentence column: the trailing column holds only status. */}
{actions}
Expand All @@ -139,6 +144,13 @@ export function AgentMessageRow({
<ChevronRight size={14} strokeWidth={1.2} className={`cv-rotor${open ? " is-open" : ""}`} />
</span>
</div>
{below && (
// Its words are the toggle's label too, so a screen reader reads them there.
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<div className="cv-msgline__preview cv-agentmsg__below" aria-hidden onClick={onToggle}>
{below}
</div>
)}
{open && (
<div id={bodyId} className="cv-agentmsg__card selectable">
{body}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ const received = () =>
{ isWorking: true },
);
const RECEIVED_LINE = ".cv-received > .cv-disclosure__line";
/// Opens the group of waiting messages, which shows collapsed (PendingMessagesCard.tsx).
/// Opens the group of waiting messages, which shows collapsed (PendingMessagesCard.tsx); one waiting
/// message is its own line, with no group to open.
const openWaiting: Play = async (ctx) => {
await ctx.click({ selector: ".cv-pending__toggle" });
if (ctx.document.querySelector(".cv-pending__toggle")) await ctx.click({ selector: ".cv-pending__toggle" });
await ctx.waitFor(() => ctx.document.querySelector(RECEIVED_LINE));
};

Expand Down
13 changes: 10 additions & 3 deletions webviews/src/agent-session/acpmux/conversation/InboxNoticeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import { useContext, useEffect, useId, useLayoutEffect, useMemo, useState, type ReactNode } from "react";
import { useT } from "../i18n";
import { DisclosureRow } from "../subagents/DisclosureRow";
import { useMessageLineLook } from "./messageLineLook";
import { PromptMarksSession } from "../threadMinimap/promptMarks";
import { mentionedRepository } from "../../../githubReferences";
import { CardCopy } from "./CardCopy";
Expand Down Expand Up @@ -115,6 +116,9 @@ function InboxThreadLine({
}, [holds, reveal]);
// Several messages each say who sent them; one alone is under its sender's line already.
const heads = (messages?.length ?? 0) > 1;
// Stacked (the default, messageLineLook.ts): the preview on its own line under the sender.
const lineLook = useMessageLineLook();
const preview = thread.preview || t("message.noText");
return (
<DisclosureRow
className="cv-received cv-inbox__thread"
Expand All @@ -127,12 +131,15 @@ function InboxThreadLine({
label={
<>
{thread.label && <span className="cv-inbox__label">{thread.label}</span>}
<span className="cv-received__preview" data-find-skip="">
{thread.preview || t("message.noText")}
</span>
{lineLook === "single" && (
<span className="cv-received__preview" data-find-skip="">
{preview}
</span>
)}
{thread.count > 1 && <span className="cv-inbox__more">{t("tools.more", { n: thread.count - 1 })}</span>}
</>
}
below={lineLook === "stacked" && !open ? preview : undefined}
>
<CardCopy text={whole} />
<div className="cv-received__text selectable">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ import { MessageScopeContext, type MessageScope } from "../chips/messageScope";
import { mentionedRepository } from "../../../githubReferences";
import { useAnchoredCollapse } from "./useAnchoredCollapse";
import { laneNotice } from "./laneReport";
import "./AgentMessageRow.css";
import "./LaneNoticeBatch.css";
import { messageOpened, setMessageOpened } from "./incomingOpened";
import { useTranscriptDisclosure } from "./transcriptDisclosure";
import { useTranscriptReadOnly } from "./readOnly";
import { Face } from "../multiplayer/Faces";
import { FileAttachment, type FileAttachmentInfo } from "../FileAttachment";
import { isGuest, type Participant } from "../multiplayer/participants";
import { useMessageLineLook } from "./messageLineLook";
import type { AgentNotice } from "./agentNotice";
import { NoticeMark, SEVERITY_LABEL } from "./NoticeMark";
import { noticeMarkdown } from "./agentNotice";
Expand Down Expand Up @@ -312,6 +314,7 @@ export function IncomingMessageLine({
// estimator reads it.
const [opened, setOpen] = useState(() => messageOpened(session, id));
const open = whole || opened;
const lineLook = useMessageLineLook();
const show = (next: boolean) => {
setMessageOpened(session, id, next);
setOpen(next);
Expand Down Expand Up @@ -433,22 +436,26 @@ export function IncomingMessageLine({
lineClassName="cv-agent-activity-row"
toggleLabel={t("message.collapsedLabel", { from, preview: preview || t("message.noText") })}
label={
// Find counts the panel's whole text, not the line's first-line copy of it.
// A notice's title is its text (the row's, which Find searches): Find highlights it here,
// inside the line Find otherwise skips (chatFind.ts `findSkipped`).
<span
className={`cv-received__preview${agentNotice ? " cv-notice__title" : ""}`}
data-find-skip={agentNotice ? undefined : ""}
data-find-keep={agentNotice ? "" : undefined}
>
{agentNotice && look === "tag" && agentNotice.severity !== "info" && (
<span className="cv-notice__tag" data-severity={agentNotice.severity} data-find-skip="">
{t(SEVERITY_LABEL[agentNotice.severity])}
</span>
)}
{preview || t("message.noText")}
</span>
// Find counts the panel's whole text, not the line's first-line copy of it. Stacked (the
// default, messageLineLook.ts) a message's first line is under the sender, on its own line.
// A notice's title is its text (the row's, which Find searches) and stays on the line: Find
// highlights it here, inside the line Find otherwise skips (chatFind.ts `findSkipped`).
lineLook === "single" || agentNotice ? (
<span
className={`cv-received__preview${agentNotice ? " cv-notice__title" : ""}`}
data-find-skip={agentNotice ? undefined : ""}
data-find-keep={agentNotice ? "" : undefined}
>
{agentNotice && look === "tag" && agentNotice.severity !== "info" && (
<span className="cv-notice__tag" data-severity={agentNotice.severity} data-find-skip="">
{t(SEVERITY_LABEL[agentNotice.severity])}
</span>
)}
{preview || t("message.noText")}
</span>
) : null
}
below={lineLook === "stacked" && !open && !agentNotice ? preview || t("message.noText") : undefined}
// It opens at once, its height alone moving, as the message's card always did; closing fades.
fadeIn={false}
// One slot at the line's end, over the preview's tail, shown on hover or focus: it never moves
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,13 @@
display: none;
}
}
/* Stacked (messageLineLook.ts): the senders on their own line under the count, at the text column
(`.cv-msgline__preview`, AgentMessageRow.css), a whole line of the head's box even where the head
sits in a flex line (PendingMessagesCard.css `.cv-pending__line`). */
.cv-message-group__below {
flex: 0 0 100%;
width: 100%;
}
.cv-pending__line:has(> .cv-message-group__below) {
flex-wrap: wrap;
}
68 changes: 42 additions & 26 deletions webviews/src/agent-session/acpmux/conversation/MessageGroupHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { ChevronRight } from "./icons";
import { SenderMark } from "./IncomingMessageCard";
import type { IncomingMessage } from "./incomingMessage";
import { useInboxNoticeLook } from "./inboxNoticeLook";
import { useMessageLineLook } from "./messageLineLook";
import "./AgentMessageRow.css";
import "./MessageGroupHead.css";

const ROW_ICON = rowIconSize(12);
Expand Down Expand Up @@ -66,32 +68,46 @@ export function MessageGroupHead({
mark?: ReactNode;
}) {
const look = useInboxNoticeLook();
// Stacked (the default, messageLineLook.ts): the senders on their own line under the count, cut
// there, as a message row's first line is; `quiet` keeps them in the tooltip only.
const lineLook = useMessageLineLook();
const below = lineLook === "stacked" && look !== "group-count" && !open ? senders : undefined;
const inline = lineLook === "single" ? senders : undefined;
return (
<button
type="button"
className={`cv-tool cv-message-group__head${className ? ` ${className}` : ""}`}
data-look={look}
data-find-skip=""
aria-expanded={open}
aria-controls={open ? bodyId : undefined}
aria-label={ariaLabel}
title={hint || senders || undefined}
// The row is as wide as the pane (a tool row): its hover shows at its words, as a tool row's
// label tooltip does, never under the row's middle (Leo, 2026-11-03: "this hover preview is in
// the wrong place!").
data-tooltip-anchor=".cv-tool__text"
onClick={onToggle}
>
<span className={`cv-tool__icon${iconClassName ? ` ${iconClassName}` : ""}`} aria-hidden="true">
{mark ?? (sender ? <SenderMark message={sender} /> : <Icon name="agent.chat" size={ROW_ICON} row />)}
</span>
<span className="cv-tool__text">
<span className="cv-message-group__count">{count}</span>
{senders && <span className="cv-message-group__senders">{senders}</span>}
</span>
<span className="cv-tool__chevron" aria-hidden="true">
<ChevronRight size={12} strokeWidth={1.4} className={`cv-rotor${open ? " is-open" : ""}`} />
</span>
</button>
<>
<button
type="button"
className={`cv-tool cv-message-group__head${className ? ` ${className}` : ""}`}
data-look={look}
data-find-skip=""
aria-expanded={open}
aria-controls={open ? bodyId : undefined}
aria-label={ariaLabel}
title={hint || senders || undefined}
// The row is as wide as the pane (a tool row): its hover shows at its words, as a tool row's
// label tooltip does, never under the row's middle (Leo, 2026-11-03: "this hover preview is in
// the wrong place!").
data-tooltip-anchor=".cv-tool__text"
onClick={onToggle}
>
<span className={`cv-tool__icon${iconClassName ? ` ${iconClassName}` : ""}`} aria-hidden="true">
{mark ?? (sender ? <SenderMark message={sender} /> : <Icon name="agent.chat" size={ROW_ICON} row />)}
</span>
<span className="cv-tool__text">
<span className="cv-message-group__count">{count}</span>
{inline && <span className="cv-message-group__senders">{inline}</span>}
</span>
<span className="cv-tool__chevron" aria-hidden="true">
<ChevronRight size={12} strokeWidth={1.4} className={`cv-rotor${open ? " is-open" : ""}`} />
</span>
</button>
{below && (
// The head's tooltip and label already name them; this line is for the eye and the pointer.
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
<div className="cv-msgline__preview cv-message-group__below" aria-hidden data-find-skip="" onClick={onToggle}>
{below}
</div>
)}
</>
);
}
Loading