mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
⬆️ refactor: Improve Text Commands (#3152)
* refactor(useMentions): separate usage of `useSelectMention` * refactor: separate handleKeyUp logic from useTextarea * fix(Mention): cleanup blur timer * refactor(handleKeyUp): improve command handling, prevent unintended re-trigger * chore: remove console log * chore: temporarily comment plus command
This commit is contained in:
parent
b2b469bd3d
commit
24467dd626
7 changed files with 121 additions and 38 deletions
|
|
@ -11,7 +11,6 @@ import useAssistantListMap from '~/hooks/Assistants/useAssistantListMap';
|
|||
import { mapEndpoints, getPresetTitle } from '~/utils';
|
||||
import { EndpointIcon } from '~/components/Endpoints';
|
||||
import { useGetPresetsQuery } from '~/data-provider';
|
||||
import useSelectMention from './useSelectMention';
|
||||
|
||||
const defaultInterface = getConfigDefaults().interface;
|
||||
|
||||
|
|
@ -85,13 +84,6 @@ export default function useMentions({ assistantMap }: { assistantMap: TAssistant
|
|||
[startupConfig],
|
||||
);
|
||||
|
||||
const { onSelectMention } = useSelectMention({
|
||||
modelSpecs,
|
||||
endpointsConfig,
|
||||
presets,
|
||||
assistantMap,
|
||||
});
|
||||
|
||||
const options: MentionOption[] = useMemo(() => {
|
||||
const mentions = [
|
||||
...(modelSpecs?.length > 0 ? modelSpecs : []).map((modelSpec) => ({
|
||||
|
|
@ -156,8 +148,10 @@ export default function useMentions({ assistantMap }: { assistantMap: TAssistant
|
|||
|
||||
return {
|
||||
options,
|
||||
presets,
|
||||
modelSpecs,
|
||||
modelsConfig,
|
||||
onSelectMention,
|
||||
endpointsConfig,
|
||||
assistantListMap,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue