From 3e0e34c277edee641128b68093bb83c4937254d9 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Thu, 17 Sep 2026 19:51:40 -0700 Subject: [PATCH] Refresh native build status labels when channel state changes --- easel/desktop/main.cjs | 11 +++++++++-- easel/desktop/renderer.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/easel/desktop/main.cjs b/easel/desktop/main.cjs index 9bc1ec0c45..88c4994964 100644 --- a/easel/desktop/main.cjs +++ b/easel/desktop/main.cjs @@ -141,8 +141,15 @@ function checkBuildUpdates(){ } ipcMain.on('check-build-updates',event=>{if(event.sender===window?.webContents)checkBuildUpdates();}); -function send(channel, data) { if(channel==='build-status'){const item=Menu.getApplicationMenu()?.getMenuItemById('aesel-build-status');if(item)item.label=[data.channel==='dev'?'Dev':data.channel==='release'?'Release':'Local',data.version,(data.tree||data.revision)?.slice(0,8),({current:'Up to date',ready:'Update ready',modified:'Local changes',unknown:'Unable to verify',checking:'Checking…',syncing:'Syncing…',downloading:'Downloading…'})[data.status]||'Unable to verify'].filter(Boolean).join(' · ');} -if (window && !window.isDestroyed()) window.webContents.send(channel, data); } +function send(channel, data) { + if(channel==='build-status'){ + const menu=Menu.getApplicationMenu(),item=menu?.getMenuItemById('aesel-build-status'); + const label=[data.channel==='dev'?'Dev':data.channel==='release'?'Release':'Local',data.version,(data.tree||data.revision)?.slice(0,8),({current:'Up to date',ready:'Update ready',modified:'Local changes',unknown:'Unable to verify',checking:'Checking…',syncing:'Syncing…',downloading:'Downloading…'})[data.status]||'Unable to verify'].filter(Boolean).join(' · '); + if(item&&item.label!==label){item.label=label;Menu.setApplicationMenu(menu);} + } + if(window&&!window.isDestroyed())window.webContents.send(channel,data); +} + function start() { if (terminal) return; const args = [join(root, 'src/tui.mjs'), '--cwd', workspace]; diff --git a/easel/desktop/renderer.js b/easel/desktop/renderer.js index 9e86663c63..ed035a2143 100644 --- a/easel/desktop/renderer.js +++ b/easel/desktop/renderer.js @@ -633,7 +633,7 @@ boot().catch(error => { document.getElementById('terminal').textContent = `Could menu.replaceChildren();const n=balance(); const header=document.createElement('header');const title=document.createElement('h2');title.textContent='Settings'; const dismiss=document.createElement('button');dismiss.type='button';dismiss.textContent='×';dismiss.setAttribute('aria-label','Close settings');dismiss.addEventListener('click',close);header.append(title,dismiss);menu.append(header); - if(buildInfo){const status=document.createElement('p');status.className='build-status';status.dataset.status=buildInfo.status;status.title=buildInfo.revision?`Source commit ${buildInfo.revision}`:'';const channel=buildInfo.channel==='dev'?'Dev':buildInfo.channel==='release'?'Release':'Local';const state={current:'Up to date',ready:'Update ready · saving session',modified:'Local changes · sync paused',checking:'Checking…',syncing:'Downloading dev build…',downloading:'Downloading update…',unknown:'Unable to verify'}[buildInfo.status]||'Unable to verify';status.textContent=[channel,buildInfo.version,(buildInfo.tree||buildInfo.revision)?.slice(0,8),state].filter(Boolean).join(' · ');menu.append(status);item('Check for updates',()=>window.aesel.checkBuildUpdates());} + if(buildInfo){const status=document.createElement('p');status.className='build-status';status.dataset.status=buildInfo.status;status.title=buildInfo.revision?`Source commit ${buildInfo.revision}`:'';const channel=buildInfo.channel==='dev'?'Dev':buildInfo.channel==='release'?'Release':'Local';const state={current:'Up to date',ready:'Update ready',modified:'Local changes · sync paused',checking:'Checking…',syncing:'Downloading dev build…',downloading:'Downloading update…',unknown:'Unable to verify'}[buildInfo.status]||'Unable to verify';status.textContent=[channel,buildInfo.version,(buildInfo.tree||buildInfo.revision)?.slice(0,8),state].filter(Boolean).join(' · ');menu.append(status);item('Check for updates',()=>window.aesel.checkBuildUpdates());} const current=document.createElement('p');current.textContent=[provider?.backend==='ac'?'AC':provider?.backend==='codex'?'Codex':'Claude',provider?.model].filter(Boolean).join(' · ');menu.append(current); for(const [index,id,name] of [[0,'ac','AC'],[1,'claude','Claude'],[2,'codex','Codex']]){ -- 2.51.2