From b755b7898b934c03a35e9e4af006c31af82129ed Mon Sep 17 00:00:00 2001 From: Brett Chien Date: Sat, 29 Aug 2026 00:01:14 +0800 Subject: [PATCH] fix(console): clear stale k8s status text on a successful reload (studio#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loadK8sNamespaces() / loadK8sContexts() only ever wrote to identityStatusEl in the catch path — nothing cleared it on success. A failed attempt against one context (e.g. the ambient current-context before the user picks a different one) left its error text on screen even after a later load against a different context succeeded, which read as "still broken" when it wasn't. Live-debugged with Brett: this is part of why the orbstack namespace-listing failure looked confusing at first. Ref #119. --- console/src/deploy.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/console/src/deploy.ts b/console/src/deploy.ts index 261986f..f3f8593 100644 --- a/console/src/deploy.ts +++ b/console/src/deploy.ts @@ -191,6 +191,10 @@ export function initDeployPanel(deps: DeployPanelDeps): DeployPanelHandle | null k8sNamespaceOptions.innerHTML = res.namespaces .map((n) => ``) .join(""); + // studio#119: a prior failed attempt (e.g. before switching context) + // can leave its error text on screen — clear it once a load actually + // succeeds, otherwise a stale error outlives the state it described. + setStatus(identityStatusEl, ""); } catch (e) { // Non-fatal: the namespace field is a free-text input either way (list_ // namespaces failing just means no autocomplete suggestions). @@ -238,6 +242,11 @@ export function initDeployPanel(deps: DeployPanelDeps): DeployPanelHandle | null opts.push(``); } k8sContextSel.innerHTML = opts.join(""); + // studio#119: same staleness fix as loadK8sNamespaces — the + // loadK8sNamespaces() call below will overwrite this with its own + // result once it resolves, but clear here too so a stale error doesn't + // linger for the gap between the two if that call is slow. + setStatus(identityStatusEl, ""); } catch (e) { setStatus(identityStatusEl, `k8s context list unavailable: ${errText(e)}`, "err"); }