fix(session-ui): keep message meta lines visible in the New timeline (#63749)

This commit is contained in:
Aarav Sareen
2026-11-13 17:25:12 +05:30
committed by GitHub
Unverified
parent 46aefe3da3
commit 5b131f5995
2 changed files with 35 additions and 40 deletions
@@ -890,6 +890,41 @@ test("groups consecutive sent prompts under the last one's meta line, with each
await expect(first.getByRole("button", { name: "More actions" })).toHaveCount(1)
})
test("keeps the meta lines under messages reachable in the New timeline", async ({ page }) => {
await setupTimeline(page, {
settings: { newTimeline: true },
messages: [
userMessage([userText("Add the footer check.", { id: "prt_msg_0001_footer_text" })], {
id: "msg_0001_footer",
created: 1700000000000,
}),
assistantMessage([{ id: "prt_msg_0002_footer_text", type: "text", text: "Added the footer check." }], {
id: "msg_0002_footer",
parentID: "msg_0001_footer",
created: 1700000001000,
}),
],
})
const content = page.locator("[data-timeline-virtual-content]")
const userRow = '[data-timeline-row="UserMessage"][data-message-id="msg_0001_footer"]'
const user = content.locator(userRow)
const reply = content.locator('[data-component="text-part"]', { hasText: "Added the footer check." })
await expect(reply).toBeVisible()
// Each virtual row clips to its measured height, so a meta line drawn below its row is cut off.
await user.locator('[data-slot="user-message-text"]').hover()
const meta = user.locator('[data-slot="user-message-copy-wrapper"]')
await expect(meta).toHaveCSS("opacity", "1")
const virtualRow = content.locator("[data-timeline-key]", { has: page.locator(userRow) })
const metaBox = (await meta.boundingBox())!
const rowBox = (await virtualRow.boundingBox())!
expect(metaBox.y + metaBox.height).toBeLessThanOrEqual(rowBox.y + rowBox.height)
// Hover only lands on what paints on top, so a clipped or covered Copy response never receives the pointer.
await reply.getByRole("button", { name: "Copy response" }).hover()
})
test("leaves a long prompt unfolded while Fold long messages is off", async ({ page }) => {
const text = Array.from({ length: 20 }, (_, index) => `Long line ${index + 1}`).join("\n")
@@ -404,26 +404,6 @@
padding-top: var(--timeline-gap-l);
}
/* The user's message actions show in the large gap below it rather than adding to it, above the row that follows so
they stay reachable. */
[data-timeline="next"][data-timeline-row="UserMessage"] {
position: relative;
z-index: 1;
[data-component="user-message"] {
position: relative;
}
[data-slot="user-message-copy-wrapper"] {
position: absolute;
inset-inline: 0;
top: 100%;
height: 28px;
margin-top: 0;
padding-top: 8px;
}
}
/* Rows are as tall as their text, so the gaps between them are the gaps that show. A row's 28px click area stays: 6px of
padding above and below, taken back by margins of the same size, so neighbouring click areas meet without overlapping.
An open row's header ends the small gap above its first nested row. */
@@ -497,21 +477,6 @@
text-box: trim-start text;
}
/* The agent's last words in a turn keep their actions in the large gap below them, as the user's message does. The
gap above the actions is their own padding, so the pointer stays over the message while it crosses to them. */
[data-component="text-part"]:has(> [data-slot="text-part-copy-wrapper"]) {
position: relative;
> [data-slot="text-part-copy-wrapper"] {
position: absolute;
inset-inline: 0;
top: 100%;
height: 28px;
margin-top: 0;
padding-top: 8px;
}
}
[data-component="context-tool-group-list"],
[data-component="timeline-event-list"] {
gap: var(--timeline-gap-s);
@@ -546,11 +511,6 @@
}
}
[data-timeline="next"][data-timeline-row="AssistantPart"]:has([data-slot="text-part-copy-wrapper"]) {
position: relative;
z-index: 1;
}
/* The live thought sits where the row it settles into will, which its frame spaces like any other row. */
[data-timeline="next"] [data-component="session-turn"] [data-slot="session-turn-thinking-row"][data-live-slot] {
margin-top: 0;