fix: preserve duplicate slash commands in autocomplete

Show commands with identical names from different sources
Add stable command IDs so selection no longer depends on name dedupe
Keep command insertion flow working across chat and prompt editors
This commit is contained in:
Bohdan Triapitsyn
2026-04-22 22:08:34 +03:00
parent 863be8073b
commit 6886713b8e
5 changed files with 28 additions and 31 deletions
@@ -13,7 +13,7 @@ import { RiAddLine, RiCloseLine, RiCalendarLine, RiArrowLeftSLine, RiArrowRightS
import { ModelSelector } from '@/components/sections/agents/ModelSelector';
import { AgentSelector } from '@/components/sections/commands/AgentSelector';
import { isPrimaryMode } from '@/components/chat/mobileControlsUtils';
import { CommandAutocomplete, type CommandAutocompleteHandle } from '@/components/chat/CommandAutocomplete';
import { CommandAutocomplete, type CommandAutocompleteHandle, type CommandInfo } from '@/components/chat/CommandAutocomplete';
import { FileMentionAutocomplete, type FileMentionHandle } from '@/components/chat/FileMentionAutocomplete';
import { useConfigStore } from '@/stores/useConfigStore';
import { useUIStore } from '@/stores/useUIStore';
@@ -907,7 +907,7 @@ export function ScheduledTaskEditorDialog(props: {
});
}, [draft.execution.prompt, setPromptValue, updateAutocompleteState]);
const handleCommandSelect = React.useCallback((command: { name: string }) => {
const handleCommandSelect = React.useCallback((command: CommandInfo) => {
const nextPrompt = `/${command.name} `;
setPromptValue(nextPrompt);
setShowCommandAutocomplete(false);