Skip to content

fix(site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline): hide "Session completed" until every thread has loaded#26955

Open
jakehwll wants to merge 1 commit into
mainfrom
jakehwll/hide-session-completed-until-loaded
Open

fix(site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline): hide "Session completed" until every thread has loaded#26955
jakehwll wants to merge 1 commit into
mainfrom
jakehwll/hide-session-completed-until-loaded

Conversation

@jakehwll

@jakehwll jakehwll commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🤖 This PR was written by Coder Agents on behalf of Jake Howell.

The "Session completed" marker at the bottom of an AI Gateway session timeline was rendered unconditionally, so on long sessions it appeared below still-loading threads while the user scrolled. That is misleading: users read it as the end of the session even when more threads are about to stream in.

Only render the session end marker (rows 7 and 8 of the grid: the connecting vertical line, the success dot, and the "Session completed" text) once every thread has loaded, that is, once both hasNextPage and isFetchingNextPage are false. The dashed timeline box still closes cleanly at the bottom, and the infinite-scroll spinner keeps rendering inside row 5 while more pages fetch.

Old New
preview-old-behaviour preview-new-heaviour

Verification

Rendered each SessionTimeline story via a headless Chromium and asserted whether "Session completed" is present:

Story hasNextPage isFetchingNextPage "Session completed"
OneThread false false visible
MultipleThreads false false visible
FetchingNextPage true true hidden
HasMoreThreadsToLoad (new) true false hidden

All checks pass locally:

  • pnpm format (no changes)
  • pnpm lint:check
  • pnpm lint:types
  • make pre-commit via githooks
Implementation notes
  • site/src/pages/AIBridgePage/SessionThreadsPage/SessionTimeline/SessionTimeline.tsx: wrap the row 7 spacer and row 8 status dot/text in !hasNextPage && !isFetchingNextPage.
  • SessionTimeline.stories.tsx: add HasMoreThreadsToLoad to cover the between-fetches state.
  • No prop signature or public API change; SessionTimelineSkeleton.tsx is untouched because the skeleton is only shown before any threads have loaded.

…: hide "Session completed" until every thread has loaded

The "Session completed" marker rendered at the bottom of the timeline
even while more threads were still being fetched, making it easy for
users scrolling a long session to mistake it for the actual end of the
session. Only render the end marker when both hasNextPage and
isFetchingNextPage are false, and add a HasMoreThreadsToLoad story that
exercises the between-fetches state.
@jakehwll jakehwll marked this pull request as ready for review July 2, 2026 05:35

@dannykopping dannykopping left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! It's a papercut I've been meaning to raise. I'll let Jeremy give the final ✅ but looks reasonable to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants