diff --git a/frontend/app.js b/frontend/app.js index fb21cf7..4799363 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -492,24 +492,31 @@ async _fetchSuggestions(prefix, vault) { suggestAbortController = new AbortController(); - // Fetch titles and tags independently so one failure doesn't block the other + // Fetch titles try { const titlesRes = await api(`/api/suggest?q=${encodeURIComponent(prefix)}&vault=${encodeURIComponent(vault)}&limit=5`, { signal: suggestAbortController.signal }); this._renderTitles(titlesRes.suggestions || [], prefix); this._titlesSection.hidden = !(titlesRes.suggestions || []).length; if (titlesRes.suggestions?.length) this.show(); } catch (err) { - if (err.name === "AbortError") return; // new request superseded this one + if (err.name === "AbortError") return; this._titlesSection.hidden = true; } + // Fetch tags — keep section always visible to confirm it works try { const tagsRes = await api(`/api/tags/suggest?q=${encodeURIComponent(prefix)}&vault=${encodeURIComponent(vault)}&limit=5`, { signal: suggestAbortController.signal }); - this._renderTags(tagsRes.suggestions || [], prefix); - this._tagsSection.hidden = !(tagsRes.suggestions || []).length; - if (tagsRes.suggestions?.length) this.show(); + const items = tagsRes.suggestions || []; + if (items.length > 0) { + this._renderTags(items, prefix); + } else { + this._tagsList.innerHTML = '