fix(desktop): key-based React remount for workspace switching (#415)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Wes
2026-04-28 18:13:12 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 1ba01965c0
commit 00a4aaba3d
14 changed files with 252 additions and 48 deletions
@@ -460,6 +460,9 @@ function AgentOriginBadge({ agent }: { agent: ManagedAgent }) {
);
}
/** Grace period after mount before treating "running + no presence" as "Starting…" */
const PRESENCE_GRACE_MS = 15_000;
function AgentStatusBadge({
presenceLoaded,
presenceStatus,
@@ -469,8 +472,16 @@ function AgentStatusBadge({
presenceStatus: PresenceStatus | undefined;
status: ManagedAgent["status"];
}) {
const [inGracePeriod, setInGracePeriod] = React.useState(true);
React.useEffect(() => {
const timer = setTimeout(() => setInGracePeriod(false), PRESENCE_GRACE_MS);
return () => clearTimeout(timer);
}, []);
const isActive = status === "running" || status === "deployed";
const isStarting =
!inGracePeriod &&
presenceLoaded &&
status === "running" &&
(!presenceStatus || presenceStatus === "offline");