mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
🗝️ fix: React Key Props and Minor UI Fixes from a11y Updates (#10954)
* refactor: Update Frontend logger function to enhance logging conditions
- Modified the logger function to check for logger enablement and development environment more robustly.
- Adjusted the condition to ensure logging occurs only when the logger is enabled or when the environment variable for logger is not set in development mode.
* fix: Add key prop to MeasuredRow components in Conversations for improved rendering
- Updated MeasuredRow components to include a key prop for better performance and to prevent rendering issues during list updates.
- Ensured consistent handling of item types within the Conversations component.
* refactor: Enhance ScrollToBottom component with forwardRef for improved functionality
- Updated ScrollToBottom component to use forwardRef, allowing it to accept a ref for better integration with parent components.
- Modified MessagesView to utilize the new ref for the ScrollToBottom button, improving scrolling behavior and performance.
* refactor: Enhance EndpointItem and renderEndpoints for improved model render keys
- Updated EndpointItem to accept an endpointIndex prop for better indexing of endpoints.
- Modified renderEndpoints to pass the endpointIndex to EndpointItem, improving the rendering of endpoint models.
- Adjusted renderEndpointModels to utilize the endpointIndex for unique key generation, enhancing performance and preventing rendering issues.
* refactor: Update BaseClient to handle non-ephemeral agents in conversation logic
- Added a check for non-ephemeral agents in BaseClient, modifying the exceptions set to include 'model' when applicable.
- Enhanced conversation handling to improve flexibility based on agent type.
* refactor: Optimize FavoritesList component for agent handling and loading states
- Updated FavoritesList to improve agent ID management by introducing combinedAgentsMap for better handling of missing agents.
- Refactored loading state logic to ensure accurate representation of agent loading status.
- Enhanced the use of useQueries for fetching missing agent data, streamlining the overall data retrieval process.
- Improved memoization of agent IDs and loading conditions for better performance and reliability.
* Revert "refactor: Update BaseClient to handle non-ephemeral agents in conversation logic"
This reverts commit 6738acbe04.
This commit is contained in:
parent
4d7e6b4a58
commit
06719794f6
7 changed files with 84 additions and 62 deletions
|
|
@ -250,7 +250,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'loading') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<LoadingSpinner />
|
||||
</MeasuredRow>
|
||||
);
|
||||
|
|
@ -258,7 +258,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'favorites') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<FavoritesList
|
||||
isSmallScreen={isSmallScreen}
|
||||
toggleNav={toggleNav}
|
||||
|
|
@ -270,7 +270,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'chats-header') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<ChatsHeader
|
||||
isExpanded={isChatsExpanded}
|
||||
onToggle={() => setIsChatsExpanded(!isChatsExpanded)}
|
||||
|
|
@ -285,7 +285,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
// Without favorites: [chats-header, first-header] → index 1
|
||||
const firstHeaderIndex = shouldShowFavorites ? 2 : 1;
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<DateLabel groupName={item.groupName} isFirst={index === firstHeaderIndex} />
|
||||
</MeasuredRow>
|
||||
);
|
||||
|
|
@ -293,7 +293,7 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
|
||||
if (item.type === 'convo') {
|
||||
return (
|
||||
<MeasuredRow {...rowProps}>
|
||||
<MeasuredRow key={key} {...rowProps}>
|
||||
<MemoizedConvo conversation={item.convo} retainView={moveToTop} toggleNav={toggleNav} />
|
||||
</MeasuredRow>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue