fix(terminal): let a park capture survive an unhydrated repo catalog

Reading state.repos unguarded threw out of the cold-park effect whenever the catalog was
absent, which would break parking itself. Capture is best-effort evidence; an empty catalog
also fails open in shouldPreserveTerminalScrollbackBuffers, the safe direction for a park.
This commit is contained in:
Neil
2026-09-18 04:07:22 -07:00
parent 75e427156c
commit c8e2614d9f
@@ -21,7 +21,10 @@ export function captureNewlyParkedTerminalTabs(
if (capturedTabIds.size === parkedTabIds.size) {
return
}
const repos = useAppStore.getState().repos
// Why the fallback: capture is best-effort evidence and must never throw out of the park pass.
// An unhydrated catalog also fails open in shouldPreserveTerminalScrollbackBuffers — the safe
// direction, since a worktree wrongly judged local would park with no copy at all.
const repos = useAppStore.getState().repos ?? []
for (const tabId of parkedTabIds) {
if (capturedTabIds.has(tabId)) {
continue