From 1092e35b0a948c473fb39e4dd879bcbe36dffb9d Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 18 Sep 2026 04:26:40 -0700 Subject: [PATCH] docs(persistence): pin why the local-only scrollback home stays outside full normalization The two scrollback homes look symmetric (TERMINAL_SCROLLBACK_SESSION_HOMES), so the missing key reads as an oversight. It is load-bearing: adding it would route the field through the fail-closed strip and reintroduce the loss this branch fixes. The renderer prunes it with attribution before the patch is sent, so the cap still holds without main as a second line. --- .../persistence/loading-store/terminal-session-cleanup.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/persistence/loading-store/terminal-session-cleanup.ts b/src/main/persistence/loading-store/terminal-session-cleanup.ts index 2981cabc114..dede6bf8747 100644 --- a/src/main/persistence/loading-store/terminal-session-cleanup.ts +++ b/src/main/persistence/loading-store/terminal-session-cleanup.ts @@ -8,6 +8,11 @@ import { type TerminalScrollbackSnapshotStorage } from '../../terminal-scrollback-snapshots' +// Why localOnlyScrollbackByTabId is deliberately NOT here despite TERMINAL_SCROLLBACK_SESSION_HOMES +// pairing it with terminalLayoutsByTabId: full normalization reaches the fail-closed strip in +// workspace-session-terminal-buffers.ts, which drops a leaf whose worktree main cannot attribute — +// the renderer already capped that field with attribution in hand, and re-stripping it here is the +// scrollback loss the local-only home exists to prevent. Add it only together with that strip. const WORKSPACE_SESSION_PATCH_FULL_NORMALIZATION_KEYS = new Set([ 'tabsByWorktree', 'terminalLayoutsByTabId'