From 595ac0a59746830a4da80ea3d21cb6b042eeff54 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Fri, 11 Jul 2025 01:24:01 -0400 Subject: [PATCH] add model count feedback to refresh button: shows loading state and final count --- src/uncloseai-embed-modal.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/uncloseai-embed-modal.js b/src/uncloseai-embed-modal.js index 9e48c4f..af79f4f 100644 --- a/src/uncloseai-embed-modal.js +++ b/src/uncloseai-embed-modal.js @@ -502,7 +502,32 @@ async function openUncloseaiEmbeddedModalNew() { actionsGrid.className = "uncloseai-grid-actions"; const actions = [ - { text: getUIText("refreshModels"), action: loadModels }, + { + text: getUIText("refreshModels"), + action: async () => { + const button = event.target; + const originalText = button.textContent; + button.textContent = "🔄 Loading..."; + button.disabled = true; + + try { + await loadModels(); + // Show model count briefly + const modelCount = modelSelect.options.length; + button.textContent = `✅ ${modelCount} models`; + setTimeout(() => { + button.textContent = originalText; + button.disabled = false; + }, 2000); + } catch (error) { + button.textContent = "❌ Failed"; + setTimeout(() => { + button.textContent = originalText; + button.disabled = false; + }, 2000); + } + } + }, { text: getUIText("clearChat"), action: async () => {