Visitar URL original
fix(session-ui): keep message meta lines visible in the New timeline … · anomalyco/opencode@5b131f5 · GitHub
Skip to content

Commit 5b131f5

Browse files
authored
fix(session-ui): keep message meta lines visible in the New timeline (#63749)
1 parent 46aefe3 commit 5b131f5

2 files changed

Lines changed: 35 additions & 40 deletions

File tree

‎packages/app/e2e/regression/timeline-geometry.spec.ts‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,41 @@ test("groups consecutive sent prompts under the last one's meta line, with each
890890
await expect(first.getByRole("button", { name: "More actions" })).toHaveCount(1)
891891
})
892892

893+
test("keeps the meta lines under messages reachable in the New timeline", async ({ page }) => {
894+
await setupTimeline(page, {
895+
settings: { newTimeline: true },
896+
messages: [
897+
userMessage([userText("Add the footer check.", { id: "prt_msg_0001_footer_text" })], {
898+
id: "msg_0001_footer",
899+
created: 1700000000000,
900+
}),
901+
assistantMessage([{ id: "prt_msg_0002_footer_text", type: "text", text: "Added the footer check." }], {
902+
id: "msg_0002_footer",
903+
parentID: "msg_0001_footer",
904+
created: 1700000001000,
905+
}),
906+
],
907+
})
908+
909+
const content = page.locator("[data-timeline-virtual-content]")
910+
const userRow = '[data-timeline-row="UserMessage"][data-message-id="msg_0001_footer"]'
911+
const user = content.locator(userRow)
912+
const reply = content.locator('[data-component="text-part"]', { hasText: "Added the footer check." })
913+
await expect(reply).toBeVisible()
914+
915+
// Each virtual row clips to its measured height, so a meta line drawn below its row is cut off.
916+
await user.locator('[data-slot="user-message-text"]').hover()
917+
const meta = user.locator('[data-slot="user-message-copy-wrapper"]')
918+
await expect(meta).toHaveCSS("opacity", "1")
919+
const virtualRow = content.locator("[data-timeline-key]", { has: page.locator(userRow) })
920+
const metaBox = (await meta.boundingBox())!
921+
const rowBox = (await virtualRow.boundingBox())!
922+
expect(metaBox.y + metaBox.height).toBeLessThanOrEqual(rowBox.y + rowBox.height)
923+
924+
// Hover only lands on what paints on top, so a clipped or covered Copy response never receives the pointer.
925+
await reply.getByRole("button", { name: "Copy response" }).hover()
926+
})
927+
893928
test("leaves a long prompt unfolded while Fold long messages is off", async ({ page }) => {
894929
const text = Array.from({ length: 20 }, (_, index) => `Long line ${index + 1}`).join("\n")
895930

‎packages/session-ui/src/timeline-next/timeline-next.css‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -404,26 +404,6 @@
404404
padding-top: var(--timeline-gap-l);
405405
}
406406

407-
/* The user's message actions show in the large gap below it rather than adding to it, above the row that follows so
408-
they stay reachable. */
409-
[data-timeline="next"][data-timeline-row="UserMessage"] {
410-
position: relative;
411-
z-index: 1;
412-
413-
[data-component="user-message"] {
414-
position: relative;
415-
}
416-
417-
[data-slot="user-message-copy-wrapper"] {
418-
position: absolute;
419-
inset-inline: 0;
420-
top: 100%;
421-
height: 28px;
422-
margin-top: 0;
423-
padding-top: 8px;
424-
}
425-
}
426-
427407
/* 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
428408
padding above and below, taken back by margins of the same size, so neighbouring click areas meet without overlapping.
429409
An open row's header ends the small gap above its first nested row. */
@@ -497,21 +477,6 @@
497477
text-box: trim-start text;
498478
}
499479

500-
/* The agent's last words in a turn keep their actions in the large gap below them, as the user's message does. The
501-
gap above the actions is their own padding, so the pointer stays over the message while it crosses to them. */
502-
[data-component="text-part"]:has(> [data-slot="text-part-copy-wrapper"]) {
503-
position: relative;
504-
505-
> [data-slot="text-part-copy-wrapper"] {
506-
position: absolute;
507-
inset-inline: 0;
508-
top: 100%;
509-
height: 28px;
510-
margin-top: 0;
511-
padding-top: 8px;
512-
}
513-
}
514-
515480
[data-component="context-tool-group-list"],
516481
[data-component="timeline-event-list"] {
517482
gap: var(--timeline-gap-s);
@@ -546,11 +511,6 @@
546511
}
547512
}
548513

549-
[data-timeline="next"][data-timeline-row="AssistantPart"]:has([data-slot="text-part-copy-wrapper"]) {
550-
position: relative;
551-
z-index: 1;
552-
}
553-
554514
/* The live thought sits where the row it settles into will, which its frame spaces like any other row. */
555515
[data-timeline="next"] [data-component="session-turn"] [data-slot="session-turn-thinking-row"][data-live-slot] {
556516
margin-top: 0;

0 commit comments

Comments
 (0)