Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
33 changes: 27 additions & 6 deletions webviews/src/agent-session/acpmux/conversation/conversation.css
Original file line number Diff line number Diff line change
Expand Up @@ -1165,11 +1165,15 @@
border-bottom: 1px solid var(--cv-strong-rule);
white-space: nowrap;
}
/* Row rules a step over the faint rule (4.5%) and the first column, which names each row, in the
label weight, so the table reads distinctly at a glance (Leo, 2026-10-31: "at least the left side
of our table if we're gonna have it should be more distinctly there it's all almost a bit too
faint"). The header keeps its strong rule. */
.cv-table td {
border-bottom: 1px solid var(--cv-faint-rule);
border-bottom: 1px solid var(--cv-table-rule, color-mix(in srgb, var(--cv-fg) 9%, transparent));
}
/* A table with an empty top-left corner labels its rows with its first column. */
.cv-table--labeled td:first-child {
/* The first column labels its rows (a table with an empty top-left corner says so outright). */
.cv-table td:first-child {
font-weight: 500;
}
.cv-table th:last-child,
Expand Down Expand Up @@ -4901,17 +4905,34 @@ article.acpmux-row:not(:has(> :not(.acpmux-row__gap))) {
min-height: 0;
padding-bottom: var(--cv-meta-gap);
}
/* The footer's line sits in the middle of the room between the reply's last line and what follows
(Leo, 2026-10-31: "when i hover this little whatever time ago copy sound ellipsis thing should be
centered in between the two things you're saying in between / so padding after == padding before
that kinda thing all around"). The reply's text box ends a line's half-leading (about 3px) over
its row, then the meta gap: 7px over the line against the turn gap's 16px under it. The line
moves down inside its own row by half that difference (--cv-footer-drop), taken off its bottom
padding, so every footer keeps its height (model.ts estimates, the running line it replaces) and
nothing around it moves. Over the same agent's next reply, whose first line has the same
half-leading, it moves half as far. test/agent-pane-transcript-spacing.test.ts measures it. */
.acpmux-row.acpmux-turnSummary {
--cv-footer-drop: var(--ds-space-1, 4px);
/* An empty footer's absolute hover controls still need their complete line. */
min-height: var(--cv-meta-row);
padding-bottom: var(--cv-turn-gap);
padding-top: var(--cv-footer-drop);
padding-bottom: calc(var(--cv-turn-gap) - var(--cv-footer-drop));
}
/* The chat's last footer keeps the normal turn gap above the composer. */
.acpmux-row.acpmux-turnSummary.acpmux-row--last-footer {
padding-bottom: var(--cv-turn-gap);
padding-bottom: calc(var(--cv-turn-gap) - var(--cv-footer-drop));
}
/* The footer that ends the chat has no next row to centre on: under it is the rest gap over the
composer (model.ts REST_GAP), so its line stays put. */
.acpmux-row.acpmux-turnSummary.acpmux-row--last-footer:not(:has(~ .acpmux-row)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This selector counts hidden bookkeeping articles as a following row, although nextDrawnRow skips them. A final footer after hidden rows therefore keeps the 4px drop and shifts its line over the composer rest gap; exclude empty row siblings when detecting the logical end.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At webviews/src/agent-session/acpmux/conversation/conversation.css, line 4930:

<comment>This selector counts hidden bookkeeping articles as a following row, although `nextDrawnRow` skips them. A final footer after hidden rows therefore keeps the 4px drop and shifts its line over the composer rest gap; exclude empty row siblings when detecting the logical end.</comment>

<file context>
@@ -4921,11 +4921,14 @@ article.acpmux-row:not(:has(> :not(.acpmux-row__gap))) {
+}
+/* The footer that ends the chat has no next row to centre on: under it is the rest gap over the
+   composer (model.ts REST_GAP), so its line stays put. */
+.acpmux-row.acpmux-turnSummary.acpmux-row--last-footer:not(:has(~ .acpmux-row)) {
   --cv-footer-drop: 0px;
-  padding-bottom: var(--cv-turn-gap);
</file context>

--cv-footer-drop: 0px;
}
.acpmux-row.acpmux-turnSummary.acpmux-row--continuation-footer {
padding-bottom: var(--cv-continuation-gap);
--cv-footer-drop: 2px;
padding-bottom: calc(var(--cv-continuation-gap) - var(--cv-footer-drop));
}
/* A legacy/history turn can end without a footer. Mark only its latest row so the composer keeps
the normal turn rhythm without a permanent runway below every turn. */
Expand Down
16 changes: 16 additions & 0 deletions webviews/test/agent-pane-transcript-spacing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,19 @@ await requireBrowserLane("agent-pane-transcript-spacing.test.ts", async () => {
const lastFooterTime = footers.at(-1)!.querySelector(".cv-turn-time")!;
const lastReply = reply("Meanwhile the PR checks");
const dock = document.querySelector<HTMLElement>(".acpmux-main[data-dock=float] > .acpmux-dock")!;
// The reply's last line's text box (its content area, the line less its half-leading), the
// footer's 24px line, and the next prompt's bubble: the line sits in the middle of that room.
const lastLineBottom = (node: Element) => {
const range = document.createRange();
range.selectNodeContents(node);
const lines = [...range.getClientRects()].filter((box) => box.height > 0);
return lines.at(-1)!.bottom;
};
const firstFooter = footers[0]!;
const firstFooterReply = reply("Not yet: the hosted test run");
return {
footerRoomAbove: rect(firstFooter).top - lastLineBottom(firstFooterReply),
footerRoomBelow: rect(last).top - rect(firstFooter).bottom,
metaRowUnderBubble: Math.round(rect(lastActions).top - rect(last).bottom),
metaRowHeight: Math.round(rect(lastActions).height),
olderPromptToNext: Math.round(rect(firstContent).top - rect(first).bottom),
Expand Down Expand Up @@ -231,6 +243,10 @@ await requireBrowserLane("agent-pane-transcript-spacing.test.ts", async () => {
// footer's line to the next prompt.
expect(measured.footerToNextPrompt).toBeGreaterThanOrEqual(12);
expect(measured.footerToNextPrompt).toBeLessThanOrEqual(20);
// A footer's line is centred between the reply's last line and the next prompt (Leo, 2026-10-31:
// "padding after == padding before that kinda thing all around"). Before: 7px over it and 16px
// under. The last footer instead rests the rest gap over the composer (below).
expect(Math.abs(measured.footerRoomAbove - measured.footerRoomBelow)).toBeLessThanOrEqual(1.5);
// The last footer rests the rest gap over the floating composer (model.ts REST_GAP, about two
// and a half body lines, as Codex leaves; agent-pane-composer-rest-gap.test.ts holds it in every
// state).
Expand Down
14 changes: 8 additions & 6 deletions webviews/test/transcript-continuation-spacing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,21 @@ await requireBrowserLane("transcript-continuation-spacing.test.ts", async () =>
() => document.querySelector('[data-row-id="continuation-b"]')!.getBoundingClientRect().top > 0,
);
const actual = await measure(page);
expect(actual.same).toBeCloseTo(8, 1);
expect(actual.peer).toBeCloseTo(16, 1);
expect(actual.user).toBeCloseTo(16, 1);
expect(actual.paddings).toEqual([8, 16, 16, 16]);
// A footer's line moves down inside its row (--cv-footer-drop: 2px over the same agent, else
// 4px) to sit centred between the reply and the next row; the drop comes off the bottom padding.
expect(actual.same).toBeCloseTo(6, 1);
expect(actual.peer).toBeCloseTo(12, 1);
expect(actual.user).toBeCloseTo(12, 1);
expect(actual.paddings).toEqual([6, 12, 12, 12]);
await page.evaluate(() => {
const root = document.documentElement;
root.style.setProperty("--ds-space-2", "10px");
root.style.setProperty("--ds-space-4", "20px");
});
await page.waitForFunction(
() => getComputedStyle(document.querySelector('[data-row-id="continuation-footer-a"]')!).paddingBottom === "10px",
() => getComputedStyle(document.querySelector('[data-row-id="continuation-footer-a"]')!).paddingBottom === "8px",
);
expect((await measure(page)).paddings).toEqual([10, 20, 20, 20]);
expect((await measure(page)).paddings).toEqual([8, 16, 16, 16]);
await page.close();
});
test("public gallery before/after capture", async () => {
Expand Down