diff --git a/core/commands/index.ts b/core/commands/index.ts index 486eaccf2..ba5c3403c 100644 --- a/core/commands/index.ts +++ b/core/commands/index.ts @@ -19,7 +19,7 @@ export function slashFromCustomCommand( .slice(customCommand.name.length + 1, userInput.length) .trimStart(); } - + debugger; // Render prompt template let promptUserInput: string; if (customCommand.prompt.includes("{{{ input }}}")) { diff --git a/gui/src/components/mainInput/tiptap/editorConfig.ts b/gui/src/components/mainInput/tiptap/editorConfig.ts index d79981d39..985cadc64 100644 --- a/gui/src/components/mainInput/tiptap/editorConfig.ts +++ b/gui/src/components/mainInput/tiptap/editorConfig.ts @@ -30,7 +30,6 @@ import { getFontSize } from "../../../util"; import { AddCodeToEdit } from "./extensions/AddCodeToEditExtension"; import { CodeBlockExtension } from "./extensions/CodeBlockExtension"; import { SlashCommand } from "./extensions/CommandsExtension"; -import { MockExtension } from "./extensions/FillerExtension"; import { Mention } from "./extensions/MentionExtension"; import { getContextProviderDropdownOptions, @@ -352,22 +351,20 @@ export function createEditorConfig(options: { }, }, }), - props.availableSlashCommands.length - ? SlashCommand.configure({ - HTMLAttributes: { - class: "mention", - }, - suggestion: getSlashCommandDropdownOptions( - availableSlashCommandsRef, - onClose, - onOpen, - ideMessenger, - ), - renderText: (props) => { - return props.node.attrs.label; - }, - }) - : MockExtension, + SlashCommand.configure({ + HTMLAttributes: { + class: "mention", + }, + suggestion: getSlashCommandDropdownOptions( + availableSlashCommandsRef, + onClose, + onOpen, + ideMessenger, + ), + renderText: (props) => { + return props.node.attrs.label; + }, + }), CodeBlockExtension, ], editorProps: { diff --git a/gui/src/components/mainInput/tiptap/extensions/FillerExtension.tsx b/gui/src/components/mainInput/tiptap/extensions/FillerExtension.tsx deleted file mode 100644 index 9b8baac86..000000000 --- a/gui/src/components/mainInput/tiptap/extensions/FillerExtension.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { Node } from "@tiptap/core"; - -export const MockExtension = Node.create({ - name: "mockExtension", - - addOptions() { - return { - enabled: false, - }; - }, - addCommands() { - return {}; - }, - addKeyboardShortcuts() { - return {}; - }, - addProseMirrorPlugins() { - return []; - }, -}); diff --git a/gui/src/components/mainInput/tiptap/getSuggestion.ts b/gui/src/components/mainInput/tiptap/getSuggestion.ts index 264258dd5..f9faad863 100644 --- a/gui/src/components/mainInput/tiptap/getSuggestion.ts +++ b/gui/src/components/mainInput/tiptap/getSuggestion.ts @@ -203,7 +203,7 @@ export function getSlashCommandDropdownOptions( const filteredCommands = query.length > 0 ? options.filter((slashCommand) => { - const sc = slashCommand.title.substring(1).toLowerCase(); + const sc = slashCommand.title.toLowerCase(); const iv = query.toLowerCase(); return sc.startsWith(iv); }) @@ -219,7 +219,7 @@ export function getSlashCommandDropdownOptions( action: provider.action, })); - if (query.length === 0 && commandItems.length > 0) { + if (query.length === 0 && commandItems.length === 0) { commandItems.push({ title: "Explore prompts", type: "action", diff --git a/gui/src/redux/selectors/index.ts b/gui/src/redux/selectors/index.ts index 3d46bf9ea..bb7850dd5 100644 --- a/gui/src/redux/selectors/index.ts +++ b/gui/src/redux/selectors/index.ts @@ -8,7 +8,7 @@ export const selectSlashCommandComboBoxInputs = createSelector( return ( slashCommands?.map((cmd) => { return { - title: `${cmd.name}`, + title: cmd.name, description: cmd.description, type: "slashCommand" as ComboBoxItemType, };