From 10e9cb90e759176bbea9071df9274bbc8cba2b7e Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 3 Oct 2026 07:20:57 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=B0=EF=B8=8F=20feat:=20Status=20on=20t?= =?UTF-8?q?he=20Avatar,=20a=20Finished=20Group,=20and=20Project=20Chats=20?= =?UTF-8?q?in=20the=20Sidebar=20List?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Running chats ring their avatar instead of a trailing spinner, so the row menu stays reachable mid-run. - A reply that lands unseen lifts its chat into a Finished group under Running until it is opened; chats marked unread by hand keep their date. - Running and Finished headings show their counts and announce them. - Project chats now list under Chats with their folder badge; a persisted Show project chats toggle in the chat list menu restores the project-only view. - Badges read project names from the loaded project list before fetching one by id. - Spinner takes a strokeWidth for the thin ring. --- .../Conversations/ChatFilterMenu.tsx | 18 ++- .../Conversations/Conversations.tsx | 62 +++++--- client/src/components/Conversations/Convo.tsx | 52 ++++--- .../components/Conversations/ConvoLink.tsx | 10 +- .../components/Conversations/ProjectBadge.tsx | 12 +- .../__tests__/Conversations.test.tsx | 4 +- .../__tests__/Convo.status.spec.tsx | 142 ++++++++++++++++++ .../__tests__/DateLabel.test.tsx | 26 +++- .../__tests__/chatFilters.spec.ts | 42 ++++++ .../Conversations/__tests__/running.spec.ts | 78 +++++++++- .../components/Conversations/chatFilters.ts | 16 ++ .../src/components/Conversations/running.ts | 85 +++++++---- .../UnifiedSidebar/ConversationsSection.tsx | 18 ++- .../__tests__/ConversationsSection.spec.tsx | 29 +++- client/src/data-provider/Projects/queries.ts | 29 +++- .../__tests__/projectName.spec.tsx | 80 ++++++++++ client/src/locales/en/translation.json | 7 +- .../mock/scenarios/chat-filter-menu.spec.ts | 11 +- packages/client/src/svgs/Spinner.tsx | 7 +- 19 files changed, 623 insertions(+), 105 deletions(-) create mode 100644 client/src/components/Conversations/__tests__/Convo.status.spec.tsx create mode 100644 client/src/data-provider/__tests__/projectName.spec.tsx diff --git a/client/src/components/Conversations/ChatFilterMenu.tsx b/client/src/components/Conversations/ChatFilterMenu.tsx index 91262abe89..0bffc27255 100644 --- a/client/src/components/Conversations/ChatFilterMenu.tsx +++ b/client/src/components/Conversations/ChatFilterMenu.tsx @@ -1,6 +1,6 @@ import { memo, useCallback, useId, useMemo, useRef, useState } from 'react'; import * as Ariakit from '@ariakit/react'; -import { useAtomValue, useSetAtom } from 'jotai'; +import { useAtom, useAtomValue, useSetAtom } from 'jotai'; import { BookmarkFilledIcon, BookmarkIcon } from '@radix-ui/react-icons'; import { TooltipAnchor, buttonVariants, usePopoverZIndex } from '@librechat/client'; import { alternateName, PermissionTypes, Permissions } from 'librechat-data-provider'; @@ -13,6 +13,7 @@ import { Check, ChevronRight, Clock, + Folder, ListFilter, MessagesSquare, Paperclip, @@ -35,6 +36,7 @@ import { resetChatFiltersAtom, selectableBookmarks, setChatFilterStatusAtom, + showProjectChatsAtom, sortFieldsFor, toggleChatFilterTagAtom, } from './chatFilters'; @@ -785,6 +787,7 @@ const ChatFilterMenu = () => { const facetCount = useAtomValue(facetFilterCountAtom); const setStatus = useSetAtom(setChatFilterStatusAtom); const setSort = useSetAtom(chatSortAtom); + const [showProjectChats, setShowProjectChats] = useAtom(showProjectChatsAtom); const resetFilters = useSetAtom(resetChatFiltersAtom); const resetAllFacets = useSetAtom(resetFacetsAtom); @@ -977,6 +980,19 @@ const ChatFilterMenu = () => { > + + {/* The archive and search already list every chat, project or not. */} + {status === 'active' && ( + <> + + } + checked={showProjectChats} + onSelect={() => setShowProjectChats(!showProjectChats)} + /> + + )} ); diff --git a/client/src/components/Conversations/Conversations.tsx b/client/src/components/Conversations/Conversations.tsx index 6d05b7d467..f910f672d5 100644 --- a/client/src/components/Conversations/Conversations.tsx +++ b/client/src/components/Conversations/Conversations.tsx @@ -32,7 +32,13 @@ import { useEffectiveProjectId, useUnpinDroppedConversation, } from './dnd'; -import { unlistedRunningIds, RUNNING_CHATS_GROUP, groupConversationsWithRunning } from './running'; +import { + isStatusGroup, + unlistedRunningIds, + RUNNING_CHATS_GROUP, + FINISHED_CHATS_GROUP, + groupConversationsByStatus, +} from './running'; import { useLocalize, TranslationKeys, useElementSize, useOuterScrollWindow } from '~/hooks'; import { useActiveJobs, useRunningConversationsQuery } from '~/data-provider'; import { facetFilterCountAtom, resetFacetsAtom } from './facets'; @@ -167,26 +173,42 @@ const ChatsHeader: FC = memo(({ isExpanded, onToggle, trailing ChatsHeader.displayName = 'ChatsHeader'; -const DateLabel: FC<{ groupName: string; isFirst?: boolean; isAlphabetical?: boolean }> = memo( - ({ groupName, isFirst, isAlphabetical = false }) => { +type DateLabelProps = { + groupName: string; + isFirst?: boolean; + isAlphabetical?: boolean; + /** Status groups show how many chats they hold; date groups leave this out. */ + count?: number; +}; + +const statusSectionLabels: Record = { + [RUNNING_CHATS_GROUP]: 'com_a11y_chats_running_section', + [FINISHED_CHATS_GROUP]: 'com_a11y_chats_finished_section', +}; + +const DateLabel: FC = memo( + ({ groupName, isFirst, isAlphabetical = false, count }) => { const localize = useLocalize(); const displayName = localize(groupName as TranslationKeys) || groupName; + const statusLabel = statusSectionLabels[groupName] as TranslationKeys | undefined; + let ariaLabel: string; + if (statusLabel) { + ariaLabel = localize(statusLabel, { count: count ?? 0 }); + } else if (isAlphabetical) { + ariaLabel = localize('com_a11y_chats_alpha_section', { letter: displayName }); + } else { + ariaLabel = localize('com_a11y_chats_date_section', { date: displayName }); + } return (

{displayName} + {count != null && · {count}}

); }, @@ -195,8 +217,8 @@ const DateLabel: FC<{ groupName: string; isFirst?: boolean; isAlphabetical?: boo DateLabel.displayName = 'DateLabel'; type FlattenedItem = - | { type: 'header'; groupName: string } - | { type: 'convo'; convo: TConversation; inRunningGroup: boolean } + | { type: 'header'; groupName: string; count?: number } + | { type: 'convo'; convo: TConversation } | { type: 'loading' }; const Conversations: FC = ({ @@ -341,7 +363,7 @@ const Conversations: FC = ({ /** The archive keeps its server order, while search still promotes active matches. */ const groupedConversations = useMemo( () => - groupConversationsWithRunning( + groupConversationsByStatus( datedConversations, activeJobIds, { @@ -402,9 +424,12 @@ const Conversations: FC = ({ const items: FlattenedItem[] = []; if (isChatsExpanded) { groupedConversations.forEach(([groupName, convos]) => { - const inRunningGroup = groupName === RUNNING_CHATS_GROUP; - items.push({ type: 'header', groupName }); - items.push(...convos.map((convo) => ({ type: 'convo' as const, convo, inRunningGroup }))); + items.push({ + type: 'header', + groupName, + count: isStatusGroup(groupName) ? convos.length : undefined, + }); + items.push(...convos.map((convo) => ({ type: 'convo' as const, convo }))); }); if (isLoading) { @@ -503,6 +528,7 @@ const Conversations: FC = ({ groupName={item.groupName} isFirst={index === 0} isAlphabetical={isAlphabeticalSort(sort.field)} + count={item.count} /> ); @@ -517,7 +543,7 @@ const Conversations: FC = ({ retainView={moveToTop} toggleNav={toggleNav} isGenerating={isGenerating} - showProjectBadge={item.inRunningGroup} + showProjectBadge draggable /> diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsx index 1629f63e52..62a472b2d2 100644 --- a/client/src/components/Conversations/Convo.tsx +++ b/client/src/components/Conversations/Convo.tsx @@ -277,12 +277,6 @@ function Conversation({ isShiftHeld: isActiveConvo ? isShiftHeld : false, }; - const generatingSpinner = ( - - - - ); - /* The slot takes its width from the row's hover, not from its content. The * overflow menu mounts a tick after the pointer arrives (see `ConvoActions`), * and a content-sized slot grew at that moment, pulling the unpin badge a @@ -294,10 +288,7 @@ function Conversation({ let actionWidthClassName = isSmallScreen ? 'group-focus-within:w-9 group-hover:w-9' : 'group-focus-within:w-7 group-hover:w-7'; - if (isGenerating) { - actionVisibilityClassName = 'pointer-events-none w-5 scale-x-100 opacity-100'; - actionWidthClassName = ''; - } else if (isPopoverActive || isActiveConvo || isSmallScreen) { + if (isPopoverActive || isActiveConvo || isSmallScreen) { /** Touch has no hover, so a reveal-on-hover menu is unreachable there. */ actionVisibilityClassName = 'pointer-events-auto scale-x-100 opacity-100'; /** Shift over the active row swaps the menu for archive and delete. */ @@ -308,12 +299,9 @@ function Conversation({ } } - let actionContent: React.ReactNode = null; - if (isGenerating) { - actionContent = generatingSpinner; - } else if (!renaming) { - actionContent = ; - } + const actionContent = renaming ? null : ( + + ); return (
- + {/* Status sits on the avatar so the row's trailing edge stays free for its badges + and menu. The ring is 34px around the 20px icon: offset by half the difference. */} + + + {isGenerating && ( + + )} + {isUnseen && !isGenerating && ( + /* `ConvoLink`'s aria-label carries the text equivalent of the ring and the dot. */ + )} - {isUnseen && ( - /* `ConvoLink`'s aria-label carries the text equivalent, so the dot itself stays - decorative rather than announcing a second time outside the row's button. */ -