Skip to content

The agent that grows with you

fix(desktop): separate system timestamp text

Nick Morales5f2a15a669d4
diff --git a/apps/desktop/src/components/assistant-ui/thread/system-message.test.tsx b/apps/desktop/src/components/assistant-ui/thread/system-message.test.tsx
new file mode 100644
index 00000000000..df2b2219d3a
--- /dev/null
+++ b/apps/desktop/src/components/assistant-ui/thread/system-message.test.tsx
@@ -0,0 +1,74 @@
+import { AssistantRuntimeProvider, type ThreadMessage, useExternalStoreRuntime } from '@assistant-ui/react'
+import { cleanup, render } from '@testing-library/react'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+import { Thread } from '.'
+
+const timestamp = new Date('2026-05-01T00:00:00.000Z')
+
+class TestResizeObserver {
+ observe() {}
+ unobserve() {}
+ disconnect() {}
+}
+
+vi.stubGlobal('ResizeObserver', TestResizeObserver)
+vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) =>
+ window.setTimeout(() => callback(performance.now()), 0)
+)
+vi.stubGlobal('cancelAnimationFrame', (id: number) => window.clearTimeout(id))
+vi.stubGlobal('CSS', { escape: (str: string) => str })
+
+Element.prototype.scrollTo = function scrollTo() {}
+
+function Harness({ text }: { text: string }) {
+ const message = {
+ id: 'system-1',
+ role: 'system',
+ content: [{ type: 'text', text }],
+ createdAt: timestamp,
+ metadata: { custom: { timelineTimestamp: timestamp.getTime() / 1000 } }
+ } as unknown as ThreadMessage
+
+ const runtime = useExternalStoreRuntime<ThreadMessage>({
+ messages: [message],
+ isRunning: false,
+ onNew: async () => {}
+ })
+
+ return (
+ <AssistantRuntimeProvider runtime={runtime}>
+ <Thread />
+ </AssistantRuntimeProvider>
+ )
+}
+
+function expectTimestampSeparated(container: HTMLElement, precedingText: string) {
+ const row = container.querySelector('[data-role="system"]')
+ const stamp = row?.querySelector('[data-slot="timeline-timestamp"]')?.textContent
+
+ expect(stamp).toBeTruthy()
+ expect(row?.textContent).toContain(`${precedingText} ${stamp}`)
+}
+
+afterEach(cleanup)
+
+describe('system message timestamp text separation', () => {
+ it('separates an ordinary system row timestamp in accessible and copied text', () => {
+ const { container } = render(<Harness text="Review saved." />)
+
+ expectTimestampSeparated(container, 'Review saved.')
+ })
+
+ it('separates a slash-status timestamp in accessible and copied text', () => {
+ const { container } = render(<Harness text={'slash:/model\nmodel changed'} />)
+
+ expectTimestampSeparated(container, 'model changed')
+ })
+
+ it('separates a steer timestamp in accessible and copied text', () => {
+ const { container } = render(<Harness text="steer:rerun tests" />)
+
+ expectTimestampSeparated(container, 'rerun tests')
+ })
+})
diff --git a/apps/desktop/src/components/assistant-ui/thread/system-message.tsx b/apps/desktop/src/components/assistant-ui/thread/system-message.tsx
index dcaa7fd1c30..4fefc7a3069 100644
--- a/apps/desktop/src/components/assistant-ui/thread/system-message.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/system-message.tsx
@@ -61,6 +61,7 @@ export const SystemMessage: FC = () => {
<span className="text-muted-foreground/55">steered</span>
<span className="text-muted-foreground/35">·</span>
<span className="whitespace-pre-wrap">{steerNote.groups.text.trim()}</span>
+ {' '}
<MessageTimelineTimestamp />
</MessagePrimitive.Root>
)
@@ -93,6 +94,7 @@ export const SystemMessage: FC = () => {
<LinkifiedText className="whitespace-pre-wrap" explicitOnly pretty={false} text={output} />
</>
)}
+ {' '}
<MessageTimelineTimestamp className={cn(multiline ? 'mt-0.5 block' : 'ml-1.5')} />
</MessagePrimitive.Root>
)
@@ -110,6 +112,7 @@ export const SystemMessage: FC = () => {
data-slot="aui_system-message-root"
>
<LinkifiedText className="whitespace-pre-wrap" explicitOnly pretty={false} text={text} />
+ {' '}
<MessageTimelineTimestamp className={cn(multiline ? 'mt-0.5 block' : 'ml-1.5')} />
</MessagePrimitive.Root>
)