From 8439817c76e8ebf2d496acd334b8dba49d798f1e Mon Sep 17 00:00:00 2001 From: starship-s <45587122+starship-s@users.noreply.github.com> Date: Fri, 1 May 2026 00:27:27 -0600 Subject: [PATCH] fix: keep profile placeholder refresh in switch path --- static/panels.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/panels.js b/static/panels.js index 621985e7..284a9e34 100644 --- a/static/panels.js +++ b/static/panels.js @@ -2233,6 +2233,10 @@ async function switchToProfile(name) { const data = await api('/api/profile/switch', { method: 'POST', body: JSON.stringify({ name }) }); S.activeProfile = data.active || name; + // Update composer placeholder and title bar while the core profile-switch + // state is still close to the profile API response. + if (typeof applyBotName === 'function') applyBotName(); + // ── Model + Workspace (parallelized) ─────────────────────────────────── // populateModelDropdown hits /api/models; loadWorkspaceList hits /api/workspaces. // They are fully independent — run both simultaneously to cut switch time ~50%. @@ -2323,9 +2327,6 @@ async function switchToProfile(name) { if (_currentPanel === 'profiles') await loadProfilesPanel(); if (_currentPanel === 'workspaces') await loadWorkspacesPanel(); - // Update composer placeholder and title bar to reflect profile name - if (typeof applyBotName === 'function') applyBotName(); - } catch (e) { // Revert the optimistic name update on error if (_chipLabel) _chipLabel.textContent = _prevProfileName;