Visual Studio Code, rebuilt in Rust
Rust
fix(preferences): keep side by side editors whole when copied or reopened
rokartur47a371a33ba7
diff --git a/README.md b/README.mdindex 873c3a0b835..6bfe583da75 100644--- a/README.md+++ b/README.md@@ -11,8 +11,8 @@ Coverage of VS Code 1.147.0, from [port/ledger.md](port/ledger.md) (584 rows). V```mermaidpie showData- "verified" : 416- "ported" : 14+ "verified" : 417+ "ported" : 13"removed" : 126"n/a" : 28```@@ -23,7 +23,7 @@ pie showData| workbench contribution | 65 | 3 | 30 | 3 | `███████████████████░ 96%` || built-in extension | 88 | 1 | 6 | 0 | `████████████████████ 99%` || MainThread* shape (Rust side) | 58 | 1 | 30 | 0 | `████████████████████ 98%` |-| workbench service | 59 | 6 | 23 | 7 | `██████████████████░░ 91%` |+| workbench service | 60 | 5 | 23 | 7 | `██████████████████░░ 92%` || src/vs/editor/contrib | 54 | 0 | 2 | 1 | `████████████████████ 100%` || workbench part | 11 | 0 | 2 | 0 | `████████████████████ 100%` || extension host seam | 7 | 0 | 0 | 0 | `████████████████████ 100%` |@@ -31,7 +31,7 @@ pie showData| src/vs/editor | 0 | 2 | 1 | 1 | `░░░░░░░░░░░░░░░░░░░░ 0%` || src/vs/base | 0 | 0 | 2 | 3 | `████████████████████ 100%` || port feature | 1 | 0 | 0 | 0 | `████████████████████ 100%` |-| **all** | **416** | **14** | **126** | **28** | `███████████████████░ 97%` |+| **all** | **417** | **13** | **126** | **28** | `███████████████████░ 97%` |<!-- coverage:end -->`removed` are parts left out by decision: AI features, Microsoft services, telemetry, remote and tunnels ([port/notes.md](port/notes.md)). `n/a` are upstream test infrastructure and the Electron process, IPC and DOM layers the native architecture replaces.diff --git a/native/crates/app/src/editor.rs b/native/crates/app/src/editor.rsindex 74d0fff6fa7..51710327ebe 100644--- a/native/crates/app/src/editor.rs+++ b/native/crates/app/src/editor.rs@@ -906,6 +906,16 @@ pub enum PeekOwner {Hierarchy,QuickDiff,}++/// `IRecentlyClosedEditor`: a closed file editor by its resource, group and tab index, and a side by side editor's+/// secondary side (sideBySideEditorInput.ts `toUntyped` keeps both sides).+pub struct ClosedEditor {+ pub group: u32,+ pub scheme: String,+ pub path: PathBuf,+ pub index: usize,+ pub secondary: Option<PathBuf>,+}/// The editor part's groups. The active group's editors and state are the fields below; the other groups wait/// in `other_groups`. Text models are shared by the editors of their resource in every group, so `models`,/// `diffs`, the disposed models and the view states are the part's.@@ -922,8 +932,8 @@ pub struct EditorGroup {pub columns: Vec<u32>,/// The panel's code editor shows (the Output view is visible): the host sees it as a visible text editor.pub panel_editor_shown: bool,- /// Closed file editors as (group, scheme, path, tab index), for the workbench's Reopen Closed Editor.- pub closed: Vec<(u32, String, PathBuf, usize)>,+ /// Closed file editors, for the workbench's Reopen Closed Editor.+ pub closed: Vec<ClosedEditor>,/// The active group's last editor closed (`closeEmptyGroups` closes the group then).pub closed_last_editor: bool,pub editors: Vec<OpenEditor>,@@ -948,6 +958,9 @@ pub struct EditorGroup {/// The side by side editors among `editors` (`SideBySideEditorInput`), by their entry's model id: the entry is/// the primary side, the secondary is the one editor of a group of its own, outside the grid and the group list.pub side_by_sides: HashMap<u32, u32>,+ /// Side by side editors reopened from their untyped form: a plain `SideBySideEditorInput`, whose editor is the+ /// text editor, where the one preferencesService.ts opens is a `SplitSettingsEditorInput`.+ pub plain_side_by_sides: HashSet<u32>,/// For an editor among `editors` that stacks several live code editors (a notebook's cells), by its entry's/// model id: the model the group's code editor edits, the focused one (`INotebookEditor.activeCodeEditor`)./// The others draw as `embedded_code_editor`s without the focus.@@ -1471,6 +1484,8 @@ impl EditorGroup {let id = self.next_group_id;let mut group = GroupState { id, editors: Vec::new(), recent: Vec::new(), viewport: self.viewport, unicode_banner_closed: false };if let Some(copy) = copy_active.then(|| self.copy_active()).flatten() {+ let source = self.active_tab().expect("copied from the active tab").model_id;+ self.copy_side_by_side(source, copy.model_id);group.recent.push(copy.model_id);group.editors.push(copy);self.opened_first_editor = Some(id);@@ -1479,6 +1494,25 @@ impl EditorGroup {id}+ /// A copy of the side by side editor `source` is one too (`SideBySideEditorInput` opens as is in another group):+ /// `copy` gets a secondary group of its own with a copy of the secondary side's editor.+ fn copy_side_by_side(&mut self, source: u32, copy: u32) {+ let Some(side) = self.side_by_sides.get(&source).copied() else { return };+ let (editors, active) = self.group_tabs(side);+ let secondary = &editors[active.expect("a secondary side shows its editor")];+ let (model, view_state) = (secondary.model.clone(), secondary.view_state(self.viewport));+ self.next_model_id += 1;+ let mut secondary = OpenEditor::of_model(model, false, self.next_model_id);+ secondary.restore_view_state(&view_state, self.viewport);+ let side = self.add_side_group(copy);+ if self.plain_side_by_sides.contains(&source) {+ self.plain_side_by_sides.insert(copy);+ }+ let group = self.other_groups.iter_mut().find(|group| group.id == side).expect("just added");+ group.recent.push(secondary.model_id);+ group.editors.push(secondary);+ }+/// A copy of the active editor for another group, as `splitEditor` copies it: an editor of the same model with/// the same view state, not a preview.pub fn copy_active(&mut self) -> Option<OpenEditor> {@@ -1610,6 +1644,7 @@ impl EditorGroup {/// Makes the side by side editor `entry` its primary side's editor again: its secondary group closes.pub fn remove_side_by_side(&mut self, entry: u32) {+ self.plain_side_by_sides.remove(&entry);let Some(side) = self.side_by_sides.remove(&entry) else { return };let index = self.other_groups.iter().position(|group| group.id == side).expect("the secondary side is not the active group when its editor closes");let group = self.other_groups.remove(index);@@ -1774,7 +1809,9 @@ impl EditorGroup {pub fn close(&mut self, index: usize) {let closed = self.editors.remove(index);if on_disk(&closed.document().scheme) && !self.diffs.contains_key(&closed.model_id) {- self.closed.push((self.id, closed.document().scheme.clone(), closed.document().path.clone(), index));+ let side = self.side_by_sides.get(&closed.model_id).map(|side| self.group_tabs(*side));+ let secondary = side.and_then(|(editors, active)| Some(editors[active?].document().path.clone()));+ self.closed.push(ClosedEditor { group: self.id, scheme: closed.document().scheme.clone(), path: closed.document().path.clone(), index, secondary });}self.remove_input(&closed.model_id);let shown = self.recent.first().copied();diff --git a/native/crates/app/src/host_sync.rs b/native/crates/app/src/host_sync.rsindex 38f7c45ee2f..9ad94d40ce9 100644--- a/native/crates/app/src/host_sync.rs+++ b/native/crates/app/src/host_sync.rs@@ -415,6 +415,8 @@ impl HostSync {pub fn text_editors<'a>(&self, group: &'a EditorGroup) -> Vec<(Option<usize>, &'a OpenEditor, crate::editor::Viewport)> {let mut visible: Vec<(Option<usize>, &OpenEditor, crate::editor::Viewport)> = Vec::new();for (column, id) in group.column_ids().into_iter().enumerate() {+ // The active group is a secondary side outside the grid: its column is its side by side editor's.+ let id = group.side_group_owner(id).unwrap_or(id);let Some((editor, viewport)) = group.group_active(id) else { continue };// The cells whose code editor holds their model (notebook_cells), the focused one first.let mut cells = group.group_active_tab(id).map(|tab| crate::workbench::notebook_cells(&self.notebooks, group, tab)).unwrap_or_default();@@ -427,6 +429,8 @@ impl HostSync {visible.push((Some(column), editor, viewport));}}+ let secondary = group.group_active_tab(id).and_then(|tab| group.side_by_sides.get(&tab.model_id)).and_then(|side| group.group_active(*side));+ visible.extend(secondary.filter(|(editor, _)| self.is_text(editor)).map(|(editor, viewport)| (None, editor, viewport)));}let panel = group.panel_editor_shown.then(|| group.group_active(crate::editor::PANEL_GROUP)).flatten().filter(|(editor, _)| self.is_text(editor));visible.extend(panel.map(|(editor, viewport)| (None, editor, viewport)));@@ -1084,4 +1088,22 @@ mod tests {assert_eq!(tab["input"], json!({ "kind": 0 }));assert_eq!(tab["id"], format!("0~{type_id}-{type_id}-file:///w/a.code-search "));}++ /// mainThreadDocumentsAndEditors.ts `_updateState` lists every code editor with a model: a side by side editor's+ /// secondary side is a text editor too, without a column (`SideBySideEditor.getControl` is the primary's).+ #[test]+ fn both_sides_of_a_side_by_side_editor_are_visible_text_editors() {+ let sync = HostSync::new(channel().0);+ let mut group = EditorGroup::default();+ group.open(document("/w/settings.json", "jsonc"), false);+ let (primary, entry) = (group.id, group.active_tab().unwrap().model_id);+ let side = group.add_side_group(entry);+ group.activate_group(side);+ group.open(document("/defaultsettings/settings.json", "jsonc"), false);+ let editors = |group: &EditorGroup| sync.text_editors(group).iter().map(|(column, editor, _)| (*column, editor.document().path.clone())).collect::<Vec<_>>();+ let expected = [(Some(0), PathBuf::from("/w/settings.json")), (None, PathBuf::from("/defaultsettings/settings.json"))];+ assert_eq!(editors(&group), expected, "the secondary side active");+ group.activate_group(primary);+ assert_eq!(editors(&group), expected, "the primary side active");+ }}diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rsindex ce8ce1785b2..8deae377f88 100644--- a/native/crates/app/src/workbench.rs+++ b/native/crates/app/src/workbench.rs@@ -1191,8 +1191,8 @@ impl Workbench {self.close_group_if_empty(self.editors.id);}self.editors.columns = if self.editors.has_several_groups() { self.groups_in_grid_order() } else { Vec::new() };- for (group, scheme, path, index) in std::mem::take(&mut self.editors.closed) {- self.remember_closed_editor(group, scheme, path, index);+ for closed in std::mem::take(&mut self.editors.closed) {+ self.remember_closed_editor(closed);}self.release_closed_wait_files();self.record_navigation(None);diff --git a/native/crates/app/src/workbench/editor_type_picker.rs b/native/crates/app/src/workbench/editor_type_picker.rsindex 257391b9f24..f0f0c4dbc93 100644--- a/native/crates/app/src/workbench/editor_type_picker.rs+++ b/native/crates/app/src/workbench/editor_type_picker.rs@@ -26,7 +26,7 @@ const OPEN_TO_SIDE_PREFIX: &str = "editorType.openToSide.";const OPEN_ORIGINAL: &str = "editorType.openOriginal";const OPEN_MODIFIED: &str = "editorType.openModified";/// `SplitSettingsEditorInput.EDITOR_ID`, `SideBySideEditorInput.ID` kept for existing associations.-const SPLIT_SETTINGS_EDITOR_ID: &str = "workbench.editorinputs.sidebysideEditorInput";+pub(super) const SPLIT_SETTINGS_EDITOR_ID: &str = "workbench.editorinputs.sidebysideEditorInput";/// Each group's control bounds as last painted: the menu's anchor (`getAnchor: () => editorTypeNode`).#[derive(Default)]@@ -104,7 +104,7 @@ impl Workbench {(resource, None, current)}};- if self.editors.active_tab().is_some_and(|tab| self.editors.side_by_sides.contains_key(&tab.model_id)) {+ if self.editors.active_tab().is_some_and(|tab| self.editors.side_by_sides.contains_key(&tab.model_id) && !self.editors.plain_side_by_sides.contains(&tab.model_id)) {current = SPLIT_SETTINGS_EDITOR_ID.to_owned();}let (scheme, path) = uri_parts(&resource).ok()?;diff --git a/native/crates/app/src/workbench/editor_type_picker/tests.rs b/native/crates/app/src/workbench/editor_type_picker/tests.rsindex 53dd296dbcb..1da3e7b459c 100644--- a/native/crates/app/src/workbench/editor_type_picker/tests.rs+++ b/native/crates/app/src/workbench/editor_type_picker/tests.rs@@ -166,6 +166,24 @@ fn an_extension_editor_names_its_extension() {assert_eq!(label_with_source("Markdown Preview", "Built-in"), "Markdown Preview");}+/// breadcrumbsControl.ts `_updateEditorTypeControl` runs for every editor with breadcrumbs: a media preview too.+#[gpui::test]+fn an_image_preview_offers_its_editors_in_the_breadcrumbs(cx: &mut TestAppContext) {+ let app_root = Path::new(env!("VSCODE_SRC")).to_path_buf();+ let theme = load_theme(&[scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap()], "Dark Modern").unwrap();+ let (workbench, cx) = cx.add_window_view(|_, cx| Workbench::new(theme, app_root.clone(), None, Languages::new(&[]), crate::default_settings(), HostSync::new(std::sync::mpsc::channel().0), cx));+ let image = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../port/fixtures/webviews/image.png");+ workbench.update_in(cx, |workbench, window, cx| workbench.open_file(image.clone(), true, window, cx));+ cx.run_until_parked();+ let (label, actions) = workbench.update_in(cx, |workbench, window, cx| {+ let label = workbench.editor_type_picker(cx).map(|_| workbench.breadcrumbs_editor_types().unwrap().current);+ workbench.show_editor_type_menu(window, cx);+ (label, workbench.context_menu.as_ref().map(|menu| titles(&menu.levels[0].actions)).unwrap_or_default())+ });+ assert_eq!(label.as_deref(), Some(crate::workbench::media_preview::IMAGE_PREVIEW_EDITOR_ID));+ assert_eq!(actions[..3], ["Image Preview *".to_owned(), "Text Editor".to_owned(), "-".to_owned()]);+}+// The chevron sits 2px after the label in Chromium, which keeps text widths in 1/64px units: a whole-pixel ceil// pushed it up to 1px further.#[gpui::test]diff --git a/native/crates/app/src/workbench/history_actions.rs b/native/crates/app/src/workbench/history_actions.rsindex bd7f57429e3..e73f4cbbac1 100644--- a/native/crates/app/src/workbench/history_actions.rs+++ b/native/crates/app/src/workbench/history_actions.rs@@ -10,20 +10,12 @@ use serde_json::{Value, json};use super::Workbench;use crate::commands::Outcome;-use crate::editor::{Selection, VerticalReveal};+use crate::editor::{ClosedEditor, Selection, VerticalReveal};use crate::navigation::{Entry, Filter, Reason, Stacks};/// `RECENTLY_CLOSED_EDITORS` limit (`MAX_RECENTLY_CLOSED_EDITORS`).const MAX_RECENTLY_CLOSED: usize = 20;-/// `IRecentlyClosedEditor`: a closed file editor by its resource, group and tab index.-pub(super) struct ClosedEditor {- group: u32,- scheme: String,- path: PathBuf,- index: usize,-}-#[derive(Default)]pub(super) struct History {/// The stacks of each `workbench.editor.navigationScope` key: none for `default`, the group for `editorGroup`,@@ -221,9 +213,9 @@ impl Workbench {}/// historyService.ts `onEditorClosed`: a closed file editor can be reopened (not one replaced or moved).- pub(super) fn remember_closed_editor(&mut self, group: u32, scheme: String, path: PathBuf, index: usize) {- self.history.closed.retain(|closed| (&closed.scheme, &closed.path) != (&scheme, &path));- self.history.closed.push(ClosedEditor { group, scheme, path, index });+ pub(super) fn remember_closed_editor(&mut self, editor: ClosedEditor) {+ self.history.closed.retain(|closed| (&closed.scheme, &closed.path) != (&editor.scheme, &editor.path));+ self.history.closed.push(editor);if self.history.closed.len() > MAX_RECENTLY_CLOSED {self.history.closed.remove(0);}@@ -239,6 +231,11 @@ impl Workbench {self.focus_group(closed.group, window, cx);}self.open_disk_resource(&closed.scheme, closed.path.clone(), true, window, cx);+ if let Some(secondary) = &closed.secondary {+ self.show_side_by_side(secondary, window, cx);+ let entry = self.editors.active_tab().expect("just reopened").model_id;+ self.editors.plain_side_by_sides.insert(entry);+ }if let Some(from) = self.editors.find(&closed.scheme, &closed.path) {self.editors.move_editor(from, closed.index);self.editors_changed(cx);diff --git a/native/crates/app/src/workbench/preferences/tests.rs b/native/crates/app/src/workbench/preferences/tests.rsindex 88e39a1caae..75d8a62c663 100644--- a/native/crates/app/src/workbench/preferences/tests.rs+++ b/native/crates/app/src/workbench/preferences/tests.rs@@ -262,6 +262,43 @@ fn split_json_opens_the_default_settings_beside_settings_json(cx: &mut TestAppCostd::fs::remove_dir_all(dir).unwrap();}+/// sideBySideEditorInput.ts: Split Editor opens the same input in the new group and Reopen Closed Editor its+/// `toUntyped` with both sides, so both stay side by side editors; the reopened one is a plain SideBySideEditorInput.+#[gpui::test]+fn a_copied_or_reopened_split_json_editor_keeps_its_default_settings(cx: &mut TestAppContext) {+ let (workbench, cx, dir) = workbench(cx, "split-copy");+ workbench.update(cx, |workbench, _| {+ let mut settings = workbench.settings.lock().unwrap();+ settings.update_value("workbench.settings.useSplitJSON", Some(&json!(true)), config::service::Target::User, None, &[]).unwrap();+ settings.update_value("workbench.editor.useModal", Some(&json!("off")), config::service::Target::User, None, &[]).unwrap();+ });+ run(&workbench, cx, "workbench.action.openSettingsJson", vec![]);+ let secondary = |cx: &mut VisualTestContext| {+ workbench.read_with(cx, |workbench, _| {+ let side = workbench.editors.side_group()?;+ let (editors, _) = workbench.editors.group_tabs(side);+ Some(editors[0].document().path.clone())+ })+ };+ let default_settings = Some(PathBuf::from("//defaultsettings/settings.json"));+ assert_eq!(secondary(cx), default_settings);+ let editor_type = |cx: &mut VisualTestContext| workbench.read_with(cx, |workbench, _| workbench.available_editor_types(&[]).unwrap().current);++ run(&workbench, cx, "workbench.action.splitEditor", vec![]);+ assert!(workbench.read_with(cx, |workbench, _| workbench.editors.has_several_groups()));+ assert_eq!(secondary(cx), default_settings, "the split's copy");+ assert_eq!(editor_type(cx), super::super::editor_type_picker::SPLIT_SETTINGS_EDITOR_ID);++ run(&workbench, cx, "workbench.action.closeActiveEditor", vec![]);+ run(&workbench, cx, "workbench.action.closeActiveEditor", vec![]);+ assert!(workbench.read_with(cx, |workbench, _| workbench.editors.editors.is_empty() && workbench.editors.side_by_sides.is_empty()));+ run(&workbench, cx, "workbench.action.reopenClosedEditor", vec![]);+ workbench.read_with(cx, |workbench, _| assert_eq!(workbench.editors.active().unwrap().document().path, dir.join("User/settings.json")));+ assert_eq!(secondary(cx), default_settings, "the reopened editor");+ assert_eq!(editor_type(cx), super::super::custom_editors::TEXT_EDITOR_ID, "a plain side by side editor's");+ std::fs::remove_dir_all(dir).unwrap();+}+/// sideBySideEditor.ts `lastFocusedSide`: a workbench action from the read-only side acts on the group and the side/// keeps the focus after it; Go to Line acts on the side's code editor (`activeTextEditorControl`).#[gpui::test]diff --git a/port/fixtures/ui-pair/m11/editor-type-image.json b/port/fixtures/ui-pair/m11/editor-type-image.jsonnew file mode 100644index 00000000000..74651549afd--- /dev/null+++ b/port/fixtures/ui-pair/m11/editor-type-image.json@@ -0,0 +1,4 @@+[+ { "wait": 2500 },+ { "shot": "editor-type-image" }+]diff --git a/port/fixtures/ui-pair/m11/split-settings-copy.json b/port/fixtures/ui-pair/m11/split-settings-copy.jsonnew file mode 100644index 00000000000..226016f22cf--- /dev/null+++ b/port/fixtures/ui-pair/m11/split-settings-copy.json@@ -0,0 +1,18 @@+[+ {"hotkey": ["cmd", "shift", "p"], "foreground": true},+ {"wait": 800},+ {"type": "Open User Settings (JSON)"},+ {"wait": 800},+ {"key": "return", "foreground": true},+ {"wait": 2500},+ {"hotkey": ["cmd", "\\"], "foreground": true},+ {"wait": 1500},+ {"shot": "split-settings-copy"},+ {"hotkey": ["cmd", "w"], "foreground": true},+ {"wait": 800},+ {"hotkey": ["cmd", "w"], "foreground": true},+ {"wait": 800},+ {"hotkey": ["cmd", "shift", "t"], "foreground": true},+ {"wait": 2000},+ {"shot": "split-settings-reopened"}+]diff --git a/port/ledger.md b/port/ledger.mdindex 7aa9f1f1218..45cce5b3a89 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -24,7 +24,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,| Milestones | M7 syntax colors and themes | done | TextMate grammars from `contributes.grammars` (vscode-textmate's algorithm, Oniguruma regexes), token colors from the theme's `tokenColors` and `semanticTokenColors`, bracket pair colorization and matching, every built-in color theme including High Contrast Light, `firstLine` language detection. Open gaps: the gaps column of its unit rows. | `port/results/pixels.md` milestone 7 (main window in dark, light, hc and hclight); cargo test -p app syntax:: (colorize_fixtures_match_the_reference: every colorize-tests fixture's scopes and colors) || Milestones | M8 editor viewport and editing commands | in progress | Scrolling (wheel, scrollbar, reveal), real `visibleRanges`, minimap, folding, sticky scroll, multi-cursor, find/replace widget, comment toggling, line operations, smart select, font zoom, the editor context menu. Open gaps: the gaps column of its unit rows. | api-tests `editor.test`, `window.test` (text editor parts) and `documents.test` pass as in the reference; pixel-check gains a scrolled long-file window with minimap and a folded region; `cargo test -p app` folding and multi-cursor tests. || Milestones | M9 commands, keybindings, menus, quick input | in progress | Command registry shared by the workbench and `vscode.commands`, context keys and `when` clauses, keybinding resolution from `contributes.keybindings` and `keybindings.json`, the native macOS menu bar, context menus, hovers, Command Palette and Quick Open (files, symbols, commands, theme picker), title bar and activity bar clicks. Open gaps: the gaps column of its unit rows. | api-tests `commands.test` and `quickInput.test` pass as in the reference; Cmd+Shift+P runs a command contributed by an extension; Cmd+P opens a fixture file; `cargo test -p app` `when`-clause and keybinding resolution tests against upstream cases. |-| Milestones | M10 settings, storage, profiles | in progress | `settings.json` (user, workspace, folder, language overrides) feeding both the workbench and `vscode.workspace.getConfiguration`, configuration schema from `contributes.configuration`, the Settings editor and JSON settings with schema validation, global and workspace storage on disk, secret storage in the macOS Keychain, profiles, real `environment` in init data. Import from VS Code, Cursor and VSCodium (Artur, port feature with no upstream counterpart): a command and a first-run offer that read each installed editor's user data (`~/Library/Application Support/{Code,Cursor,VSCodium}/User`: settings.json, keybindings.json, snippets, the color and icon theme ids) and its extension list (`~/.vscode/extensions`, `~/.cursor/extensions`, `~/.vscode-oss/extensions`, installed again from Open VSX), show what will be imported, write it into the active profile and skip settings and extensions the port has removed (AI, sign-in, Microsoft services, telemetry, remote). Open gaps: the gaps column of its unit rows. | api-tests `configuration.test` and `state.test` pass as in the reference; a setting changed in `settings.json` reaches an extension's `onDidChangeConfiguration`; storage survives a restart; importing from a fixture VS Code, Cursor and VSCodium user data folder gives the same settings, keybindings, snippets and theme in the port. |+| Milestones | M10 settings, storage, profiles | done | `settings.json` (user, workspace, folder, language overrides) feeding both the workbench and `vscode.workspace.getConfiguration`, configuration schema from `contributes.configuration`, the Settings editor and JSON settings with schema validation, global and workspace storage on disk, secret storage in the macOS Keychain, profiles, real `environment` in init data. Import from VS Code, Cursor and VSCodium (Artur, port feature with no upstream counterpart): a command and a first-run offer that read each installed editor's user data (`~/Library/Application Support/{Code,Cursor,VSCodium}/User`: settings.json, keybindings.json, snippets, the color and icon theme ids) and its extension list (`~/.vscode/extensions`, `~/.cursor/extensions`, `~/.vscode-oss/extensions`, installed again from Open VSX), show what will be imported, write it into the active profile and skip settings and extensions the port has removed (AI, sign-in, Microsoft services, telemetry, remote). Open gaps: the gaps column of its unit rows. | api-tests `configuration.test` and `state.test` pass as in the reference; a setting changed in `settings.json` reaches an extension's `onDidChangeConfiguration`; storage survives a restart; importing from a fixture VS Code, Cursor and VSCodium user data folder gives the same settings, keybindings, snippets and theme in the port. || Milestones | M11 workbench layout and chrome | in progress | The part grid with sashes and hidden parts, panel and secondary side bar, view containers and collapsible views, tree views from extensions (with the Refactor Preview of workbench/contrib/bulkEdit, which file operation participants open), editor groups and splits, notifications, dialogs (native open/save), progress, banner, status bar entries from extensions, decorations, window lifecycle (close, quit, hot exit backup), multiple windows, focus and inactive look. Open gaps: the gaps column of its unit rows. | api-tests `window.test` (messages, progress, tree views, status bar) pass as in the reference; pixel-check gains a window with panel and split editor; hot exit restores an unsaved buffer after quit. || Milestones | M12 files, explorer, search, workspace | in progress | File system service with watcher (FSEvents) and extension file system providers, Explorer file operations (new, rename, delete to Trash, drag and drop, copy/paste), Seti file icons, numeric name collation, workspace trust, multi-root `.code-workspace`, recent workspaces, text search through ripgrep, search view and search editor, bulk edits, local history, opener and URL handling. Open gaps: the gaps column of its unit rows. | api-tests `workspace.test`, `workspace.fs.test`, `workspace.event.test`, `workspace.tasks` excluded, and the api-workspace suite pass as in the reference; pixel-check folder window with Seti icons (reference captured without `workbench.iconTheme: null`); `cargo test -p app` sorting test with `file9`/`file10`. || Milestones | M13 language features | in progress | Everything `MainThreadLanguageFeatures` registers, drawn by the native editor: completion, hover, signature help, code actions and lightbulb, code lens, inlay hints, go to definition and peek, references, rename, formatting, document symbols and Outline, semantic tokens, semantic word highlight, links, color picker, linked editing, snippets, call and type hierarchy, inline completions from extensions; diagnostics with squiggles and the Problems panel; comments threads; Emmet; the language status item. Open gaps: the gaps column of its unit rows. | api-tests `languages.test`, `languagefeatures.test`-family and `comments` cases pass as in the reference; with `src/main.ts` open TypeScript completion, hover, go to definition and a diagnostic squiggle work (pixel-check window with a squiggle and the suggest widget). |@@ -423,7 +423,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| workbench/services/path | workbench service | M12 | verified | | the user home is $HOME (path_label, tildify), hasValidBasename is file_actions.rs is_valid_basename (cargo test -p app validates_file_names); pathService.test.ts covers only remote path semantics (no remote); verified at port-m12b-verify: cargo test -p app validates_file_names 1/1 || workbench/services/policies | workbench service | M10 | removed | | account policies, managed chat settings, the organization support link and policy telemetry need sign-in, AI or telemetry, none of which the port has by decision (port/notes.md); system policies are the platform/policy row || workbench/services/power | workbench service | M19 | verified | | workbench/power.rs: suspend, resume, shutdown, lock, unlock, thermal, battery and speed limit events to ExtHostPower; port/tools/shell-check (port/fixtures/extensions/shell-tests, 6/6); cargo test -p app power |-| workbench/services/preferences | workbench service | M10 | ported | [3 M] side-by-side editor: editor type for custom editors and media, copied/reopened opens as primary, host sees primary only | preferencesService.ts JSON parts (openSettingsJson with revealSetting (triggerSuggest after an edit) and @id: query, `openToSide` in SIDE_GROUP, the Open a folder first notification, createSettingsIfNotExists, openDefaultKeybindingsFile, defaultSettings resources) and preferencesModels.ts `DefaultSettings` / `DefaultRawSettingsEditorModel` as workbench/preferences.rs and default_settings.rs with preferencesModels.test.ts (cargo test -p app preferences default_settings; "merges untitled group into titled group" has no extension counterpart, the extension point titles every node); keybindingsEditorModel.ts and keybindingsEditorInput.ts as keybindings_editor.rs with keybindingsEditorModel.test.ts (cargo test -p app keybindings_editor); openGlobalKeybindingSettings opens the Keyboard Shortcuts editor (cargo test -p app keybindings_editor_view); openSettings (UI) opens the Settings editor (workbench/settings_editor_view.rs); preferencesValidation.ts as settings_editor/validation.rs with preferencesValidation.test.ts (cargo test -p app settings_editor); settings.json and keybindings.json open in the modal editor group unless `workbench.editor.useModal` is `off` (cargo test -p app modal_editor_group, ui-pair port/results/settings-editor.md milestone 11); editorCommands.ts `MoveModalEditorToMainWindowAction` merges the modal's editors into the main part, where the Settings and Keyboard Shortcuts editors draw too (open_modal_editor_in_main_window_moves_its_editors_to_the_main_part), as do the Profiles and Workspace Trust editors, `RequiresModal` group editors (the_workspace_trust_editor_moves_to_the_main_part); the split JSON settings editor (`useSplitJSON`, `openDefaultSettings`) as a side by side editor with the default settings of its target, and `openDefaultKeybindings` beside keybindings.json (cargo test -p app split_json open_default_keybindings, ui-pair port/fixtures/ui-pair/m11/split-settings.json); the breadcrumbs' editor type control, the EditSettingRenderer pencil and the side by side sash (cargo test -p app preferences editor_type_picker side_by_side); verified: ui-pair port/fixtures/ui-pair/m11/split-settings-edit.json (port/results/layout.md Split settings editor), remaining differences in port/notes.md Side by side editor |+| workbench/services/preferences | workbench service | M10 | verified | | preferencesService.ts JSON parts (openSettingsJson with revealSetting (triggerSuggest after an edit) and @id: query, `openToSide` in SIDE_GROUP, the Open a folder first notification, createSettingsIfNotExists, openDefaultKeybindingsFile, defaultSettings resources) and preferencesModels.ts `DefaultSettings` / `DefaultRawSettingsEditorModel` as workbench/preferences.rs and default_settings.rs with preferencesModels.test.ts (cargo test -p app preferences default_settings; "merges untitled group into titled group" has no extension counterpart, the extension point titles every node); keybindingsEditorModel.ts and keybindingsEditorInput.ts as keybindings_editor.rs with keybindingsEditorModel.test.ts (cargo test -p app keybindings_editor); openGlobalKeybindingSettings opens the Keyboard Shortcuts editor (cargo test -p app keybindings_editor_view); openSettings (UI) opens the Settings editor (workbench/settings_editor_view.rs); preferencesValidation.ts as settings_editor/validation.rs with preferencesValidation.test.ts (cargo test -p app settings_editor); settings.json and keybindings.json open in the modal editor group unless `workbench.editor.useModal` is `off` (cargo test -p app modal_editor_group, ui-pair port/results/settings-editor.md milestone 11); editorCommands.ts `MoveModalEditorToMainWindowAction` merges the modal's editors into the main part, where the Settings and Keyboard Shortcuts editors draw too (open_modal_editor_in_main_window_moves_its_editors_to_the_main_part), as do the Profiles and Workspace Trust editors, `RequiresModal` group editors (the_workspace_trust_editor_moves_to_the_main_part); the split JSON settings editor (`useSplitJSON`, `openDefaultSettings`) as a side by side editor with the default settings of its target, and `openDefaultKeybindings` beside keybindings.json (cargo test -p app split_json open_default_keybindings, ui-pair port/fixtures/ui-pair/m11/split-settings.json); the breadcrumbs' editor type control, the EditSettingRenderer pencil and the side by side sash (cargo test -p app preferences editor_type_picker side_by_side); a copied or reopened side by side editor keeps both sides and the host sees both (cargo test -p app a_copied_or_reopened both_sides_of_a_side_by_side); media previews' editor type control (an_image_preview_offers_its_editors_in_the_breadcrumbs); verified: ui-pair port/fixtures/ui-pair/m11/split-settings-edit.json (port/results/layout.md Split settings editor), m11/split-settings-copy.json with SETTINGS `{"workbench.settings.useSplitJSON": true, "workbench.editor.useModal": "off"}`, m11/editor-type-image.json with FOLDER=port/fixtures/webviews FILE=image.png || workbench/services/process | workbench service | M15 | n/a | | electron-browser/processService.ts is the 10-line IPC proxy to `platform/process` in the main process; the port has no main process (see platform/process) || workbench/services/progress | workbench service | M11 | verified | | progressService.ts withNotificationProgress and withWindowProgress (delays 150 ms and 800 ms); Explorer, Extensions, SCM and Dialog locations not used by the port yet; verified: ui-pair messages.json `progress` vs the reference (port/results/windows.md, milestone 11 verification) || workbench/services/quickinput | workbench service | M9 | verified | | quick_input_view.rs with header drag (cargo test -p app dragging); api-tests quick input 11/11; view state in application storage (cargo test -p app dragging) |diff --git a/port/notes.md b/port/notes.mdindex 9a201a8cb75..1bcc02ad1fc 100644--- a/port/notes.md+++ b/port/notes.md@@ -606,7 +606,7 @@ Scope (roadmap section 13): diagnostics, hover, completion, go to definition and- View visibility (`workbench/view_visibility.rs`, viewContainerModel.ts `ViewDescriptorsState`): `"visibility": "hidden"` views (npm's NPM Scripts) stay out of their container until `<view id>.toggleVisibility` from the Explorer's "..." Views submenu shows them; the state is `{ id, isHidden }` in the profile's `<storage id>.hidden`, which the Explorer's pane order shares. `collapsed`, and every contributed view of scm and debug (`showCollapsed`), start collapsed. Not ported yet: the Views submenu of the other containers, the title and pane header context menus with Hide.- Refactor Preview (`bulk_edit_preview.rs` for bulkEditPreview.ts's checked state, `workbench/refactor_preview.rs` for the pane and tree): a workspace edit with an edit that `needsConfirmation`, from `workspace.applyEdit` or a file participant's Show Preview, makes the host ask the workbench (`previewWorkspaceEdit`) and wait; the panel shows the `refactorPreview` view with categories (by type) or files (by file, `refactorPreview.groupByFile` in profile storage), checkboxes with upstream's file and category rules, and Apply and Discard. The reply is the checked edits, none on Discard, and `applyEdit` resolves `false` for no edits as bulkEditService.ts does. A second preview asks "Another refactoring is being previewed." Not ported yet: the multi-file diff editor an element opens in (milestone 14; a text file opens a diff of the file against `vscode-bulkeditpreview-editor` instead), the conflict check while the preview is open, tree keyboard navigation. Tests: `cargo test -p app bulk_edit_preview`.- Modal editor group (`workbench/modal_editor_group.rs`, modalEditorPart.ts): `MODAL_GROUP` is a group outside the grid like the panel's (`EditorGroup::ensure_detached_group`; `has_several_groups` counts neither). preferencesService.ts `getEditorGroupFromOptions` sends settings.json and keybindings.json there unless `workbench.editor.useModal` is `off` or extension tests run; the modal draws the group's active editor with its breadcrumbs but without tabs or editor actions (`NoEditorTabsControl`) under a header, while the part keeps showing the group active before it with the file's icon, name and folder and the Open Settings (UI) or Open Keyboard Shortcuts action. Escape (`editorFocus && editorPartModal`), a press outside and Close Modal Editor close its editors (dirty ones ask) and the group with them. The Settings and Keyboard Shortcuts editors are editors of the group (preferencesEditorInput.ts resource `vscode-settings:/settingseditor`; keybindingsEditorInput.ts has no resource, the port's is `vscode-settings:/keybindingseditor`): a settings file opens beside them and they show again when it closes, a closed one drops its state, and an editor opened without preserveFocus (a file, an extension) closes the modal (editorGroupFinder.ts `handleModalEditorPart`). Tests: `cargo test -p app modal_editor_group`.-- Side by side editor (`workbench/side_by_side_editor.rs`; sideBySideEditor.ts, sideBySideEditorInput.ts): the group entry is the primary side; the secondary side is the one editor of a group of its own outside the grid and the group list (`EditorGroup.side_by_sides`, entry model id to group), drawn with `swapped_group_body` left of the primary (above it with `workbench.editor.splitInGroupLayout: vertical`, Toggle Layout in the editor title), the `sideBySideEditor.verticalBorder`/`horizontalBorder` line between. A press in the secondary makes its group active, so every editor command edits it; `workbench.action.*` commands (`execute_command`, `leave_side_group_for`) and `leave_panel_group` first give the active group back to the owner, so closing, splitting and moving act on the side by side editor, and the side gets the focus back after them while the side by side editor still shows it (`lastFocusedSide`); Go to Line, Go to Symbol, Quick Open, the Command Palette and Find in Files act on the focused side's code editor (`activeTextEditorControl`) and do not leave it; opening a file in the active group (`open_file_in_active_group`) leaves it; closing the entry closes the secondary group (`remove_input`). `swapped_group_body` draws the really active group as active even when it draws inside another group's swapped body. Split JSON (`useSplitJSON` or `openDefaultSettings`, `doOpenSplitJSON`): settings.json is the primary, `vscode://defaultsettings/{settings,workspaceSettings,resourceSettings}.json` the read-only secondary, its content `DefaultSettings.getContentWithoutMostCommonlyUsed` (`default_settings_content`); the modal header has no description for it (`getDescription`). `workbench.settings.openDefaultKeybindings`: openGlobalKeybindingsFile opens the default keybindings in the active main group and keybindings.json in a group added to its right. The editor title shows Open Settings (UI) on a user settings.json (`_workbench.openUserSettingsEditor`). cargo test -p app split_json open_default_keybindings; ui-pair port/fixtures/ui-pair/m11/split-settings.json with SETTINGS `{"workbench.settings.useSplitJSON": true}` (modal) and with `"workbench.editor.useModal": "off"`: the two sides, the title actions and the breadcrumbs' end as the reference. The sash between the sides (`SideBySideSplits`, sideBySideEditor.ts SplitView): a drag resizes them with each side kept at 220px wide (70px high in the vertical layout, `DEFAULT_EDITOR_MIN_DIMENSIONS`), a double click distributes them again; the ratio is kept per entry in memory (upstream keeps it in the editor's view state). The breadcrumbs' editor type control (workbench/editor_type_picker.rs; breadcrumbsControl.ts `_createEditorTypeControl`, editorTypePicker.ts): the current editor's label and a chevron at the breadcrumbs' end while the resource has more than one editor (`getAvailableEditorTypes` over `resource_editors`: the text editor, contributed custom editors by rank, the split settings editor first for `**/settings.json` while split JSON is on, minus hidden and unconfigured universal option editors); its menu reopens with each editor (Alt: open to the side), and Set Default for the glob. The EditSettingRenderer pencil (workbench/preferences/edit_setting.rs): in a user, workspace or folder settings file, the `edit` codicon in the glyph margin on the value line of the cursor's or, after a 75 ms pause, the pointer's boolean or enum setting; the pointer on it highlights the setting's lines, a press lists the values (a submenu per setting when several share the line), the value is written into the model, saved, selected, and the setting highlighted while the selection stays. The breadcrumbs of a path outside the workspace start below the user home as `~`, else below the root (`_initFilePathInfo`), and items have no gaps besides the file icon's 6px (the 16px before every item was wrong inside the workspace too). The breakpoint hint shows only where breakpoints can be set (`canSetBreakpointsIn`: never jsonc). cargo test -p app preferences editor_type_picker side_by_side; ui-pair port/fixtures/ui-pair/m11/split-settings-edit.json with SETTINGS `{"workbench.settings.useSplitJSON": true, "workbench.editor.useModal": "off"}` (port/results/layout.md Split settings editor). The pencil's glyph margin hover "Edit" (`edit_setting_glyph_hover`, glyphHoverWidget.ts placement: right of the glyph margin, top on the line, 13px, after `editor.hover.delay`) matches the reference within 1px; in this fixture the port misses the pointer's first move after the menu's Escape, a second move shows it (GlyphHoverWidget for other glyphs is not ported). The breadcrumbs' `…` item shows with Outline collapsed after the merge of port-integrate. Not equal: editors without breadcrumbs (custom editors, media previews) have no editor type control (diff editors: session m12f); a copied or reopened side by side editor opens as its primary text editor; the host sees only the primary side as a visible text editor.+- Side by side editor (`workbench/side_by_side_editor.rs`; sideBySideEditor.ts, sideBySideEditorInput.ts): the group entry is the primary side; the secondary side is the one editor of a group of its own outside the grid and the group list (`EditorGroup.side_by_sides`, entry model id to group), drawn with `swapped_group_body` left of the primary (above it with `workbench.editor.splitInGroupLayout: vertical`, Toggle Layout in the editor title), the `sideBySideEditor.verticalBorder`/`horizontalBorder` line between. A press in the secondary makes its group active, so every editor command edits it; `workbench.action.*` commands (`execute_command`, `leave_side_group_for`) and `leave_panel_group` first give the active group back to the owner, so closing, splitting and moving act on the side by side editor, and the side gets the focus back after them while the side by side editor still shows it (`lastFocusedSide`); Go to Line, Go to Symbol, Quick Open, the Command Palette and Find in Files act on the focused side's code editor (`activeTextEditorControl`) and do not leave it; opening a file in the active group (`open_file_in_active_group`) leaves it; closing the entry closes the secondary group (`remove_input`). `swapped_group_body` draws the really active group as active even when it draws inside another group's swapped body. Split JSON (`useSplitJSON` or `openDefaultSettings`, `doOpenSplitJSON`): settings.json is the primary, `vscode://defaultsettings/{settings,workspaceSettings,resourceSettings}.json` the read-only secondary, its content `DefaultSettings.getContentWithoutMostCommonlyUsed` (`default_settings_content`); the modal header has no description for it (`getDescription`). `workbench.settings.openDefaultKeybindings`: openGlobalKeybindingsFile opens the default keybindings in the active main group and keybindings.json in a group added to its right. The editor title shows Open Settings (UI) on a user settings.json (`_workbench.openUserSettingsEditor`). cargo test -p app split_json open_default_keybindings; ui-pair port/fixtures/ui-pair/m11/split-settings.json with SETTINGS `{"workbench.settings.useSplitJSON": true}` (modal) and with `"workbench.editor.useModal": "off"`: the two sides, the title actions and the breadcrumbs' end as the reference. The sash between the sides (`SideBySideSplits`, sideBySideEditor.ts SplitView): a drag resizes them with each side kept at 220px wide (70px high in the vertical layout, `DEFAULT_EDITOR_MIN_DIMENSIONS`), a double click distributes them again; the ratio is kept per entry in memory (upstream keeps it in the editor's view state). The breadcrumbs' editor type control (workbench/editor_type_picker.rs; breadcrumbsControl.ts `_createEditorTypeControl`, editorTypePicker.ts): the current editor's label and a chevron at the breadcrumbs' end while the resource has more than one editor (`getAvailableEditorTypes` over `resource_editors`: the text editor, contributed custom editors by rank, the split settings editor first for `**/settings.json` while split JSON is on, minus hidden and unconfigured universal option editors); its menu reopens with each editor (Alt: open to the side), and Set Default for the glob. The EditSettingRenderer pencil (workbench/preferences/edit_setting.rs): in a user, workspace or folder settings file, the `edit` codicon in the glyph margin on the value line of the cursor's or, after a 75 ms pause, the pointer's boolean or enum setting; the pointer on it highlights the setting's lines, a press lists the values (a submenu per setting when several share the line), the value is written into the model, saved, selected, and the setting highlighted while the selection stays. The breadcrumbs of a path outside the workspace start below the user home as `~`, else below the root (`_initFilePathInfo`), and items have no gaps besides the file icon's 6px (the 16px before every item was wrong inside the workspace too). The breakpoint hint shows only where breakpoints can be set (`canSetBreakpointsIn`: never jsonc). cargo test -p app preferences editor_type_picker side_by_side; ui-pair port/fixtures/ui-pair/m11/split-settings-edit.json with SETTINGS `{"workbench.settings.useSplitJSON": true, "workbench.editor.useModal": "off"}` (port/results/layout.md Split settings editor). The pencil's glyph margin hover "Edit" (`edit_setting_glyph_hover`, glyphHoverWidget.ts placement: right of the glyph margin, top on the line, 13px, after `editor.hover.delay`) matches the reference within 1px; in this fixture the port misses the pointer's first move after the menu's Escape, a second move shows it (GlyphHoverWidget for other glyphs is not ported). The breadcrumbs' `…` item shows with Outline collapsed after the merge of port-integrate. Media previews and custom editors have breadcrumbs and with them the editor type control (ui-pair m11/editor-type-image.json: "Image Preview" as the reference). Split Editor copies a side by side editor with its secondary side (`EditorGroup::copy_side_by_side`); Reopen Closed Editor reopens both sides as a plain SideBySideEditorInput (`toUntyped`), whose editor type is the text editor, so its breadcrumbs say "Text Editor" where the split settings editor's say "Split Settings Editor" (ui-pair m11/split-settings-copy.json). The host sees the secondary side as a visible text editor without a column (mainThreadDocumentsAndEditors.ts `_updateState` lists every code editor; `SideBySideEditor.getControl` is the primary's), also while the secondary side's group is active.- Handoff, milestone 11 layout list after the Refactor Preview, modal group and editorpart.state commits: (1) split JSON settings editor and `openDefaultKeybindings` (above); (2) auxiliary windows (platform/auxiliaryWindow, workbench/services/auxiliaryWindow) and editor drag and drop between windows (platform/dnd): GPUI opens more windows, but the workbench is one entity per window, so an editor part per auxiliary window needs the groups' models shared across windows first; (3) the SCM Changes header waits for milestone 14's Graph view; (4) references-view's Shift+Alt+H call hierarchy is not pixel-checked; (5) the Problems view's row focus and selection, and the badge's `small` rule.- Part positions (`workbench/layout.rs`, layout.ts `arrangeMiddleSectionNodes`/`arrangeEditorNodes`, layoutService.ts floating margins): the grid is a tree of split views (row, column, row) built for the side bar's side, the panel's position and its alignment; moving a part builds it again from the parts' sizes and visibility, as `adjustPartPositions` and `setPanelPosition` move views. `Grid::bounds` places each visible part; `card_margins` gives each card the gap on its leading edge, the outer gutter on the window's sides and bottom, and joins the side bar to the activity bar (left or right); a right rail with no side bar takes the extra 4px leading gap (`needsFloatingLeadingGap`). State: `workbench.sideBar.location` (setting, `workbench.action.moveSideBarLeft`/`Right`/`toggleSidebarPosition`), `workbench.panel.position` (workspace, a `Position` number, default from `workbench.panel.defaultLocation`), `workbench.panel.alignment` (profile), `panel.lastNonMaximizedWidth`/`Height` (profile, 300), `panel.wasLastMaximized` and `editor.hidden` (workspace) with `workbench.panel.opensMaximized`. Commands `workbench.action.positionPanel{Top,Left,Right,Bottom}` and `alignPanel{Left,Right,Center,Justify}`, View > Appearance > Panel Position and Align Panel, context keys `panelPosition`, `panelAlignment`, `mainEditorAreaVisible`. Maximize needs a centered or side panel (`panelMaximizationSupportedWhen`, the warning otherwise). Tests: `cargo test -p app -- layout part_grid`.- Modern UI (contrib/modernUI): the classic layout with `workbench.experimental.modernUI: false` is removed by Artur's decision; the port has the modern layout only and reads the setting only where a part's metrics depend on it (the terminal's scrollbar) and for the Layout Density menu's `when`. Layout density (`window.density.layout`; layoutService.ts `isModernUICompact`, layoutDensityActions.ts, modernUI.contribution.ts): `workbench.action.setLayoutDensity.default`/`.compact` write the setting, the Manage menu's Layout Density submenu (group `2_configuration`, order 8, while the modern UI is on) checks the current one. Compact (`Workbench::compact_density`): the cards lose their margins and radii (floatingPanels.css, editorBorder.css), keep a transparent 1px border and paint 1px strokes on their right and bottom edges (`compact_card_strokes`: `surface.border` for the side bars, `modernPanel.border` for the panel, `editor.border` for the editor, `modernActivityBar.border` for the rail with its top edge, and its left edge on the left or after the side bar; a left edge also on any part at the window's left edge); the editor has no left border unless it meets the window's left edge; the rail is 40px (`COMPACT_ACTIVITY_BAR_WIDTH`, lane 4px, item gap 4px) and never takes the right rail's leading gap; the sashes are splitview's own, centered on the seams, without grips and with the full-length highlight; the status bar is 26px with 8px padding, 2px label margins and 4px label padding, 24px edge items; pane list rows sit 2px in from the edges. Tests: `cargo test -p app -- compact_density layout_density`. The Customize Layout quick pick lists the densities too (see Manage menu and Customize Layout below). Not ported: the toasts and the notification center keep their fixed insets (notificationsDialogs.css), as upstream does in both densities; `.has-background-color` and `visible-background-color-neighbor` status item margins are not ported in either density.