🌿 feat: Fork Messages/Conversations (#2617)
* typedef for ImportBatchBuilder
* feat: first pass, fork conversations
* feat: fork - getMessagesUpToTargetLevel
* fix: additional tests and fix getAllMessagesUpToParent
* chore: arrow function return
* refactor: fork 3 options
* chore: remove unused genbuttons
* chore: remove unused hover buttons code
* feat: fork first pass
* wip: fork remember setting
* style: user icon
* chore: move clear chats to data tab
* WIP: fork UI options
* feat: data-provider fork types/services/vars and use generic MutationOptions
* refactor: use single param for fork option, use enum, fix mongo errors, use Date.now(), add records flag for testing, use endpoint from original convo and messages, pass originalConvo to finishConversation
* feat: add fork mutation hook and consolidate type imports
* refactor: use enum
* feat: first pass, fork mutation
* chore: add enum for target level fork option
* chore: add enum for target level fork option
* show toast when checking remember selection
* feat: splitAtTarget
* feat: split at target option
* feat: navigate to new fork, show toasts, set result query data
* feat: hover info for all fork options
* refactor: add Messages settings tab
* fix(Fork): remember text info
* ci: test for single message and is target edge case
* feat: additional tests for getAllMessagesUpToParent
* ci: additional tests and cycle detection for getMessagesUpToTargetLevel
* feat: circular dependency checks for getAllMessagesUpToParent
* fix: getMessagesUpToTargetLevel circular dep. check
* ci: more tests for getMessagesForConversation
* style: hover text for checkbox fork items
* refactor: add statefulness to conversation import
2024-05-05 11:48:20 -04:00
|
|
|
import { memo } from 'react';
|
2025-10-30 22:14:38 +01:00
|
|
|
import { showThinkingAtom } from '~/store/showThinking';
|
2024-08-07 14:23:33 -04:00
|
|
|
import FontSizeSelector from './FontSizeSelector';
|
🌿 feat: Fork Messages/Conversations (#2617)
* typedef for ImportBatchBuilder
* feat: first pass, fork conversations
* feat: fork - getMessagesUpToTargetLevel
* fix: additional tests and fix getAllMessagesUpToParent
* chore: arrow function return
* refactor: fork 3 options
* chore: remove unused genbuttons
* chore: remove unused hover buttons code
* feat: fork first pass
* wip: fork remember setting
* style: user icon
* chore: move clear chats to data tab
* WIP: fork UI options
* feat: data-provider fork types/services/vars and use generic MutationOptions
* refactor: use single param for fork option, use enum, fix mongo errors, use Date.now(), add records flag for testing, use endpoint from original convo and messages, pass originalConvo to finishConversation
* feat: add fork mutation hook and consolidate type imports
* refactor: use enum
* feat: first pass, fork mutation
* chore: add enum for target level fork option
* chore: add enum for target level fork option
* show toast when checking remember selection
* feat: splitAtTarget
* feat: split at target option
* feat: navigate to new fork, show toasts, set result query data
* feat: hover info for all fork options
* refactor: add Messages settings tab
* fix(Fork): remember text info
* ci: test for single message and is target edge case
* feat: additional tests for getAllMessagesUpToParent
* ci: additional tests and cycle detection for getMessagesUpToTargetLevel
* feat: circular dependency checks for getAllMessagesUpToParent
* fix: getMessagesUpToTargetLevel circular dep. check
* ci: more tests for getMessagesForConversation
* style: hover text for checkbox fork items
* refactor: add statefulness to conversation import
2024-05-05 11:48:20 -04:00
|
|
|
import { ForkSettings } from './ForkSettings';
|
2024-07-17 16:08:13 +02:00
|
|
|
import ChatDirection from './ChatDirection';
|
2025-04-01 09:15:41 +02:00
|
|
|
import ToggleSwitch from '../ToggleSwitch';
|
|
|
|
|
import store from '~/store';
|
|
|
|
|
|
|
|
|
|
const toggleSwitchConfigs = [
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.enterToSend,
|
|
|
|
|
localizationKey: 'com_nav_enter_to_send',
|
|
|
|
|
switchId: 'enterToSend',
|
|
|
|
|
hoverCardText: 'com_nav_info_enter_to_send',
|
|
|
|
|
key: 'enterToSend',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.maximizeChatSpace,
|
|
|
|
|
localizationKey: 'com_nav_maximize_chat_space',
|
|
|
|
|
switchId: 'maximizeChatSpace',
|
|
|
|
|
hoverCardText: undefined,
|
|
|
|
|
key: 'maximizeChatSpace',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.centerFormOnLanding,
|
|
|
|
|
localizationKey: 'com_nav_center_chat_input',
|
|
|
|
|
switchId: 'centerFormOnLanding',
|
|
|
|
|
hoverCardText: undefined,
|
|
|
|
|
key: 'centerFormOnLanding',
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-10-30 22:14:38 +01:00
|
|
|
stateAtom: showThinkingAtom,
|
2025-04-01 09:15:41 +02:00
|
|
|
localizationKey: 'com_nav_show_thinking',
|
|
|
|
|
switchId: 'showThinking',
|
|
|
|
|
hoverCardText: undefined,
|
|
|
|
|
key: 'showThinking',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.showCode,
|
|
|
|
|
localizationKey: 'com_nav_show_code',
|
|
|
|
|
switchId: 'showCode',
|
|
|
|
|
hoverCardText: undefined,
|
|
|
|
|
key: 'showCode',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.LaTeXParsing,
|
|
|
|
|
localizationKey: 'com_nav_latex_parsing',
|
|
|
|
|
switchId: 'latexParsing',
|
|
|
|
|
hoverCardText: 'com_nav_info_latex_parsing',
|
|
|
|
|
key: 'latexParsing',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.saveDrafts,
|
|
|
|
|
localizationKey: 'com_nav_save_drafts',
|
|
|
|
|
switchId: 'saveDrafts',
|
|
|
|
|
hoverCardText: 'com_nav_info_save_draft',
|
|
|
|
|
key: 'saveDrafts',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.showScrollButton,
|
|
|
|
|
localizationKey: 'com_nav_scroll_button',
|
|
|
|
|
switchId: 'showScrollButton',
|
|
|
|
|
hoverCardText: undefined,
|
|
|
|
|
key: 'showScrollButton',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.saveBadgesState,
|
|
|
|
|
localizationKey: 'com_nav_save_badges_state',
|
|
|
|
|
switchId: 'showBadges',
|
|
|
|
|
hoverCardText: 'com_nav_info_save_badges_state',
|
|
|
|
|
key: 'showBadges',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
stateAtom: store.modularChat,
|
|
|
|
|
localizationKey: 'com_nav_modular_chat',
|
|
|
|
|
switchId: 'modularChat',
|
|
|
|
|
hoverCardText: undefined,
|
|
|
|
|
key: 'modularChat',
|
|
|
|
|
},
|
|
|
|
|
];
|
🌿 feat: Fork Messages/Conversations (#2617)
* typedef for ImportBatchBuilder
* feat: first pass, fork conversations
* feat: fork - getMessagesUpToTargetLevel
* fix: additional tests and fix getAllMessagesUpToParent
* chore: arrow function return
* refactor: fork 3 options
* chore: remove unused genbuttons
* chore: remove unused hover buttons code
* feat: fork first pass
* wip: fork remember setting
* style: user icon
* chore: move clear chats to data tab
* WIP: fork UI options
* feat: data-provider fork types/services/vars and use generic MutationOptions
* refactor: use single param for fork option, use enum, fix mongo errors, use Date.now(), add records flag for testing, use endpoint from original convo and messages, pass originalConvo to finishConversation
* feat: add fork mutation hook and consolidate type imports
* refactor: use enum
* feat: first pass, fork mutation
* chore: add enum for target level fork option
* chore: add enum for target level fork option
* show toast when checking remember selection
* feat: splitAtTarget
* feat: split at target option
* feat: navigate to new fork, show toasts, set result query data
* feat: hover info for all fork options
* refactor: add Messages settings tab
* fix(Fork): remember text info
* ci: test for single message and is target edge case
* feat: additional tests for getAllMessagesUpToParent
* ci: additional tests and cycle detection for getMessagesUpToTargetLevel
* feat: circular dependency checks for getAllMessagesUpToParent
* fix: getMessagesUpToTargetLevel circular dep. check
* ci: more tests for getMessagesForConversation
* style: hover text for checkbox fork items
* refactor: add statefulness to conversation import
2024-05-05 11:48:20 -04:00
|
|
|
|
2024-07-17 16:08:13 +02:00
|
|
|
function Chat() {
|
🌿 feat: Fork Messages/Conversations (#2617)
* typedef for ImportBatchBuilder
* feat: first pass, fork conversations
* feat: fork - getMessagesUpToTargetLevel
* fix: additional tests and fix getAllMessagesUpToParent
* chore: arrow function return
* refactor: fork 3 options
* chore: remove unused genbuttons
* chore: remove unused hover buttons code
* feat: fork first pass
* wip: fork remember setting
* style: user icon
* chore: move clear chats to data tab
* WIP: fork UI options
* feat: data-provider fork types/services/vars and use generic MutationOptions
* refactor: use single param for fork option, use enum, fix mongo errors, use Date.now(), add records flag for testing, use endpoint from original convo and messages, pass originalConvo to finishConversation
* feat: add fork mutation hook and consolidate type imports
* refactor: use enum
* feat: first pass, fork mutation
* chore: add enum for target level fork option
* chore: add enum for target level fork option
* show toast when checking remember selection
* feat: splitAtTarget
* feat: split at target option
* feat: navigate to new fork, show toasts, set result query data
* feat: hover info for all fork options
* refactor: add Messages settings tab
* fix(Fork): remember text info
* ci: test for single message and is target edge case
* feat: additional tests for getAllMessagesUpToParent
* ci: additional tests and cycle detection for getMessagesUpToTargetLevel
* feat: circular dependency checks for getAllMessagesUpToParent
* fix: getMessagesUpToTargetLevel circular dep. check
* ci: more tests for getMessagesForConversation
* style: hover text for checkbox fork items
* refactor: add statefulness to conversation import
2024-05-05 11:48:20 -04:00
|
|
|
return (
|
2024-09-10 10:11:39 -09:00
|
|
|
<div className="flex flex-col gap-3 p-1 text-sm text-text-primary">
|
2024-10-20 17:29:47 +02:00
|
|
|
<div className="pb-3">
|
2024-09-10 10:11:39 -09:00
|
|
|
<FontSizeSelector />
|
🌿 feat: Fork Messages/Conversations (#2617)
* typedef for ImportBatchBuilder
* feat: first pass, fork conversations
* feat: fork - getMessagesUpToTargetLevel
* fix: additional tests and fix getAllMessagesUpToParent
* chore: arrow function return
* refactor: fork 3 options
* chore: remove unused genbuttons
* chore: remove unused hover buttons code
* feat: fork first pass
* wip: fork remember setting
* style: user icon
* chore: move clear chats to data tab
* WIP: fork UI options
* feat: data-provider fork types/services/vars and use generic MutationOptions
* refactor: use single param for fork option, use enum, fix mongo errors, use Date.now(), add records flag for testing, use endpoint from original convo and messages, pass originalConvo to finishConversation
* feat: add fork mutation hook and consolidate type imports
* refactor: use enum
* feat: first pass, fork mutation
* chore: add enum for target level fork option
* chore: add enum for target level fork option
* show toast when checking remember selection
* feat: splitAtTarget
* feat: split at target option
* feat: navigate to new fork, show toasts, set result query data
* feat: hover info for all fork options
* refactor: add Messages settings tab
* fix(Fork): remember text info
* ci: test for single message and is target edge case
* feat: additional tests for getAllMessagesUpToParent
* ci: additional tests and cycle detection for getMessagesUpToTargetLevel
* feat: circular dependency checks for getAllMessagesUpToParent
* fix: getMessagesUpToTargetLevel circular dep. check
* ci: more tests for getMessagesForConversation
* style: hover text for checkbox fork items
* refactor: add statefulness to conversation import
2024-05-05 11:48:20 -04:00
|
|
|
</div>
|
2024-10-20 17:29:47 +02:00
|
|
|
<div className="pb-3">
|
2024-09-10 10:11:39 -09:00
|
|
|
<ChatDirection />
|
|
|
|
|
</div>
|
2025-04-01 09:15:41 +02:00
|
|
|
{toggleSwitchConfigs.map((config) => (
|
|
|
|
|
<div key={config.key} className="pb-3">
|
|
|
|
|
<ToggleSwitch
|
|
|
|
|
stateAtom={config.stateAtom}
|
|
|
|
|
localizationKey={config.localizationKey}
|
|
|
|
|
hoverCardText={config.hoverCardText}
|
|
|
|
|
switchId={config.switchId}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
2024-09-10 10:11:39 -09:00
|
|
|
<ForkSettings />
|
|
|
|
|
</div>
|
🌿 feat: Fork Messages/Conversations (#2617)
* typedef for ImportBatchBuilder
* feat: first pass, fork conversations
* feat: fork - getMessagesUpToTargetLevel
* fix: additional tests and fix getAllMessagesUpToParent
* chore: arrow function return
* refactor: fork 3 options
* chore: remove unused genbuttons
* chore: remove unused hover buttons code
* feat: fork first pass
* wip: fork remember setting
* style: user icon
* chore: move clear chats to data tab
* WIP: fork UI options
* feat: data-provider fork types/services/vars and use generic MutationOptions
* refactor: use single param for fork option, use enum, fix mongo errors, use Date.now(), add records flag for testing, use endpoint from original convo and messages, pass originalConvo to finishConversation
* feat: add fork mutation hook and consolidate type imports
* refactor: use enum
* feat: first pass, fork mutation
* chore: add enum for target level fork option
* chore: add enum for target level fork option
* show toast when checking remember selection
* feat: splitAtTarget
* feat: split at target option
* feat: navigate to new fork, show toasts, set result query data
* feat: hover info for all fork options
* refactor: add Messages settings tab
* fix(Fork): remember text info
* ci: test for single message and is target edge case
* feat: additional tests for getAllMessagesUpToParent
* ci: additional tests and cycle detection for getMessagesUpToTargetLevel
* feat: circular dependency checks for getAllMessagesUpToParent
* fix: getMessagesUpToTargetLevel circular dep. check
* ci: more tests for getMessagesForConversation
* style: hover text for checkbox fork items
* refactor: add statefulness to conversation import
2024-05-05 11:48:20 -04:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-17 16:08:13 +02:00
|
|
|
export default memo(Chat);
|