From 26c035d742845ea1a9fc36efe3263e1be37d1ac9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 14:09:56 -0400 Subject: [PATCH] fix(site): show condensed count for multi-provider in sessions list (#25705) (#25932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-pick of https://github.com/coder/coder/pull/25705 Original PR: #25705 — fix(site): show condensed count for multi-provider in sessions list Merge commit: fc01aeeb0f76f5fb6852a544de6805f5a5f30e2b Requested by: @tracyjohnsonux Co-authored-by: TJ --- .../ListSessionsPageView.stories.tsx | 1 + .../ListSessionsRow.stories.tsx | 27 ++++++++++++++++++ .../ListSessionsPage/ListSessionsRow.tsx | 28 +++++++++++-------- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsPageView.stories.tsx b/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsPageView.stories.tsx index 0c5f021969..ede9692b8e 100644 --- a/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsPageView.stories.tsx +++ b/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsPageView.stories.tsx @@ -92,6 +92,7 @@ export const MultipleSessions: Story = { ...MockSession, id: `session-${i}`, threads: i + 1, + providers: i % 2 === 0 ? ["anthropic", "openai"] : ["anthropic"], last_prompt: [ "But *can* I really fix it?", "Can you refactor the entire authentication module to use JWT tokens instead of session cookies?", diff --git a/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.stories.tsx b/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.stories.tsx index 1407977398..18db56d938 100644 --- a/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.stories.tsx +++ b/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.stories.tsx @@ -30,6 +30,33 @@ export const Default: Story = { }, }; +export const SingleProvider: Story = { + args: { + session: { + ...MockSession, + providers: ["anthropic"], + }, + }, +}; + +export const MultipleProviders: Story = { + args: { + session: { + ...MockSession, + providers: ["anthropic", "openai", "copilot"], + }, + }, +}; + +export const EmptyProviders: Story = { + args: { + session: { + ...MockSession, + providers: [], + }, + }, +}; + export const NullClient: Story = { args: { session: { ...MockSession, client: null }, diff --git a/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.tsx b/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.tsx index a630512b49..92dd035178 100644 --- a/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.tsx +++ b/site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsRow.tsx @@ -63,17 +63,23 @@ export const ListSessionsRow: FC = ({
- -
- -
- - {getProviderDisplayName(session.providers[0])} - -
+ {session.providers.length > 1 ? ( + + {session.providers.length} providers + + ) : session.providers.length === 1 ? ( + +
+ +
+ + {getProviderDisplayName(session.providers[0])} + +
+ ) : null}