dead code

This commit is contained in:
Nate 2025-07-19 21:17:53 -07:00
parent ddd3201720
commit 67bf34b334
2 changed files with 6 additions and 6 deletions

View file

@ -10,14 +10,12 @@ interface SlashCommandUIProps {
assistant: AssistantConfig;
filter: string;
selectedIndex: number;
onSelect: (command: string) => void;
}
const SlashCommandUI: React.FC<SlashCommandUIProps> = ({
assistant,
filter,
selectedIndex,
onSelect,
}) => {
const [allCommands, setAllCommands] = useState<SlashCommand[]>([]);

View file

@ -91,12 +91,15 @@ const UserInput: React.FC<UserInputProps> = ({
// Only show slash commands if slash is the very first character
if (text.trimStart().startsWith("/")) {
const trimmedText = text.trimStart();
const beforeCursor = trimmedText.slice(0, cursor - (text.length - trimmedText.length));
const beforeCursor = trimmedText.slice(
0,
cursor - (text.length - trimmedText.length)
);
// Only show if cursor is after the slash and before any whitespace
if (beforeCursor.length > 0 && beforeCursor.startsWith("/")) {
const afterSlash = beforeCursor.slice(1);
if (!afterSlash.includes(" ") && !afterSlash.includes("\n")) {
// We're in a slash command context
setShowSlashCommands(true);
@ -488,7 +491,6 @@ const UserInput: React.FC<UserInputProps> = ({
assistant={assistant}
filter={slashCommandFilter}
selectedIndex={selectedCommandIndex}
onSelect={selectSlashCommand}
/>
)}