feat(theseus/settings): show current Theseus version by default in General

The Updates card was placeholder-dashed until the user clicked Check
for updates. Show 'You're on v<current>' immediately on load using a
new app-version IPC (app.getVersion, no network) so the user can
answer 'which version am I on?' without a click.
This commit is contained in:
Local Dev 2026-09-08 12:36:21 +02:00
parent f114eaeb2a
commit 1d0e25c4e0
3 changed files with 10 additions and 1 deletions

View file

@ -2950,6 +2950,9 @@ ipcMain.handle("find-stop", () => {
const t = activeTab(); if (!t) return false;
try { t.view.webContents.stopFindInPage("clearSelection"); return true; } catch { return false; }
});
// Just the app version — no network. Used by Settings > General so the
// user can see which Theseus they're on without clicking "Check for updates".
ipcMain.handle("app-version", () => app.getVersion());
ipcMain.handle("recheck-update", async () => {
// Manual "Check for updates" also un-dismisses any chip the user closed
// in this session — they're actively asking to see the status, so honour

View file

@ -39,6 +39,7 @@ contextBridge.exposeInMainWorld("cfg", {
// Manual "Check for updates" — un-dismisses any existing chip and re-
// fetches the release manifest. Returns { updateAvailable, currentVersion }.
recheckUpdate: () => ipcRenderer.invoke("recheck-update"),
appVersion: () => ipcRenderer.invoke("app-version"),
// Add-ons management (Settings > Add-ons tab).
listAddons: () => ipcRenderer.invoke("addons-list"),
setAddonEnabled: (id, enabled) => ipcRenderer.invoke("addons-set-enabled", id, !!enabled),

View file

@ -170,7 +170,7 @@
<div class="t">Updates</div>
<div class="d">Theseus already checks the release manifest at boot and every 6h. Click below to check right now.</div>
</div>
<div id="updStatus" class="pmuted" style="font-size:12.5px"></div>
<div id="updStatus" class="pmuted" style="font-size:12.5px">Loading…</div>
<div style="display:flex;gap:8px;flex-wrap:wrap">
<button id="updCheck" class="btn">Check for updates</button>
</div>
@ -972,6 +972,11 @@
// release manifest. Renders either "you're on the latest (vN.M.O)" or
// "vX.Y.Z is available — the update chip in the toolbar will offer it".
const updStatus = document.getElementById("updStatus");
// Show the current version by default so the user doesn't have to
// click "Check for updates" just to find out which Theseus they're on.
if (C && C.appVersion) C.appVersion().then((v) => {
if (v) updStatus.textContent = `You're on v${v}.`;
}).catch(() => {});
const updCheck = document.getElementById("updCheck");
updCheck.onclick = async () => {
const orig = updCheck.textContent;