add model count feedback to refresh button: shows loading state and final count

This commit is contained in:
Russell Ballestrini 2025-07-11 01:24:01 -04:00
parent cd218cc4a1
commit 595ac0a597

View file

@ -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 () => {