fix(autocomplete): hide embedding preview tooltip after selection

Remove searchType check from prompt behavior's hidePreview method.
When an embedding was selected, the input event dispatched by
insertSelection caused searchType to change before hide() was called,
preventing the preview tooltip from being hidden.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Will Miao
2026-01-26 14:13:16 +08:00
parent 42f35be9d3
commit 6ef6c116e4

View File

@@ -210,7 +210,7 @@ const MODEL_BEHAVIORS = {
instance.showPreviewForItem(relativePath, itemElement);
},
hidePreview(instance) {
if (!instance.previewTooltip || instance.searchType !== 'embeddings') {
if (!instance.previewTooltip) {
return;
}
instance.previewTooltip.hide();