Summary: Files Workbench v2 (FILES_WORKBENCH_V2, default OFF) has multiple data-loss regressions vs v1 plus dirty-state leaks and polish gaps — all Phase-9 default-flip blockers. Relates to the Files tab v2 work shipped in #449. (The agent file-read 'File not found' for brand-new unsaved files is tracked separately as ADE-62.)
Data-loss parity blockers (high):
dirtyPaths lifecycle (medium):
Polish (low):
Verification confidence: High for functional items; medium for the aesthetic finding. Flag defaults OFF so not yet hitting users, but these are default-flip blockers.
Summary: Files Workbench v2 (FILES_WORKBENCH_V2, default OFF) has multiple data-loss regressions vs v1 plus dirty-state leaks and polish gaps — all Phase-9 default-flip blockers. Relates to the Files tab v2 work shipped in #449. (The agent file-read 'File not found' for brand-new unsaved files is tracked separately as ADE-62.)
Data-loss parity blockers (high):
disposeAll(); dirtywindow.confirmguards exist only on close-tab/delete; v2 has nobeforeunload(v1 has both).FilesWorkbench.tsx:184,:193;WorkspacePicker.tsx:35;FilesPage.tsx:1010,:1794. Fix: interceptWorkspacePicker.onChangeto confirm/save when dirty; addbeforeunload; guarddisposeAll().renamePathdoesawait window.ade.files.rename(...).catch(setError)then always runscloseOpenTabsUnder+refreshRoot.FilesWorkbench.tsx:435;FilesExplorer.tsx:247. Fix: rethrow on failure; only run cleanup in the success path.CodeViewerreuses one model viagetOrCreate;ViewerHost'sreloadTokenis never threaded byEditorGroups/EditorGroup(defaults 0).FilesWorkbench.tsx:297;ViewerHost.tsx:33;EditorGroups.tsx:74;viewers/CodeViewer.tsx:155. Fix: onfiles.onChangefor an open non-dirty tab, bump a per-path reloadToken through the chain and reset the model; for dirty tabs surface non-destructive 'Reload / Keep mine'.dirtyPaths lifecycle (medium):
dirtyPathsis global (path-only) and never reset on workspace switch — stale 'unsaved' dots/counts leak across workspaces.FilesWorkbench.tsx:97,:184;EditorGroup.tsx:104;StatusBar.tsx:32. Fix: reset on workspace change or key by${workspaceId}::${path}.closeOpenTabsUndernever prunesdirtyPaths).FilesWorkbench.tsx:419;StatusBar.tsx:30. Fix: prune closed paths fromdirtyPathsincloseOpenTabsUnder.Polish (low):
forgetRecentFilenever wired).recentFiles.ts:16;FilesWorkbench.tsx:447,:435;WarmEmptyState.tsx:86.recentFiles.ts:1;WarmEmptyState.tsx:85. Fix: persist per session key (bounded) pruning on rename/delete.EditorGroup.tsx:139;viewers/DiffViewer.tsx:26. Fix: keep Save routed to the editor'ssave()or bind a workbench-level Cmd+S.CommitDetailPanel.tsx:262;historyGitActions.ts:199. Fix: one inline notice explaining the lane mismatch.WarmEmptyState.tsx:49;FilesWorkbench.tsx:520;overlays.tsx:237. Fix: accent-tinted mark, higher-contrast copy, concrete next actions; avoid font-mono for non-code previews.Verification confidence: High for functional items; medium for the aesthetic finding. Flag defaults OFF so not yet hitting users, but these are default-flip blockers.