From 0358128b24d8eb9e460f200460966bf82165a71b Mon Sep 17 00:00:00 2001 From: megaproxy Date: Thu, 28 May 2026 23:06:30 +0100 Subject: [PATCH] Context bar: only show for actively-written sessions (gate on recent mtime) A bash pane sitting in a directory that once had a claude session was lighting up with that session's stale context. Gate the indicator on the matched session having been written within the last 10 min, so it tracks a live claude rather than any dormant transcript in the same dir. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/lib/layout/LeafPane.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/layout/LeafPane.tsx b/src/lib/layout/LeafPane.tsx index 7b7a764..2e0a3ce 100644 --- a/src/lib/layout/LeafPane.tsx +++ b/src/lib/layout/LeafPane.tsx @@ -22,6 +22,12 @@ import "./LeafPane.css"; const IDLE_THRESHOLD_MS = 5000; +/** Only show the context indicator when the matched claude session has been + * written recently — i.e. claude is actually live in (or just used in) this + * pane's directory. Without this, a plain bash pane sitting in a directory + * that once had a claude session lights up with that session's stale context. */ +const CONTEXT_ACTIVE_MS = 10 * 60 * 1000; + /** How far past a viewport edge the cursor must travel before a release is * treated as "drag pane out of window" instead of "drop on empty space * inside this window". Picked so an accidental release on the OS titlebar @@ -419,10 +425,16 @@ export default function LeafPane({ leaf }: { leaf: LeafNode }) { })(); const matchCwd = liveCwd ?? leaf.cwd; - const ctx = + const matchedCtx = leaf.shellKind === "wsl" && matchCwd ? orch.paneContext.get(matchCwd) : undefined; + // Suppress stale matches: only surface the bar while the session is actively + // being written (a live claude keeps its transcript fresh). + const ctx = + matchedCtx && Date.now() - matchedCtx.lastActiveMs < CONTEXT_ACTIVE_MS + ? matchedCtx + : undefined; return (