ext: state-driven toolbar icon, restyled popup

This commit is contained in:
Stefano Zini
2026-11-05 17:16:46 +01:00
parent 23c0a18974
commit bc98e0d004
4 changed files with 63 additions and 6 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ let recorderState = { state: "idle" }, lastError = "";
// Refresh the button and status line from state recorderState.
function render() {
const goButton = byId("go"), statusLine = byId("st");
document.body.dataset.state = recorderState.state;
// Pipeline busy after stop: no new start until it finishes.
goButton.disabled = recorderState.state === "transcribing";
// Button doubles as Stop while recording.
@@ -61,7 +62,7 @@ byId("go").onclick = async () => {
// Tell teams.js to start its scanners; ignored if the content script is not on this tab.
chrome.tabs.sendMessage(activeTab.id, { cmd: "cap-start" }).catch(() => {});
// Any failure is shown in the status line.
} catch (error) { lastError = String(error); }
} catch (error) { lastError = String(error); chrome.runtime.sendMessage({ to: "bg", state: "error" }); }
render(); poll();
};