mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-10 19:44:23 +01:00
🚏 chore: Remove Resumable Stream Toggle (#11258)
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
* 🚏 chore: Remove Resumable Stream Toggle - Removed the `useResumableStreamToggle` hook and its associated logic from the ChatView component. - Updated Conversations and useAdaptiveSSE hooks to determine resumable stream status based on the endpoint type. - Cleaned up settings by removing the `resumableStreams` state from the store and its related localization strings. * 🔧 refactor: Simplify Active Jobs Logic in Conversations Component - Removed the endpoint type checks and associated logic for resumable streams in the Conversations component. - Updated the `useActiveJobs` hook call to no longer depend on resumable stream status, streamlining the data fetching process.
This commit is contained in:
parent
24e8a258cd
commit
c30afb8b68
9 changed files with 32 additions and 89 deletions
|
|
@ -7,13 +7,7 @@ import { Constants, buildTree } from 'librechat-data-provider';
|
|||
import type { TMessage } from 'librechat-data-provider';
|
||||
import type { ChatFormValues } from '~/common';
|
||||
import { ChatContext, AddedChatContext, useFileMapContext, ChatFormProvider } from '~/Providers';
|
||||
import {
|
||||
useResumableStreamToggle,
|
||||
useAddedResponse,
|
||||
useResumeOnLoad,
|
||||
useAdaptiveSSE,
|
||||
useChatHelpers,
|
||||
} from '~/hooks';
|
||||
import { useAddedResponse, useResumeOnLoad, useAdaptiveSSE, useChatHelpers } from '~/hooks';
|
||||
import ConversationStarters from './Input/ConversationStarters';
|
||||
import { useGetMessagesByConvoId } from '~/data-provider';
|
||||
import MessagesView from './Messages/MessagesView';
|
||||
|
|
@ -56,11 +50,6 @@ function ChatView({ index = 0 }: { index?: number }) {
|
|||
const chatHelpers = useChatHelpers(index, conversationId);
|
||||
const addedChatHelpers = useAddedResponse();
|
||||
|
||||
useResumableStreamToggle(
|
||||
chatHelpers.conversation?.endpoint,
|
||||
chatHelpers.conversation?.endpointType,
|
||||
);
|
||||
|
||||
useAdaptiveSSE(rootSubmission, chatHelpers, false, index);
|
||||
|
||||
// Auto-resume if navigating back to conversation with active job
|
||||
|
|
|
|||
|
|
@ -160,14 +160,13 @@ const Conversations: FC<ConversationsProps> = ({
|
|||
}) => {
|
||||
const localize = useLocalize();
|
||||
const search = useRecoilValue(store.search);
|
||||
const resumableEnabled = useRecoilValue(store.resumableStreams);
|
||||
const { favorites, isLoading: isFavoritesLoading } = useFavorites();
|
||||
const isSmallScreen = useMediaQuery('(max-width: 768px)');
|
||||
const convoHeight = isSmallScreen ? 44 : 34;
|
||||
const showAgentMarketplace = useShowMarketplace();
|
||||
|
||||
// Fetch active job IDs for showing generation indicators
|
||||
const { data: activeJobsData } = useActiveJobs(resumableEnabled);
|
||||
const { data: activeJobsData } = useActiveJobs();
|
||||
const activeJobIds = useMemo(
|
||||
() => new Set(activeJobsData?.activeJobIds ?? []),
|
||||
[activeJobsData?.activeJobIds],
|
||||
|
|
|
|||
|
|
@ -9,88 +9,81 @@ import store from '~/store';
|
|||
const toggleSwitchConfigs = [
|
||||
{
|
||||
stateAtom: store.enterToSend,
|
||||
localizationKey: 'com_nav_enter_to_send',
|
||||
localizationKey: 'com_nav_enter_to_send' as const,
|
||||
switchId: 'enterToSend',
|
||||
hoverCardText: 'com_nav_info_enter_to_send',
|
||||
hoverCardText: 'com_nav_info_enter_to_send' as const,
|
||||
key: 'enterToSend',
|
||||
},
|
||||
{
|
||||
stateAtom: store.maximizeChatSpace,
|
||||
localizationKey: 'com_nav_maximize_chat_space',
|
||||
localizationKey: 'com_nav_maximize_chat_space' as const,
|
||||
switchId: 'maximizeChatSpace',
|
||||
hoverCardText: undefined,
|
||||
key: 'maximizeChatSpace',
|
||||
},
|
||||
{
|
||||
stateAtom: store.centerFormOnLanding,
|
||||
localizationKey: 'com_nav_center_chat_input',
|
||||
localizationKey: 'com_nav_center_chat_input' as const,
|
||||
switchId: 'centerFormOnLanding',
|
||||
hoverCardText: undefined,
|
||||
key: 'centerFormOnLanding',
|
||||
},
|
||||
{
|
||||
stateAtom: showThinkingAtom,
|
||||
localizationKey: 'com_nav_show_thinking',
|
||||
localizationKey: 'com_nav_show_thinking' as const,
|
||||
switchId: 'showThinking',
|
||||
hoverCardText: undefined,
|
||||
key: 'showThinking',
|
||||
},
|
||||
{
|
||||
stateAtom: store.showCode,
|
||||
localizationKey: 'com_nav_show_code',
|
||||
localizationKey: 'com_nav_show_code' as const,
|
||||
switchId: 'showCode',
|
||||
hoverCardText: undefined,
|
||||
key: 'showCode',
|
||||
},
|
||||
{
|
||||
stateAtom: store.LaTeXParsing,
|
||||
localizationKey: 'com_nav_latex_parsing',
|
||||
localizationKey: 'com_nav_latex_parsing' as const,
|
||||
switchId: 'latexParsing',
|
||||
hoverCardText: 'com_nav_info_latex_parsing',
|
||||
hoverCardText: 'com_nav_info_latex_parsing' as const,
|
||||
key: 'latexParsing',
|
||||
},
|
||||
{
|
||||
stateAtom: store.saveDrafts,
|
||||
localizationKey: 'com_nav_save_drafts',
|
||||
localizationKey: 'com_nav_save_drafts' as const,
|
||||
switchId: 'saveDrafts',
|
||||
hoverCardText: 'com_nav_info_save_draft',
|
||||
hoverCardText: 'com_nav_info_save_draft' as const,
|
||||
key: 'saveDrafts',
|
||||
},
|
||||
{
|
||||
stateAtom: store.showScrollButton,
|
||||
localizationKey: 'com_nav_scroll_button',
|
||||
localizationKey: 'com_nav_scroll_button' as const,
|
||||
switchId: 'showScrollButton',
|
||||
hoverCardText: undefined,
|
||||
key: 'showScrollButton',
|
||||
},
|
||||
{
|
||||
stateAtom: store.saveBadgesState,
|
||||
localizationKey: 'com_nav_save_badges_state',
|
||||
localizationKey: 'com_nav_save_badges_state' as const,
|
||||
switchId: 'showBadges',
|
||||
hoverCardText: 'com_nav_info_save_badges_state',
|
||||
hoverCardText: 'com_nav_info_save_badges_state' as const,
|
||||
key: 'showBadges',
|
||||
},
|
||||
{
|
||||
stateAtom: store.modularChat,
|
||||
localizationKey: 'com_nav_modular_chat',
|
||||
localizationKey: 'com_nav_modular_chat' as const,
|
||||
switchId: 'modularChat',
|
||||
hoverCardText: undefined,
|
||||
key: 'modularChat',
|
||||
},
|
||||
{
|
||||
stateAtom: store.defaultTemporaryChat,
|
||||
localizationKey: 'com_nav_default_temporary_chat',
|
||||
localizationKey: 'com_nav_default_temporary_chat' as const,
|
||||
switchId: 'defaultTemporaryChat',
|
||||
hoverCardText: 'com_nav_info_default_temporary_chat',
|
||||
hoverCardText: 'com_nav_info_default_temporary_chat' as const,
|
||||
key: 'defaultTemporaryChat',
|
||||
},
|
||||
{
|
||||
stateAtom: store.resumableStreams,
|
||||
localizationKey: 'com_nav_resumable_streams',
|
||||
switchId: 'resumableStreams',
|
||||
hoverCardText: 'com_nav_info_resumable_streams',
|
||||
key: 'resumableStreams',
|
||||
},
|
||||
];
|
||||
|
||||
function Chat() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue