diff --git a/chrome-extension/src/description_generation.js b/chrome-extension/src/description_generation.js index d0f2177..8929116 100644 --- a/chrome-extension/src/description_generation.js +++ b/chrome-extension/src/description_generation.js @@ -3,6 +3,9 @@ import { description_schema } from "./schema" async function generateDescription(title, url, content) { try { + // Show loading indicator + document.getElementById("descLoading").style.display = "flex"; + // Get Ollama settings const { ollamaEndpoint, @@ -45,10 +48,16 @@ Document: {{content}}`; format: description_schema, }); + // Hide loading indicator + document.getElementById("descLoading").style.display = "none"; + let desc = JSON.parse(response.response).description; return desc; } catch (error) { + // Hide loading indicator + document.getElementById("descLoading").style.display = "none"; + console.error("Error generating description with Ollama:", error); updateStatus(`Error generating description: ${error.message}`); return []; diff --git a/chrome-extension/src/popup.html b/chrome-extension/src/popup.html index 463008a..b15ca35 100644 --- a/chrome-extension/src/popup.html +++ b/chrome-extension/src/popup.html @@ -110,6 +110,10 @@ style="padding: 2px 8px; font-size: 12px" >Generate Description +
+
+ Generating description... +