ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
> Specification change gate: A bug fix that restores an existing B* rule belongs in a regression test. Update this file only when the intended base controller behavior changes.
Specifies `baseSessionLayoutController.ts` (BaseLayoutController), the abstract, platform-agnostic controller that manages the per-session layout state shared by every layout. Platform-specific auxiliary bar behaviour lives in the desktop / mobile subclasses (desktop spec, mobile spec).
This is the file-level companion to LAYOUT_CONTROLLER.md.
[B*]) used by the code and tests; numbering does not imply an order.---
Switching to a session restores the layout you last had for it; switching away leaves the other session's layout untouched.
#### B1 — Panel visibility The bottom panel's visibility is remembered per session and defaults to hidden. Toggling the panel updates that session's remembered state. Single-pane disables this scope: it governs the panel at the workbench level (like the side pane), so the panel is neither synced on a session switch nor recorded per session there.
#### B6 — Panel view Which view (pane composite) the panel shows is remembered per session and restored when you switch to that session or reveal the panel — but restoring the view never changes the panel's visibility (it applies only while the panel is already open). This is the inverse of [B1]: a layout either remembers the panel's visibility per session (and lets its view follow the global last-active) or governs visibility at the workbench level and remembers the *view* per session instead — never both. The single-pane layout is the latter. A session with no remembered view falls back to the Terminal.
#### B2 — Open editors Each session restores its own set of open editors when you activate it. Switching sessions saves the editors you had open and applies the target session's. New / untitled sessions, and sessions with no saved editors, never force the editor area open or wipe it. In layouts that scope editor-part visibility per session, hiding the editor part is restored with that session. Single-pane disables that visibility scope: only editor tabs are per-session there.
A session's remembered layout is preserved when the app is closed and restored when it reopens.
#### B3 — Restored on start On startup each session's saved layout is restored. Corrupt data is ignored, and a one-time migration upgrades layout saved by older versions.
#### B4 — Saved on close Closing or reloading the app saves every session's current layout so B3 can restore it next time.
When more than one session is visible at the same time, there is no single "active" layout to apply.
#### B5 — Fall back to defaults While multiple sessions are visible, per-session panel restore is paused and the remembered panel / auxiliary-bar state for those sessions is discarded, so collapsing back to a single session shows the default layout instead of stale state. Open editors are still preserved.
---
activeSession / visibleSessions observables via autorun / derived, never events for control flow. Derives activeSessionResourceObs (resource-equality de-duplicated) and multipleSessionsVisibleObs._syncPanelVisibility(resource) restores the record (default hidden); a live onDidChangePartVisibility listener for PANEL_PART updates it (suppressed while multiple sessions are visible). Gated on _isPanelVisibilityPerSession (base true): single-pane overrides it to false so the sync autorun, the record listener, and the [B5] cleanup all skip the panel, leaving its visibility to the workbench (persisted there alongside the side pane)._panelViewBySession records the panel's active pane-composite id per session, captured from IPaneCompositePartService.onDidPaneCompositeOpen for ViewContainerLocation.Panel (suppressed while multiple sessions are visible or a custom view covers the grid). _syncPanelView(resource) restores it on session switch (an autorun) and on the panel being shown (a PANEL_PART visibility listener), but only while the panel is already visible — openPaneCompositeTERMINAL_VIEW_ID_isPanelVisibilityPerSession_isPanelVisibilityPerSession = falsepanelViewContainerIdworkbench.editor.useModal: browser editors dock in the shared grid editor part even when useModal is 'all' (they except themselves from the modal part), so their tabs still need per-session capture/restore in that mode. _useModalConfigObs is only consulted inside _applyWorkingSet to decide whether to auto-reveal the editor part (skipped in modal mode, since modal editors manage their own visibility). activeSessionForWorkingSet (derivedObservableWithCache) holds back the new session until the workspace folders reflect its working directory. Save/apply on switch via a serializing Sequencer; initial restore applies a saved set under suppressEditorPartAutoVisibility() only. The editor part's hidden state is captured eagerly per session by a part-visibility listener the moment the user changes it (_editorPartHiddenBySession, only while a single session is visible — the editor area is shared in multi-session mode; captured lazily at switch-away it would race the switch derive), so a switch-back _applyWorkingSet skips the editor-part reveal for layouts that use per-session visibility. Single-pane overrides _isEditorPartVisibilityPerSession and _isViewStatePerSession to disable both maps; SinglePaneExistingSessionStrategy owns the shared Existing visibility profile, while SinglePaneNewSessionStrategy applies only a one-time entry rule and stores no visibility state. onDidReplaceSession copies a replaced active draft's editor-part hidden state to the committed resource before that resource's first working-set apply, avoiding a fall-through to the created-session default. Cleanup on onDidChangeSessions (_deleteWorkingSet drops only the working set, never view state). Clearing a session Changes pane releases its resolved multi-diff models, including models that finish resolving after the pane clears, while retaining the serializable editor input and persisted view state. A restored working set therefore re-resolves documents without keeping an inactive session's files open.URI and persisted to the workspace-scoped storage key sessions.layoutState (StorageTarget.MACHINE). _loadState restores on construction and drops corrupt data defensively; if the key is absent it migrates once from the legacy sessions.workingSets key and removes it. Maps: _viewStateBySession (opaque aux-bar state), _panelVisibilityBySession, _panelViewBySession, _workingSets.IStorageService.onWillSaveState → _saveState captures the active session's view state (via the _captureActiveSessionViewState hook) and working set, skips untitled / multi-session cases, then writes one entry per known session resource._viewStateBySession and _panelVisibilityBySession for every visible session (the latter only while _isPanelVisibilityPerSession); editor working sets are left untouched._registerViewStateManagement() runs at the end of the base constructor for platform-specific auxiliary bar wiring (no-op in the base); _captureActiveSessionViewState(resource) is the save-time hook (no-op in the base) invoked by [B4]; _onSidePaneToggled() runs at the end of toggleSidePane() (no-op in the base) so a subclass can record the resulting side-pane state, which the per-session capture listener deliberately ignores while the side pane is toggled.