diff --git a/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.stories.tsx b/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.stories.tsx index 7700797bb2..7beb04b4c6 100644 --- a/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.stories.tsx +++ b/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.stories.tsx @@ -142,3 +142,13 @@ export const MultipleThreads: Story = { export const FetchingNextPage: Story = { args: { hasNextPage: true, isFetchingNextPage: true }, }; + +// The "Session completed" marker should stay hidden while more threads +// remain to be loaded so it cannot be misread as the end of the session. +export const HasMoreThreadsToLoad: Story = { + args: { + threads: [mockThread, mockThreadLong], + hasNextPage: true, + isFetchingNextPage: false, + }, +}; diff --git a/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx b/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx index 00fda27fea..7154e1ca7a 100644 --- a/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx +++ b/site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx @@ -563,23 +563,31 @@ export const SessionTimeline: FC = ({ {/* bottom right rounded corner */} - {/* row 7: sized intentionally to create the visual space below the timeline border */} -
- {/* vertical line */} -
+ {/* rows 7-8: session end marker. Only rendered once every thread + has loaded so "Session completed" cannot appear below + still-loading threads and be mistaken for the end of the + session. */} + {!hasNextPage && !isFetchingNextPage && ( + <> + {/* row 7: sized intentionally to create the visual space below the timeline border */} +
+ {/* vertical line */} +
- {/* row 8: session completed */} -
- -
-
- - Session completed - -
+ {/* row 8: session completed */} +
+ +
+
+ + Session completed + +
+ + )} );