refactor(surface): remove the main-area surface concept entirely

activeSurface was permanently 'chat' after the legacy mobile layout
removal, so the whole concept is gone: the store field, surfaceGuard,
setActiveSurface/setSurfaceGuard, the per-runtime surface memory in
prepare/restoreForRuntimeSwitch, and WorkspaceSurface itself. All ~30
setActiveSurface('chat') call sites were no-ops and are deleted;
always-true 'is the chat active' checks in keyboard shortcuts, Header
and ChatContainer are unconditional now. FilesView's dirty-file guard
kept its file-switch and close protection but drops the surface-switch
branch nothing could trigger. TerminalView visibility comes only from
its callers. The router keeps parsing legacy ?tab= links (they open the
matching context-panel surface) via its own RouteTab type and no longer
serializes a tab or diff file into URLs — desktop URLs never carried
them anyway.
This commit is contained in:
Bohdan Triapitsyn
2026-08-24 16:36:41 +03:00
parent c6e39f15fe
commit c82f188fc8
31 changed files with 49 additions and 276 deletions
+3 -8
View File
@@ -102,7 +102,6 @@ export const useMenuActions = (
const toggleHelpDialog = useUIStore((s) => s.toggleHelpDialog);
const toggleSidebar = useUIStore((s) => s.toggleSidebar);
const setSessionSwitcherOpen = useUIStore((s) => s.setSessionSwitcherOpen);
const setActiveSurface = useUIStore((s) => s.setActiveSurface);
const setSettingsDialogOpen = useUIStore((s) => s.setSettingsDialogOpen);
const setAboutDialogOpen = useUIStore((s) => s.setAboutDialogOpen);
const checkForUpdates = useUpdateStore((state) => state.checkForUpdates);
@@ -151,10 +150,9 @@ export const useMenuActions = (
const nextSession = sessions[nextIndex];
if (!nextSession) return;
setActiveSurface('chat');
setSessionSwitcherOpen(false);
useSessionUIStore.getState().setCurrentSession(nextSession.id);
}, [setActiveSurface, setSessionSwitcherOpen]);
}, [setSessionSwitcherOpen]);
const navigateProject = React.useCallback((direction: -1 | 1) => {
const { activeProjectId, projects, setActiveProject } = useProjectsStore.getState();
@@ -191,8 +189,7 @@ export const useMenuActions = (
break;
case 'new-session':
setActiveSurface('chat');
setSessionSwitcherOpen(false);
setSessionSwitcherOpen(false);
{
const sessionState = useSessionUIStore.getState();
const directory = useDirectoryStore.getState().currentDirectory;
@@ -203,8 +200,7 @@ export const useMenuActions = (
break;
case 'new-worktree-session':
setActiveSurface('chat');
setSessionSwitcherOpen(false);
setSessionSwitcherOpen(false);
createWorktreeSession();
break;
@@ -341,7 +337,6 @@ export const useMenuActions = (
onToggleMemoryDebug,
openNewSessionDraft,
setAboutDialogOpen,
setActiveSurface,
setSessionSwitcherOpen,
setCommandPaletteOpen,
setSettingsDialogOpen,