Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
31 changes: 31 additions & 0 deletions apps/web/src/components/chat/MessagesTimeline.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,23 @@ function buildUserTimelineEntry(text: string) {
};
}

function buildAssistantTimelineEntry(text: string) {
return {
id: "assistant-entry-1",
kind: "message" as const,
createdAt: MESSAGE_CREATED_AT,
message: {
id: MessageId.make("assistant-message-1"),
role: "assistant" as const,
text,
turnId: null,
createdAt: MESSAGE_CREATED_AT,
updatedAt: MESSAGE_CREATED_AT,
streaming: false,
},
};
}

describe("MessagesTimeline", () => {
it("uses LegendList isNearEnd when deciding whether the live edge is visible", async () => {
const {
Expand Down Expand Up @@ -407,6 +424,20 @@ describe("MessagesTimeline", () => {
expect(markup).toContain('data-user-message-footer="true"');
});

it("keeps completed assistant message actions visible without hover", async () => {
const { MessagesTimeline } = await import("./MessagesTimeline");
const markup = renderToStaticMarkup(
<MessagesTimeline
{...buildProps()}
timelineEntries={[buildAssistantTimelineEntry("A completed response ready to copy.")]}
/>,
);

expect(markup).toContain('aria-label="Copy link"');
expect(markup).toContain('data-assistant-message-footer="persistent"');
expect(markup).not.toMatch(/data-assistant-message-footer="persistent"[^>]*opacity-0/);
});

it("renders context compaction entries in the normal work log", async () => {
const { MessagesTimeline } = await import("./MessagesTimeline");
const markup = renderToStaticMarkup(
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,10 @@ function AssistantTimelineRow({ row }: { row: Extract<TimelineRow, { kind: "mess
onOpenTurnDiff={ctx.onOpenTurnDiff}
/>
{row.showAssistantMeta ? (
<div className="mt-1.5 flex items-center gap-2 text-xs tabular-nums opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover/assistant:opacity-100">
<div
className="mt-1.5 flex items-center gap-2 text-xs tabular-nums"
data-assistant-message-footer="persistent"
>
<AssistantCopyButton row={row} />
{!row.message.streaming && (
<Tooltip>
Expand Down
Loading