From 6a7856065a7801db7871888a2f723e85f05ed119 Mon Sep 17 00:00:00 2001 From: NAME Date: Sat, 16 May 2026 11:58:13 +0000 Subject: [PATCH] Update --- chrom-ext/background.js | 3 ++- chrom-ext/content.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/chrom-ext/background.js b/chrom-ext/background.js index 937dada..9657a94 100644 --- a/chrom-ext/background.js +++ b/chrom-ext/background.js @@ -55,7 +55,8 @@ async function handleGenerate({ text, lang, tone, angle }, tabId) { const data = await res.json(); if (!res.ok) throw new Error(`HTTP ${res.status}`); const comment = data.comment || data.text || JSON.stringify(data); - await chrome.tabs.sendMessage(tabId, { action: 'SHOW_RESULT', comment }).catch(() => {}); + const model = data.model || ''; + await chrome.tabs.sendMessage(tabId, { action: 'SHOW_RESULT', comment , model}).catch(() => {}); } catch (err) { await chrome.tabs.sendMessage(tabId, { action: 'SHOW_ERROR', error: err.message }).catch(() => {}); } diff --git a/chrom-ext/content.js b/chrom-ext/content.js index f46b891..d63c9b4 100644 --- a/chrom-ext/content.js +++ b/chrom-ext/content.js @@ -86,7 +86,7 @@ return false; } if (req.action === 'SHOW_RESULT') { - showResult(req.comment); + showResult(req.comment, req.model); sendResponse({ ok: true }); return false; } @@ -451,7 +451,7 @@ } // ===== SHOW RESULT / ERROR ===== - function showResult(comment) { + function showResult(comment, model= '') { if (!sidebarHost) return; const s = sidebarHost.shadowRoot; const statusEl = s.querySelector('#ai-status'); @@ -460,7 +460,14 @@ const drawer = s.querySelector('.drawer'); const typingOpts = s.querySelector('#ai-typing-opts'); - if (statusEl) { statusEl.style.display = 'block'; statusEl.className = 'status ok'; statusEl.textContent = comment; } + console.log({model}); + if (statusEl) { + statusEl.style.display = 'block'; + statusEl.className = 'status ok'; + statusEl.textContent = comment; + + copyHint.textContent = model; + } if (copyHint) copyHint.style.display = 'block'; if (runBtn) runBtn.disabled = false; if (drawer) drawer.classList.add('open');