diff --git a/tests/frontend/components/autocomplete.behavior.test.js b/tests/frontend/components/autocomplete.behavior.test.js index bd909bd2..d799c11a 100644 --- a/tests/frontend/components/autocomplete.behavior.test.js +++ b/tests/frontend/components/autocomplete.behavior.test.js @@ -1667,7 +1667,7 @@ describe('AutoComplete widget interactions', () => { expect(input.value).toBe('looking_to_the_side,'); }); - it('shows /af command for loras when active-filters autocomplete is off (default)', async () => { + it('shows /activefilters command for loras when active-filters autocomplete is off (default)', async () => { const input = document.createElement('textarea'); input.value = '/'; input.selectionStart = input.value.length; @@ -1682,8 +1682,6 @@ describe('AutoComplete widget interactions', () => { input.dispatchEvent(new Event('input', { bubbles: true })); const commandNames = autoComplete.items.map((item) => item.command); - expect(commandNames).toContain('/af'); - expect(commandNames).not.toContain('/noaf'); expect(commandNames).toContain('/activefilters'); expect(commandNames).not.toContain('/noactivefilters'); }); @@ -1710,11 +1708,11 @@ describe('AutoComplete widget interactions', () => { await Promise.resolve(); const commandNames = autoComplete.items.map((item) => item.command); - expect(commandNames).toContain('/af'); + expect(commandNames).toContain('/activefilters'); expect(previewTooltipMock.show).not.toHaveBeenCalled(); }); - it('shows /noaf command for loras when active-filters autocomplete is on', async () => { + it('shows /noactivefilters command for loras when active-filters autocomplete is on', async () => { settingGetMock.mockImplementation((key) => { if (key === 'loramanager.lora_active_filters_autocomplete') { return true; @@ -1736,8 +1734,6 @@ describe('AutoComplete widget interactions', () => { input.dispatchEvent(new Event('input', { bubbles: true })); const commandNames = autoComplete.items.map((item) => item.command); - expect(commandNames).toContain('/noaf'); - expect(commandNames).not.toContain('/af'); expect(commandNames).toContain('/noactivefilters'); expect(commandNames).not.toContain('/activefilters'); }); @@ -1766,7 +1762,7 @@ describe('AutoComplete widget interactions', () => { expect(settingSetMock).toHaveBeenCalledWith('loramanager.lora_active_filters_autocomplete', true); }); - it('toggles the active-filters setting when /af is accepted', async () => { + it('toggles the active-filters setting when /activefilters is accepted', async () => { const input = document.createElement('textarea'); input.value = '/'; input.selectionStart = input.value.length; @@ -1782,7 +1778,7 @@ describe('AutoComplete widget interactions', () => { input.dispatchEvent(new Event('input', { bubbles: true })); - const afItem = autoComplete.items.find((item) => item.command === '/af'); + const afItem = autoComplete.items.find((item) => item.command === '/activefilters'); expect(afItem).toBeDefined(); // Simulate the input being cleared after the command is accepted so the diff --git a/web/comfyui/autocomplete.js b/web/comfyui/autocomplete.js index 8ae0e862..232df02e 100644 --- a/web/comfyui/autocomplete.js +++ b/web/comfyui/autocomplete.js @@ -33,14 +33,14 @@ const TAG_COMMANDS = { '/embedding': { type: 'embedding', label: 'Embeddings' }, ...WILDCARD_COMMANDS, // Autocomplete toggle commands - only show one based on current state - '/ac': { + '/autocomplete': { type: 'toggle_setting', settingId: 'loramanager.prompt_tag_autocomplete', value: true, label: 'Autocomplete: ON', condition: () => !getPromptTagAutocompletePreference() }, - '/noac': { + '/noautocomplete': { type: 'toggle_setting', settingId: 'loramanager.prompt_tag_autocomplete', value: false, @@ -50,26 +50,7 @@ const TAG_COMMANDS = { }; // Command definitions for LoRA active-filters search -// Aliases (/activefilters, /noactivefilters) mirror /emb ↔ /embedding const LORAS_COMMANDS = { - '/af': { - type: 'toggle_setting', - settingId: 'loramanager.lora_active_filters_autocomplete', - value: true, - label: 'Active Filters: ON', - feedbackSummary: 'Active Filters Search: ON', - feedbackDetail: 'LoRA autocomplete now searches within the active filters of the LoRA Manager page.', - condition: () => !getLoraActiveFiltersAutocompletePreference() - }, - '/noaf': { - type: 'toggle_setting', - settingId: 'loramanager.lora_active_filters_autocomplete', - value: false, - label: 'Active Filters: OFF', - feedbackSummary: 'Active Filters Search: OFF', - feedbackDetail: 'LoRA autocomplete searches the full library again.', - condition: () => getLoraActiveFiltersAutocompletePreference() - }, '/activefilters': { type: 'toggle_setting', settingId: 'loramanager.lora_active_filters_autocomplete', @@ -761,7 +742,7 @@ class AutoComplete { searchTerm = (match[1] || '').trim(); } - // For loras model type, check if we're in command mode (/af, /noaf) + // For loras model type, check if we're in command mode (/activefilters, /noactivefilters) if (this.modelType === 'loras') { const commandResult = this._parseCommandInput(rawSearchTerm); @@ -773,7 +754,7 @@ class AutoComplete { this._showCommandList(commandResult.commandFilter); return; } else if (commandResult.command?.type === 'toggle_setting') { - // Handle toggle setting command (/af, /noaf) + // Handle toggle setting command (/activefilters, /noactivefilters) this._handleToggleSettingCommand(commandResult.command); return; } else if (commandResult.command) { @@ -813,7 +794,7 @@ class AutoComplete { this._showCommandList(commandResult.commandFilter); return; } else if (commandResult.command?.type === 'toggle_setting') { - // Handle toggle setting command (/ac, /noac) + // Handle toggle setting command (/autocomplete, /noautocomplete) this._handleToggleSettingCommand(commandResult.command); return; } else if (commandResult.command) { @@ -2866,7 +2847,7 @@ class AutoComplete { } /** - * Handle toggle setting command (/ac, /noac) + * Handle toggle setting command (e.g., /autocomplete, /activefilters) * @param {Object} command - The toggle command with settingId and value */ async _handleToggleSettingCommand(command) {