From 8f4ab7ad2c53a5ffda2ba4ff4f1f29d7a94633ac Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Thu, 30 Jul 2026 12:27:23 -0500 Subject: [PATCH] fix(desktop): coding rail reads only its own worktree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The row fell back to the global $repoStatus whenever repoPath was blank, painting the main pane's branch and ± onto a tile whose cwd hadn't resolved yet. The fallback bought nothing — the primary computed is keyed to $currentCwd, which is empty in exactly that case — and cost a rail showing a tree the session was never in. --- .../app/chat/composer/status-stack/coding-row.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/app/chat/composer/status-stack/coding-row.tsx b/apps/desktop/src/app/chat/composer/status-stack/coding-row.tsx index 6ad820765e5..4d25320d952 100644 --- a/apps/desktop/src/app/chat/composer/status-stack/coding-row.tsx +++ b/apps/desktop/src/app/chat/composer/status-stack/coding-row.tsx @@ -16,8 +16,6 @@ import { DiffCount } from '@/components/ui/diff-count' import type { HermesGitBranch } from '@/global' import { useI18n } from '@/i18n' import { - $repoStatus, - $repoWorktrees, registerRepoStatusCwd, repoStatusForCwd, repoWorktreesForCwd @@ -69,10 +67,13 @@ export const CodingStatusRow = memo(function CodingStatusRow({ const s = t.statusStack.coding const p = t.sidebar.projects const resolvedRepoPath = repoPath?.trim() || undefined - // Per-cwd slice when this surface knows its worktree (tiles); otherwise the - // primary main-pane computed — so a blank/missing repoPath still paints. - const status = useStore(resolvedRepoPath ? repoStatusForCwd(resolvedRepoPath) : $repoStatus) - const worktrees = useStore(resolvedRepoPath ? repoWorktreesForCwd(resolvedRepoPath) : $repoWorktrees) + // This surface's OWN worktree, always — never the primary's. The row used to + // fall back to the global `$repoStatus` for a blank repoPath, which painted + // the main pane's branch/± onto a tile whose cwd hadn't resolved yet. That + // fallback bought nothing (the primary's computed is keyed to `$currentCwd`, + // which is blank in exactly the same case) and cost a wrong-tree rail. + const status = useStore(repoStatusForCwd(resolvedRepoPath)) + const worktrees = useStore(repoWorktreesForCwd(resolvedRepoPath)) // While mounted, keep this worktree in the coding-status refresh set so the // turn-settle / tool-complete / focus edges re-probe it too (tiles otherwise