Skip to content

Visual Studio Code, rebuilt in Rust

Rust

perf(workbench): draw the side bar as a cached part view

rokartur23a359fe3db0
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index 380af56f2fe..7f47c429900 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -141,6 +141,7 @@ pub(crate) use notebooks::notebook_cells;
mod notifications_view;
mod panel;
mod part_grid;
+mod part_view;
mod zen_mode;
mod activity;
mod centered_layout;
@@ -544,6 +545,7 @@ pub struct Workbench {
pub(crate) user_data_profiles: user_data_profile::UserDataProfiles,
icon_select: icon_select_box::IconSelect,
part_grid: part_grid::PartGrid,
+ part_views: HashMap<layout::Part, gpui::Entity<part_view::PartView>>,
zen_mode: zen_mode::ZenMode,
activities: activity::Activities,
centered_layout: centered_layout::CenteredLayout,
@@ -597,7 +599,7 @@ pub struct Workbench {
impl Render for Workbench {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
// Cursors move and editors switch on many paths; every one of them renders.
- self.hovers.forget_painted_targets();
+ self.forget_painted_hover_targets();
self.close_editor_message_on_cursor_change(cx);
self.stop_inspect_tokens_on_model_change();
self.follow_inspect_tokens_cursor(cx);
@@ -901,6 +903,7 @@ impl Workbench {
user_data_profiles: Default::default(),
icon_select: Default::default(),
part_grid: part_grid::PartGrid::default(),
+ part_views: HashMap::new(),
zen_mode: Default::default(),
activities: Default::default(),
centered_layout: Default::default(),
diff --git a/native/crates/app/src/workbench/hover.rs b/native/crates/app/src/workbench/hover.rs
index 4ff8e864ddf..e7dc98ff3d7 100644
--- a/native/crates/app/src/workbench/hover.rs
+++ b/native/crates/app/src/workbench/hover.rs
@@ -8,7 +8,7 @@ use std::rc::Rc;
use std::time::{Duration, Instant};
use gpui::{
- Animation, AnimationExt, AnyElement, AnyView, App, Bounds, BoxShadow, Context, DispatchPhase, ElementId, FocusHandle, HitboxBehavior, MouseDownEvent, MouseMoveEvent, PathBuilder, Pixels, Point, Size, Task,
+ Animation, AnimationExt, AnyElement, AnyView, App, Bounds, BoxShadow, Context, DispatchPhase, ElementId, EntityId, FocusHandle, HitboxBehavior, MouseDownEvent, MouseMoveEvent, PathBuilder, Pixels, Point, Size, Task,
Rgba, TextRun, Window, canvas, div, point, prelude::*, px, rgba,
};
use serde_json::Value;
@@ -198,8 +198,8 @@ pub struct Hovers {
mouse_in_hover: bool,
/// hoverService.ts `_lastHoverOptions`.
last: Option<HoverTarget>,
- /// The targets the last frame painted, for `_showAndFocusHoverForActiveElement`.
- painted: Rc<RefCell<HashMap<ElementId, HoverTarget>>>,
+ /// The targets the last frame painted and the view each was painted in, for `_showAndFocusHoverForActiveElement`.
+ painted: Rc<RefCell<HashMap<ElementId, (EntityId, HoverTarget)>>>,
}
impl Hovers {
@@ -227,9 +227,10 @@ impl Hovers {
self.shown.as_ref().is_some_and(|shown| shown.target.options.sticky || !shown.target.options.hide_on_key_down)
}
- /// Called as the workbench renders: the frame about to paint records its targets again.
- pub fn forget_painted_targets(&self) {
- self.painted.borrow_mut().clear();
+ /// Called as a view renders: the frame about to paint records the targets of the views `redrawn` takes again; a
+ /// cached part view that is not drawn again keeps its own.
+ pub fn forget_painted_targets(&self, redrawn: impl Fn(EntityId) -> bool) {
+ self.painted.borrow_mut().retain(|_, (painted_in, _)| !redrawn(*painted_in));
}
}
@@ -249,7 +250,7 @@ impl Workbench {
move |bounds, hitbox, window, _| {
let bounds = placed_at.as_ref().and_then(|placed_at| placed_at.get()).unwrap_or(bounds);
let target = HoverTarget { id: id.clone(), content: content.clone(), options, bounds, mouse_x: None };
- painted.borrow_mut().insert(id.clone(), target.clone());
+ painted.borrow_mut().insert(id.clone(), (window.current_view(), target.clone()));
let pressed = hitbox.clone();
// Capture phase, as the reference's listeners: a target's own handlers may stop the event.
window.on_mouse_event(move |event: &MouseMoveEvent, phase, window, cx| {
@@ -412,7 +413,7 @@ impl Workbench {
return;
}
let Some((id, managed)) = self.focused_hover_target(window) else { return };
- let Some(target) = self.hovers.painted.borrow().get(&id).cloned() else { return };
+ let Some((_, target)) = self.hovers.painted.borrow().get(&id).cloned() else { return };
if !managed && self.hovers.shown.as_ref().is_some_and(|shown| shown.target.id == id) {
return;
}
@@ -433,13 +434,13 @@ impl Workbench {
}
pub(super) fn painted_hover_bounds(&self, id: &ElementId) -> Option<Bounds<Pixels>> {
- self.hovers.painted.borrow().get(id).map(|target| target.bounds)
+ self.hovers.painted.borrow().get(id).map(|(_, target)| target.bounds)
}
/// The target the last frame painted inside `bounds`, the focused item's: the item's hover.
pub(super) fn painted_hover_within(&self, bounds: Bounds<Pixels>) -> Option<ElementId> {
let painted = self.hovers.painted.borrow();
- painted.values().find(|target| bounds.contains(&target.bounds.center())).map(|target| target.id.clone())
+ painted.values().find(|(_, target)| bounds.contains(&target.bounds.center())).map(|(_, target)| target.id.clone())
}
/// The focused element's hover target and whether it is a managed hover. Only these targets take the focus
diff --git a/native/crates/app/src/workbench/list_scroll.rs b/native/crates/app/src/workbench/list_scroll.rs
index 36c4862aeda..15a9fd5a7c2 100644
--- a/native/crates/app/src/workbench/list_scroll.rs
+++ b/native/crates/app/src/workbench/list_scroll.rs
@@ -9,7 +9,7 @@ use std::collections::HashMap;
use std::time::{Duration, Instant};
use gpui::{
- Axis, Bounds, Context, DispatchPhase, Hitbox, HitboxBehavior, IntoElement, ListState, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent,
+ App, Axis, Bounds, Context, DispatchPhase, EntityId, Hitbox, HitboxBehavior, IntoElement, ListState, MouseButton, MouseDownEvent, MouseMoveEvent, MouseUpEvent,
Pixels, Point, Rgba, ScrollDelta, ScrollHandle, ScrollWheelEvent, Styled, Task, Window, canvas, div, fill, point, prelude::*, px, size,
};
use serde_json::{Value, json};
@@ -109,6 +109,8 @@ pub struct ListScroll {
animation: Option<Task<()>>,
/// When the pointer last entered or left the list.
hover_changed: Option<Instant>,
+ /// The view the list was last painted in, which a scroll alone redraws (part_view.rs).
+ view: Option<EntityId>,
}
#[derive(Clone, Copy)]
@@ -232,14 +234,21 @@ impl Workbench {
workbench.update(cx, |workbench, cx| workbench.hide_list_scrollbars(list, cx)).ok();
}));
}
- cx.notify();
+ self.notify_list_view(list, cx);
}
fn hide_list_scrollbars(&mut self, list: ListId, cx: &mut Context<Self>) {
let scroll = self.list_scroll(list);
if !scroll.bars.mouse_over && scroll.drag.is_none() {
scroll.bars.set_shown(false, Instant::now());
- cx.notify();
+ self.notify_list_view(list, cx);
+ }
+ }
+
+ fn notify_list_view(&mut self, list: ListId, cx: &mut Context<Self>) {
+ match self.list_scroll(list).view {
+ Some(view) => App::notify(cx, view),
+ None => cx.notify(),
}
}
@@ -419,7 +428,9 @@ impl Workbench {
}
(list_hitbox, tracks)
},
- move |_, (list_hitbox, tracks), window, _| {
+ move |_, (list_hitbox, tracks), window, cx| {
+ let view = window.current_view();
+ workbench.update(cx, |workbench, _| workbench.list_scroll(list).view = Some(view));
let mut sliders = Vec::new();
for (hitbox, track, axis, bar) in &tracks {
// multieditortabscontrol.css: the tabs' scrollbar is `cursor: default` in the pointer strip.
diff --git a/native/crates/app/src/workbench/part_grid.rs b/native/crates/app/src/workbench/part_grid.rs
index b14ff9e7620..a862b40021c 100644
--- a/native/crates/app/src/workbench/part_grid.rs
+++ b/native/crates/app/src/workbench/part_grid.rs
@@ -515,14 +515,11 @@ impl Workbench {
for &(part, rect) in &parts {
let [left, top, right, bottom] = if compact { [0.; 4] } else { card_margins(part, rect, &parts, arrangement, width, height, false) };
let content = match part {
- Part::ActivityBar => self.activity_bar(window, cx),
- Part::SideBar => {
- self.prepare_moved_view_panes(window, cx);
- self.side_bar(window, cx)
- }
- Part::Editor => editor.take().expect("one editor part"),
- Part::Panel => self.panel_part(window, cx),
- Part::AuxiliaryBar => self.auxiliary_bar_part(window, cx),
+ Part::ActivityBar => self.activity_bar(window, cx).into_any_element(),
+ Part::SideBar => self.part_view(Part::SideBar, cx),
+ Part::Editor => editor.take().expect("one editor part").into_any_element(),
+ Part::Panel => self.panel_part(window, cx).into_any_element(),
+ Part::AuxiliaryBar => self.auxiliary_bar_part(window, cx).into_any_element(),
};
let [x, y, w, h] = rect;
section = section.child(div().absolute().left(px(x)).top(px(y)).w(px(w)).h(px(h)).flex().pl(px(left)).pt(px(top)).pr(px(right)).pb(px(bottom)).child(content));
diff --git a/native/crates/app/src/workbench/part_view.rs b/native/crates/app/src/workbench/part_view.rs
new file mode 100644
index 00000000000..9f347979269
--- /dev/null
+++ b/native/crates/app/src/workbench/part_view.rs
@@ -0,0 +1,64 @@
+//! A workbench part drawn as its own cached view (upstream's parts are DOM subtrees the browser lays out apart):
+//! the part's state stays in the Workbench, which the view draws; a notify of the Workbench redraws every part, a
+//! notify of the part view (a scroll in it) redraws that part and reuses the other cached parts.
+
+use gpui::{AnyElement, AnyView, AppContext, Context, EntityId, IntoElement, ParentElement, Render, StyleRefinement, Styled, Subscription, WeakEntity, Window, div};
+
+use super::Workbench;
+use super::layout::Part;
+
+#[cfg(test)]
+mod tests;
+
+pub(super) struct PartView {
+ part: Part,
+ workbench: WeakEntity<Workbench>,
+ pub(super) renders: usize,
+ _workbench_changed: Subscription,
+}
+
+impl Render for PartView {
+ fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
+ self.renders += 1;
+ let part = self.part;
+ let content = self.workbench.update(cx, |workbench, cx| workbench.part_content(part, window, cx)).expect("the workbench draws its parts");
+ div().size_full().flex().child(content)
+ }
+}
+
+impl Workbench {
+ /// The cached view of `part`, made on its first draw.
+ pub(super) fn part_view(&mut self, part: Part, cx: &mut Context<Self>) -> AnyElement {
+ let workbench = cx.entity();
+ let view = self.part_views.entry(part).or_insert_with(|| {
+ cx.new(|cx| PartView { part, workbench: workbench.downgrade(), renders: 0, _workbench_changed: cx.observe(&workbench, |_, _, cx| cx.notify()) })
+ });
+ AnyView::from(view.clone()).cached(StyleRefinement::default().flex_1().min_w_0()).into_any_element()
+ }
+
+ /// The hover targets of every view but the shown part views, which keep theirs while cached.
+ pub(super) fn forget_painted_hover_targets(&self) {
+ let cached: Vec<EntityId> = self.part_views.iter().filter(|(part, _)| self.is_part_visible(**part)).map(|(_, view)| view.entity_id()).collect();
+ self.hovers.forget_painted_targets(|view| !cached.contains(&view));
+ }
+
+ #[cfg(test)]
+ pub(super) fn part_view_entity(&self, part: Part) -> Option<&gpui::Entity<PartView>> {
+ self.part_views.get(&part)
+ }
+
+ fn part_content(&mut self, part: Part, window: &mut Window, cx: &mut Context<Self>) -> gpui::Div {
+ let view = window.current_view();
+ self.hovers.forget_painted_targets(|painted_in| painted_in == view);
+ let content = match part {
+ Part::SideBar => {
+ self.prepare_moved_view_panes(window, cx);
+ self.side_bar(window, cx)
+ }
+ _ => unreachable!("{part:?} is drawn by the workbench"),
+ };
+ // The labels drawn above asked for the decorations they lack.
+ self.send_decoration_requests(cx);
+ content
+ }
+}
diff --git a/native/crates/app/src/workbench/part_view/tests.rs b/native/crates/app/src/workbench/part_view/tests.rs
new file mode 100644
index 00000000000..4eb289d42af
--- /dev/null
+++ b/native/crates/app/src/workbench/part_view/tests.rs
@@ -0,0 +1,83 @@
+use std::cell::Cell;
+use std::path::{Path, PathBuf};
+use std::rc::Rc;
+use std::sync::{Arc, Mutex};
+
+use config::registry::Registry;
+use config::service::Settings;
+use config::workspace::Workspace;
+use exthost::scan::scan_extension;
+use gpui::{Modifiers, ScrollDelta, ScrollWheelEvent, TestAppContext, VisualTestContext, point};
+
+use crate::host_sync::HostSync;
+use crate::languages::Languages;
+use crate::theme::load_theme;
+use crate::workbench::Workbench;
+use crate::workbench::layout::Part;
+use crate::workbench::list_scroll::ListId;
+
+/// A folder of 200 files, expanded in the Explorer.
+fn explorer(cx: &mut TestAppContext) -> (PathBuf, gpui::Entity<Workbench>, &mut VisualTestContext) {
+ let app_root = Path::new(env!("VSCODE_SRC")).to_path_buf();
+ let themes = scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap();
+ let theme = load_theme(&[themes], "Dark Modern").unwrap();
+ let dir = std::env::temp_dir().join(format!("code-gpui-part-view-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir_all(dir.join("User")).unwrap();
+ for index in 0..200 {
+ std::fs::write(dir.join(format!("f{index:03}.txt")), "").unwrap();
+ }
+ let folder = dir.clone();
+ let settings = Arc::new(Mutex::new(Settings::load(Registry::with_extensions(&[]), dir.join("User"), None)));
+ let (workbench, cx) = cx.add_window_view(|_, cx| {
+ let mut workbench = Workbench::new(theme, app_root.clone(), Some(Workspace::folder(folder.clone())), Languages::new(&[]), settings.clone(), HostSync::new(std::sync::mpsc::channel().0), cx);
+ workbench.skip_dialogs = true;
+ workbench
+ });
+ cx.run_until_parked();
+ (dir, workbench, cx)
+}
+
+fn draw(cx: &mut VisualTestContext) {
+ cx.update(|window, cx| drop(window.draw(cx)));
+}
+
+fn side_bar_renders(workbench: &gpui::Entity<Workbench>, cx: &mut VisualTestContext) -> usize {
+ workbench.read_with(cx, |workbench, cx| workbench.part_view_entity(Part::SideBar).expect("the side bar draws").read(cx).renders)
+}
+
+/// A frame with nothing changed reuses the side bar; a change of the workbench draws it again; a scroll of the
+/// Explorer draws the side bar again without notifying the workbench, so the other parts can stay cached.
+#[gpui::test]
+fn the_side_bar_draws_again_on_a_workbench_change_and_its_own_scroll_only(cx: &mut TestAppContext) {
+ let (dir, workbench, cx) = explorer(cx);
+ let notified = Rc::new(Cell::new(0));
+ let _observer = {
+ let notified = notified.clone();
+ cx.update(|_, cx| cx.observe(&workbench, move |_, _| notified.set(notified.get() + 1)))
+ };
+ draw(cx);
+ let renders = side_bar_renders(&workbench, cx);
+ draw(cx);
+ assert_eq!(side_bar_renders(&workbench, cx), renders, "an unchanged frame reuses the side bar");
+
+ workbench.update(cx, |_, cx| cx.notify());
+ cx.run_until_parked();
+ draw(cx);
+ assert!(side_bar_renders(&workbench, cx) > renders, "a workbench change draws the side bar");
+ // The pointer enters the pane first: the hover change notifies the workbench, as upstream's does a CSS repaint.
+ let bounds = workbench.read_with(cx, |workbench, _| workbench.list_scroller(ListId::Explorer).bounds());
+ cx.simulate_mouse_move(bounds.center(), None, Modifiers::none());
+ cx.run_until_parked();
+ draw(cx);
+ cx.run_until_parked();
+
+ let (renders, notifications) = (side_bar_renders(&workbench, cx), notified.get());
+ cx.simulate_event(ScrollWheelEvent { position: bounds.center(), delta: ScrollDelta::Lines(point(0., -1.)), modifiers: Modifiers::none(), ..Default::default() });
+ cx.run_until_parked();
+ draw(cx);
+ assert_eq!(workbench.read_with(cx, |workbench, _| workbench.list_scroller(ListId::Explorer).position().y), 50.);
+ assert!(side_bar_renders(&workbench, cx) > renders, "the scroll draws the side bar");
+ assert_eq!(notified.get(), notifications, "the scroll leaves the workbench unnotified");
+ std::fs::remove_dir_all(dir).unwrap();
+}
diff --git a/port/ledger.md b/port/ledger.md
index f05f75b2776..7cce1440099 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -407,7 +407,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/services/language | workbench service | M7 | verified | | getAssociationByPath with the full glob dialect (languages::tests::file_patterns_take_the_whole_glob_dialect) plus firstLine detection (languages.rs); cargo test -p app languages::tests |
| workbench/services/languageDetection | workbench service | M13 | verified | | language_detection.rs (languageDetectionWebWorker.ts `detectLanguagesImpl`, `adjustLanguageConfidence`, the 10000 char sample) and workbench/language_detection.rs (`LanguageDetectionWorkerClient`: the file name guess first, then @vscode/vscode-languagedetection 1.0.23 with its model in a Bun worker from the app's node_modules, model ids mapped as `getLanguageId`; `autoDetectLanguage` of textEditorModel.ts for untitled models and extensionless plain text files, 600 ms throttle, skipped after an explicit language and with `workbench.editor.languageDetection` off): cargo test -p app language_detection (the worker test runs the real model). The history biases only feed the regexp model, which 1.147.0 does not ship (`vscode-regexp-languagedetection` is not a dependency), so neither side has it; no telemetry |
| workbench/services/languageStatus | workbench service | M13 | verified | | `$setLanguageStatus` / `$removeLanguageStatus`, statuses matched by selector, ordered by severity, source, id (workbench/language_status.rs): cargo test -p app language_status |
-| workbench/services/layout | workbench service | M11 | ported | [3 L] editor_status.rs:606, content_hover.rs:498: no workbench-wide Tab order (the browser's DOM order): Tab stops at the content hover's ends, and Tab on the status bar in Tab Focus Mode keeps the focus (port/notes.md Toggle Tab Key Moves Focus) <br> [3 L] workbench.rs:591: the Workbench is one GPUI view, so every scroll frame of any list renders and lays out every part again, where upstream's DOM updates only the scrolled list; `scroll_frame_time` median / p95 at 42d10fe2347: Explorer 11.5 / 15.7 ms, Editor 18.0 / 19.2 to 42.0 ms, Settings 12.4 / 16.8 ms over the 8 ms gate (Extensions 2.8 / 3.0 meets it); per frame taffy lays out the whole workbench (6.6 ms of the Explorer frame), each `key_context` caller clones every `config.*` key (keyboard.rs:400), the menubar and the timeline toolbar are rebuilt; the next step is the part-entity split, side bar first (port/notes.md Scroll frame costs, cheap steps). GUI (Studio at load 33 to 57, 60 Hz display, 690 trackpad events in 7 s): main thread in `Window::draw` 86% scrolling the Explorer (800 files), 89% the Extensions @builtin list (port/notes.md Scroll frame costs) | layout.ts as a split-view tree (workbench/layout.rs): panel position (bottom, top, left, right) and alignment, primary side bar left or right, maximized panel with `panelMaximizationSupportedWhen`, hidden parts, persisted sizes and positions; zen mode (zen_mode.rs) with its settings and restore; centered layout (centered_layout.rs) with its sashes and stored margins; View > Appearance entries and the Panel Position and Align Panel submenus (cargo test -p app -- layout part_grid centered_layout zen_mode); layoutActions.ts Customize Layout quick pick (workbench/customize_layout.rs) with live items, Restore Defaults and Close, Toggle Activity Bar Visibility, Align Quick Input Top/Center (cargo test -p app -- customize_layout toggling_the_activity_bar; ui-pair m11/manage-menu.json, port/results/manage-menu.md; missing until then though the title bar showed its button); ui-pair layout-positions.json and layout-zen.json against the reference (port/results/layout.md). The pairs run with `zenMode.fullScreen` off. Maximize Secondary Side Bar (`workbench.action.maximizeAuxiliaryBar`, `restoreAuxiliaryBar`, `toggleMaximizedAuxiliaryBar`, the title's toggle) hides the other parts and restores them (workbench/panel.rs; cargo test -p app -- maximizing_the_secondary_side_bar_hides_the_other_parts_and_restore_brings_them_back). Zen mode enforces `zenMode.showTabs` on the main editor part until it ends (layout.ts `toggleZenMode` `enforcePartOptions`; workbench/zen_mode.rs `editor_show_tabs`; cargo test -p app -- show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own); navigationActions.ts `workbench.action.focusNextPart`/`focusPreviousPart` (F6, Shift+F6) walk editor, panel, auxiliary bar, status bar, activity bar and side bar past the hidden ones with layout.ts `focusPart` (the pane container's first expanded view; workbench/part_navigation.rs; cargo test -p app f6_walks_the_visible_parts); in an editor window F6 goes between its editor and its own status bar, whose entry focus is kept per window (workbench/auxiliary_windows.rs `auxiliary_status_bar`, workbench/status_entries.rs; cargo test -p app f6_in_an_editor_window_reaches_its_own_status_bar) |
+| workbench/services/layout | workbench service | M11 | ported | [3 L] editor_status.rs:606, content_hover.rs:498: no workbench-wide Tab order (the browser's DOM order): Tab stops at the content hover's ends, and Tab on the status bar in Tab Focus Mode keeps the focus (port/notes.md Toggle Tab Key Moves Focus) <br> [3 L] workbench.rs:591: the Workbench is one GPUI view, so every scroll frame of any list renders and lays out every part again, where upstream's DOM updates only the scrolled list; the side bar is a cached part view (part_view.rs: a list scroll notifies only the view it was painted in), the other parts still render with the Workbench, which GPUI renders whole every frame; `scroll_frame_time` median / p95 with the side bar cached: Explorer 11.1 / 15.1 ms, Editor 8.6 / 10.1 ms, Settings 2.1 / 2.5 ms (Extensions 2.7 / 3.3 meets it); each `key_context` caller clones every `config.*` key (keyboard.rs:400), the menubar and the timeline toolbar are rebuilt; the next steps are the editor area, panel, status bar, activity bar and title bar part views (port/notes.md Scroll frame costs, cheap steps). GUI (Studio at load 33 to 57, 60 Hz display, 690 trackpad events in 7 s): main thread in `Window::draw` 86% scrolling the Explorer (800 files), 89% the Extensions @builtin list (port/notes.md Scroll frame costs) | layout.ts as a split-view tree (workbench/layout.rs): panel position (bottom, top, left, right) and alignment, primary side bar left or right, maximized panel with `panelMaximizationSupportedWhen`, hidden parts, persisted sizes and positions; zen mode (zen_mode.rs) with its settings and restore; centered layout (centered_layout.rs) with its sashes and stored margins; View > Appearance entries and the Panel Position and Align Panel submenus (cargo test -p app -- layout part_grid centered_layout zen_mode); layoutActions.ts Customize Layout quick pick (workbench/customize_layout.rs) with live items, Restore Defaults and Close, Toggle Activity Bar Visibility, Align Quick Input Top/Center (cargo test -p app -- customize_layout toggling_the_activity_bar; ui-pair m11/manage-menu.json, port/results/manage-menu.md; missing until then though the title bar showed its button); ui-pair layout-positions.json and layout-zen.json against the reference (port/results/layout.md). The pairs run with `zenMode.fullScreen` off. Maximize Secondary Side Bar (`workbench.action.maximizeAuxiliaryBar`, `restoreAuxiliaryBar`, `toggleMaximizedAuxiliaryBar`, the title's toggle) hides the other parts and restores them (workbench/panel.rs; cargo test -p app -- maximizing_the_secondary_side_bar_hides_the_other_parts_and_restore_brings_them_back). Zen mode enforces `zenMode.showTabs` on the main editor part until it ends (layout.ts `toggleZenMode` `enforcePartOptions`; workbench/zen_mode.rs `editor_show_tabs`; cargo test -p app -- show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own); navigationActions.ts `workbench.action.focusNextPart`/`focusPreviousPart` (F6, Shift+F6) walk editor, panel, auxiliary bar, status bar, activity bar and side bar past the hidden ones with layout.ts `focusPart` (the pane container's first expanded view; workbench/part_navigation.rs; cargo test -p app f6_walks_the_visible_parts); in an editor window F6 goes between its editor and its own status bar, whose entry focus is kept per window (workbench/auxiliary_windows.rs `auxiliary_status_bar`, workbench/status_entries.rs; cargo test -p app f6_in_an_editor_window_reaches_its_own_status_bar) |
| workbench/services/lifecycle | workbench service | M11 | ported | [3 L] unattendedRestart.ts: the participants terminalUnattendedRestart.ts, testingUnattendedRestart.ts, webviewUnattendedRestart.ts, notebookUnattendedRestart.ts and testingContinuousRunService.ts `testing.continuousRun` are not ported (the port's terminal has no `hasChildProcesses`), the editor detail names the scheme where upstream names `typeId`, `workbench.floatingWindowNotRestorable` cannot occur (the port's auxiliary windows are all editor parts), and nothing calls `can_restart_unattended` yet: platform/update's `UnattendedRestartScheduler` (restart to update while the screen is locked, with `update.restartWhenIdle` on), `quitAndInstall` with `unattended` and windowsStateHandler.ts `setNextExactRestore` are not ported | workbench/lifecycle.rs: ShutdownReason, onBeforeShutdown vetoes on quit, close button, closeWindow, reload and load (`window.confirmBeforeClose`, backup tracker auto save, hot exit, showSaveConfirm); cargo test -p app lifecycle; no phases or onWillShutdown joiners; workbench/unattended_restart.rs: `canRestartUnattended` with its blocker aggregation and change log, and the participants `workbench.starting` (2.5 s after restore), dialog, quick input, transient workspace, modal editor, editors not restored or not restorable, `debug.sessionActive`, `tasks.running`, the backup tracker's `workingCopy.*` and `cli.waitingForEditorClose`: cargo test -p app unattended_restart (unattendedRestart.test.ts); verified: cargo test -p app backup_tracker lifecycle (workingCopyBackupTracker.test.ts); ui-pair hot-exit.json `dirty`, `restored` vs the reference (port/results/windows.md, milestone 11 verification) |
| workbench/services/localTranscription | workbench service | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert |
| workbench/services/localization | workbench service | M18 | verified | | ui-pair port/fixtures/extensions/ui-display-language.json: picking Deutsch installs MS-CEINTL.vscode-language-pack-de with the "Installing Deutsch language support..." progress and asks "Restart VSRustium to switch to Deutsch?"; localeService.ts: argv.json `locale` written and cleared, restart dialog, install of an MS-CEINTL pack: cargo test -p app nls localization; Command Palette titles, categories and descriptions translate by the reference call's module and key (port/tools/ref-commands with ref-nls-clone.ts; cargo test -p app a_palette_title_two_modules), menu bar items, side bar titles and pane headers by the reference's `nlsKeys` per menu, view and container (cargo test -p app menu_bar_items_and_view_titles_resolve_per_scope); other surfaces stay English (port/notes.md) |
@@ -520,7 +520,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/output | workbench contribution | M15 | verified | | Open Output in Editor and Open Log... open the channel's `output:` resource pinned in a read-only text editor of the editor groups, sharing the Output view's model and following the channel (cargo test -p app open_output_in_editor_shows_the_channel_in_an_editor_group); output/compound.rs and workbench/output_compound.rs (Add Compound Log..., Remove Output..., entries merged by timestamp); output_view.rs and output_actions.rs: read-only Output view with the channel dropdown, filter box with level and category menus, Clear Output, Toggle Auto Scrolling, log level gear, Open Output in Editor, Show Output Channels, `workbench.action.output.show.<id>`, Cmd+Shift+U toggle, the Window and Extension Host channels; the view is a panel view whose editor sits in the hidden panel group since milestone 11 (cargo test -p app toggle_output_opens_and_closes_the_view); a quiet reveal offers the channel in the status bar (cargo test -p app a_quiet_reveal_offers_the_channel_in_the_status_bar); the title's "..." with Save Output As..., Export Logs... (picker or `outputChannelIds`/`outputPath`), Add Compound Log... and Import Log... (cargo test -p app logs_export_to_a_file_and_import_as_a_channel); links through milestone 13's link contribution (output/links.rs `compute_links`, cargo test -p app output_paths_in_the_workspace_are_links compute_links); the filters hide lines as the editor's hidden areas, the model keeps every line, include pattern matches are find match decorations (cargo test -p app filters_hide_log_entries filters_hide_entries_and_lines): cargo test -p app output |
| workbench/contrib/performance | workbench contribution | M19 | verified | | Developer: Startup Performance (perf_view.rs, perfviewEditor.ts): System Info, Performance Marks from the timer service, Extension Activation Stats, Raw Perf Marks of the renderer and localExtHost; inputLatencyContrib, startupTimings and the auto profilers only report telemetry or take V8 profiles (no telemetry by decision, platform/profiling n/a); cargo test -p app timer:: perf_view; System Info takes the CPU speed and VM likelihood as Node's `os` reports them and no process memory, which 1.147 turns off (cargo test -p app the_system_info_lists apple_silicon_reports_libuvs_fallback_cpu_speed) |
| workbench/contrib/policyExport | workbench contribution | M10 | removed | | build tool: `--export-policy-data` writes the policy definitions that upstream's build turns into ADMX and macOS profiles; the port ships no policy templates |
-| workbench/contrib/preferences | workbench contribution | M10 | verified | | A policy-managed setting disables its select, input box, checkbox and array and include/exclude lists, and its indicator's hover runs View policy settings (`@hasPolicy`): cargo test -p app a_policy_setting_disables_its_select_and_its_hover_applies_the_policy_filter. The `@lang:` filter shows the language block's value (settingsTreeModels.ts `inspectSetting`): cargo test -p app the_lang_filter_shows_the_language_block_value; setting descriptions as markdown (paragraphs, emphasis, lists, code, setting links): cargo test -p app descriptions_render_emphasis_lists_and_setting_links; ui-pair against the reference in port/results/settings-editor.md; keybindingsEditor.ts, keybindingWidgets.ts and the keybindings actions of preferences.contribution.ts ported as workbench/keybindings_editor_view.rs (cargo test -p app keybindings_editor_view, port/results/keybindings-editor.md; a contributing extension's name opens it: cargo test -p app an_extension_source_opens_the_extension); keybindingsEditorContribution.ts and smartSnippetInserter.ts ported as workbench/define_keybinding.rs and smart_snippet_inserter.rs (cargo test -p app define_keybinding smart_snippet_inserter, raw/keybindings-editor/define-file-*.png); settingsEditor2.ts, settingsTree.ts, settingsTreeModels.ts, settingsLayout.ts, tocTree.ts, preferencesSearch.ts (local search), settingsSearchMenu.ts, settingsEditorSettingIndicators.ts and the settings targets widget ported as settings_editor.rs and workbench/settings_editor_view.rs (cargo test -p app settings_editor); settingsWidgets.ts list and object widgets, the search suggest widget, search history and the TOC sash ported (cargo test -p app settings_editor); preferencesRenderers.ts UnsupportedSettingsRenderer ported as workbench/preferences/unsupported_settings.rs, with the untrusted-workspace warning and its Manage Workspace Trust quick fix (cargo test -p app preferences unsupported_settings); keyboardLayoutPicker.ts n/a (web only); the marks' messages in the editor hover: cargo test -p app the_editor_hover_shows_the_message_of_a_marked_key |
+| workbench/contrib/preferences | workbench contribution | M10 | verified | [1 S] settings_editor_view/tests.rs:20: the tests share one temp folder per process and each removes it, so a_solid_cursor_blinking_keeps_the_search_caret failed once in a parallel run of `cargo test -p app -- workbench::` (passes alone and on a rerun) | A policy-managed setting disables its select, input box, checkbox and array and include/exclude lists, and its indicator's hover runs View policy settings (`@hasPolicy`): cargo test -p app a_policy_setting_disables_its_select_and_its_hover_applies_the_policy_filter. The `@lang:` filter shows the language block's value (settingsTreeModels.ts `inspectSetting`): cargo test -p app the_lang_filter_shows_the_language_block_value; setting descriptions as markdown (paragraphs, emphasis, lists, code, setting links): cargo test -p app descriptions_render_emphasis_lists_and_setting_links; ui-pair against the reference in port/results/settings-editor.md; keybindingsEditor.ts, keybindingWidgets.ts and the keybindings actions of preferences.contribution.ts ported as workbench/keybindings_editor_view.rs (cargo test -p app keybindings_editor_view, port/results/keybindings-editor.md; a contributing extension's name opens it: cargo test -p app an_extension_source_opens_the_extension); keybindingsEditorContribution.ts and smartSnippetInserter.ts ported as workbench/define_keybinding.rs and smart_snippet_inserter.rs (cargo test -p app define_keybinding smart_snippet_inserter, raw/keybindings-editor/define-file-*.png); settingsEditor2.ts, settingsTree.ts, settingsTreeModels.ts, settingsLayout.ts, tocTree.ts, preferencesSearch.ts (local search), settingsSearchMenu.ts, settingsEditorSettingIndicators.ts and the settings targets widget ported as settings_editor.rs and workbench/settings_editor_view.rs (cargo test -p app settings_editor); settingsWidgets.ts list and object widgets, the search suggest widget, search history and the TOC sash ported (cargo test -p app settings_editor); preferencesRenderers.ts UnsupportedSettingsRenderer ported as workbench/preferences/unsupported_settings.rs, with the untrusted-workspace warning and its Manage Workspace Trust quick fix (cargo test -p app preferences unsupported_settings); keyboardLayoutPicker.ts n/a (web only); the marks' messages in the editor hover: cargo test -p app the_editor_hover_shows_the_message_of_a_marked_key |
| workbench/contrib/processExplorer | workbench contribution | M19 | verified | | workbench/process_explorer.rs on ps.rs: Open Process Explorer (Developer and Help menu) in a floating window (no auxiliary editor windows in the port), the tree under the app's pid refreshed after each listing, Kill/Force Kill/Copy/Copy All, Debug for `isDebuggable` processes through `debug.startFromConfig` with `attachTo`'s port or pid (cargo test -p app a_node_process_gets_debug), Alt+E, bounds stored; port/tools/shell-gui-check (Help > Open Process Explorer: window "Process Explorer", AXOutline with the vsrustium root and the extension host rows); cargo test -p app process_explorer ps:: |
| workbench/contrib/quickaccess | workbench contribution | M9 | verified | | commandsQuickAccess.ts as quick_access.rs and command_palette.rs; helpQuickAccess `?` with the providers the port has and the More help pick (cargo test -p app quick_access command_palette tf_idf title_bar), history in profile storage; the workbench's palette items are the reference's, listed when the port registers their command; viewQuickAccess.ts as quick_access/views.rs: `view `, Open View, Quick Open View (Ctrl+Q) and `inViewsPicker` list the side bar, panel and secondary side bar containers, their views under `Parent / Child` separators, the terminals, the separate debug consoles and the output channels; Ctrl+Q again moves to the next pick and releasing Ctrl opens it (quickInput.ts `quickNavigate`) (quick_access::tests::the_view_picker_groups_views_by_container_and_opens_the_pick) |
| workbench/contrib/relauncher | workbench contribution | M19 | verified | | workbench/relauncher.rs: SettingsChangeRelauncher's macOS settings (chat and agent host ones left out with AI) ask to restart, Restart relaunches with the same arguments, a changed default (`ConfigurationTarget.DEFAULT`) takes the new value without asking; port/tools/shell-gui-check (window.nativeTabs changed in settings.json: prompt shown, old process quit, 1 new process); cargo test -p app relauncher a_changed_default_does_not_ask_to_restart |