From 41d4a9c45cab93a55d390fc835d5441119ec3c4a Mon Sep 17 00:00:00 2001 From: Luke Parker <10430890+Hona@users.noreply.github.com> Date: Tue, 29 Sep 2026 14:58:13 +1000 Subject: [PATCH] fix(session-ui): render moved notice as a timeline divider (#52009) --- .../session-timeline-notices.spec.ts | 10 ++--- .../src/components/timeline-separator.tsx | 43 +++++++++++++++++-- .../session-ui/src/timeline/projection.ts | 7 ++- .../src/timeline/rows-current.test.ts | 34 +++++++++++++++ .../src/timeline/session-timeline-row.tsx | 26 +++-------- .../src/timeline/timeline-row.stories.tsx | 2 +- 6 files changed, 90 insertions(+), 32 deletions(-) diff --git a/packages/session-ui/component-tests/session-timeline-notices.spec.ts b/packages/session-ui/component-tests/session-timeline-notices.spec.ts index 3c18e403c6d..2a476c576af 100644 --- a/packages/session-ui/component-tests/session-timeline-notices.spec.ts +++ b/packages/session-ui/component-tests/session-timeline-notices.spec.ts @@ -1,7 +1,7 @@ import { expect, story } from "../../storybook/playwright/story" // Moved from packages/app/e2e/regression/session-timeline-notices.spec.ts -story("renders the moved location notice in its compact timeline style", async ({ mount, page }) => { +story("renders the moved location notice as a timeline divider", async ({ mount, page }) => { const directory = `/Users/usrnk1/Developer/opencode/${"nested-directory/".repeat(24)}session` await page.setViewportSize({ width: 480, height: 720 }) const timeline = await mount("current-session-timeline-rows--conversation", { args: { scenario: "location" } }) @@ -14,12 +14,10 @@ story("renders the moved location notice in its compact timeline style", async ( await expect(value).toHaveText(directory) await expect(notice).not.toContainText("ยท") await expect(notice.locator("svg")).toHaveCount(0) - await expect(notice).toHaveCSS("height", "28px") - await expect(notice).toHaveCSS("gap", "8px") - await expect(notice).toHaveCSS("padding-top", "4px") - await expect(notice).toHaveCSS("padding-bottom", "4px") + await expect(notice).toHaveCSS("padding-top", "8px") + await expect(notice).toHaveCSS("padding-bottom", "8px") await expect(label).toHaveCSS("font-size", "13px") - await expect(label).toHaveCSS("font-weight", "530") + await expect(label).toHaveCSS("font-weight", "440") await expect(label).toHaveCSS("line-height", "16px") await expect(label).toHaveCSS("color", "rgb(128, 128, 128)") await expect(value).toHaveCSS("font-size", "13px") diff --git a/packages/session-ui/src/components/timeline-separator.tsx b/packages/session-ui/src/components/timeline-separator.tsx index dfe1d0a5825..fdb3700e18a 100644 --- a/packages/session-ui/src/components/timeline-separator.tsx +++ b/packages/session-ui/src/components/timeline-separator.tsx @@ -1,7 +1,25 @@ import { ProviderIcon } from "@opencode/ui/provider-icon" +import { Tooltip } from "@opencode/ui/tooltip" import { Show } from "solid-js" -export function TimelineSeparator(props: { label: string; providerID?: string; variant?: string }) { +export function TimelineSeparator(props: { + label: string + value?: string + tooltip?: string + providerID?: string + variant?: string +}) { + const label = () => ( + + {props.label} + + ) return (
@@ -10,9 +28,26 @@ export function TimelineSeparator(props: { label: string; providerID?: string; v {(providerID) =>