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
@@ -1,4 +1,3 @@
import type { WorkspaceSurface } from '@/stores/useUIStore';
import { isEmbeddedSessionChat } from '@/components/layout/contextPanelEmbeddedChat';
import { ROUTE_PARAMS } from './types';
@@ -7,17 +6,10 @@ import { ROUTE_PARAMS } from './types';
*/
export interface AppRouteState {
sessionId: string | null;
tab: WorkspaceSurface;
isSettingsOpen: boolean;
settingsPath: string;
diffFile: string | null;
}
/**
* Default tab when none is specified.
*/
const DEFAULT_TAB: WorkspaceSurface = 'chat';
/**
* Serialize application state to URL search parameters.
* Only includes parameters that differ from defaults to keep URLs clean.
@@ -38,15 +30,6 @@ function serializeRoute(state: AppRouteState): URLSearchParams {
return params;
}
// Tab - only include if not the default
if (state.tab !== DEFAULT_TAB) {
params.set(ROUTE_PARAMS.TAB, state.tab);
}
// Diff file - only include when on diff tab
if (state.tab === 'diff' && state.diffFile && state.diffFile.trim().length > 0) {
params.set(ROUTE_PARAMS.FILE, state.diffFile);
}
return params;
}