Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(views): draw extension containers and Testing as view panes

rokarturb60f10853b74
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index ce8ce1785b2..abcfc2069e8 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -1619,9 +1619,9 @@ impl Workbench {
self.show_context_menu_beside(actions, &context, self.manage_bounds.get(), window, cx);
}
- /// The Testing container shows once a controller registers (testing.contribution.ts `TestingContextKeys.providerCount`).
+ /// The Testing container shows while it has a view (`hideIfEmpty`).
fn testing_activity_item(&self, hover: HoverOptions, inactive: Rgba, cx: &mut Context<Self>) -> Option<gpui::Stateful<Div>> {
- if self.testing.controllers.is_empty() || self.unpinned_containers().iter().any(|id| id == "workbench.view.testing") {
+ if !self.testing_container_shown() || self.unpinned_containers().iter().any(|id| id == "workbench.view.testing") {
return None;
}
let active = self.side_bar_view == SideBarView::Testing && self.side_bar_visible();
@@ -1675,7 +1675,8 @@ impl Workbench {
return self.debug_side_bar(window, cx);
}
if self.side_bar_view == SideBarView::Testing {
- return self.testing_side_bar(window, cx).children(self.testing_contributed_sections(window, cx));
+ let testing = self.testing_view_pane(window, cx);
+ return self.view_pane_container(view_panes::PaneContainer::Contributed(view_locations::TESTING_CONTAINER), "Testing", vec![testing], window, cx).child(div().h(px(5.)).flex_none());
}
self.explorer_view_container(window, cx)
// The pane view is laid out 5px shorter than the side bar content.
diff --git a/native/crates/app/src/workbench/activity_bar_menu.rs b/native/crates/app/src/workbench/activity_bar_menu.rs
index dfd479c6e74..bacd7104746 100644
--- a/native/crates/app/src/workbench/activity_bar_menu.rs
+++ b/native/crates/app/src/workbench/activity_bar_menu.rs
@@ -23,7 +23,7 @@ impl Workbench {
/// The containers the activity bar can show (`visibleItems`), pinned or not, in its order: id and title.
pub(super) fn activity_bar_containers(&self) -> Vec<(&'static str, &'static str)> {
let mut containers: Vec<_> = VIEW_CONTAINERS.into_iter().filter(|(_, _, _, command, _)| !self.container_hidden_if_empty(command)).map(|(_, _, title, command, _)| (command, title)).collect();
- if !self.testing.controllers.is_empty() {
+ if self.testing_container_shown() {
containers.push(("workbench.view.testing", "Testing"));
}
for container in &self.tree_views.containers {
diff --git a/native/crates/app/src/workbench/testing_view.rs b/native/crates/app/src/workbench/testing_view.rs
index fa7e08322d9..81401905c90 100644
--- a/native/crates/app/src/workbench/testing_view.rs
+++ b/native/crates/app/src/workbench/testing_view.rs
@@ -17,6 +17,8 @@ use crate::testing::{ExpandState, GROUP_COVERAGE, GROUP_DEBUG, GROUP_RUN, Result
/// testing.contribution.ts `Testing.ResultsPanelId`, the panel container of the Test Results view.
pub const TEST_RESULTS_VIEW_ID: &str = "workbench.panel.testResults";
+/// `Testing.ExplorerViewId`, the Test Explorer view in the Testing container.
+pub(super) const TESTING_VIEW: &str = "workbench.view.testing";
const ROW_HEIGHT: f32 = 22.;
/// The view state of the explorer and the results editor.
@@ -228,9 +230,14 @@ impl Workbench {
});
}
- /// The Testing side bar: the welcome without controllers, else the tests tree with the view's actions.
- pub(super) fn testing_side_bar(&self, window: &Window, cx: &mut Context<Self>) -> Div {
- let foreground = self.foreground_or("sideBar.foreground");
+ /// Whether Testing has a view: the Test Explorer once a controller registers (its `when` is
+ /// `testing.providerCount > 0`), or a view contributed to `test`.
+ pub(super) fn testing_container_shown(&self) -> bool {
+ !self.testing.controllers.is_empty() || self.shown_views_of("test").iter().any(|view| self.stays_in(view, super::view_locations::TESTING_CONTAINER))
+ }
+
+ /// The Test Explorer pane: the welcome while no test is found, else the tests tree with the view's actions.
+ pub(super) fn testing_view_pane(&self, window: &Window, cx: &mut Context<Self>) -> super::view_panes::ViewPane {
let running = self.testing.is_running();
let has_tests = !self.testing.collection.roots.is_empty();
let mut actions = div().flex().gap(px(2.)).mr(px(4.));
@@ -253,10 +260,9 @@ impl Workbench {
}
actions = actions.child(self.search_action("collapse-all", "testing.collapseAll", true, cx));
}
- let title = self.side_bar_title(super::view_locations::TESTING_CONTAINER, "Testing").child(actions);
let mut body = div().id("testing-tree").flex_1().min_h_0().overflow_y_scroll().flex().flex_col();
if !has_tests {
- // testingExplorerView.ts `testingViewWelcome`, for a workspace without a test provider.
+ // testing.contribution.ts `registerViewWelcomeContent` of the Test Explorer.
body = body.child(div().px(px(20.)).py(px(13.)).text_size(px(13.)).child("No tests have been found in this workspace yet."));
body = body.child(div().px(px(20.)).child(self.testing_button("Install Additional Test Extensions...", "testing.searchForTestExtension", cx)));
} else {
@@ -268,7 +274,8 @@ impl Workbench {
body = body.children(rows);
}
let filter = has_tests.then(|| self.testing_filter_box(window, cx));
- self.side_bar_frame().text_color(foreground).child(title).children(filter).child(body)
+ let body = div().flex_1().min_h_0().flex().flex_col().children(filter).child(body).into_any_element();
+ super::view_panes::ViewPane { id: TESTING_VIEW, title: "Test Explorer".into(), description: None, actions: has_tests.then(|| actions.into_any_element()), draws_more: false, show_actions: false, body }
}
fn testing_button(&self, label: &str, command: &'static str, cx: &mut Context<Self>) -> gpui::Stateful<Div> {
diff --git a/native/crates/app/src/workbench/tree_view.rs b/native/crates/app/src/workbench/tree_view.rs
index 53216552ccf..7a3078c81ce 100644
--- a/native/crates/app/src/workbench/tree_view.rs
+++ b/native/crates/app/src/workbench/tree_view.rs
@@ -45,8 +45,6 @@ pub(super) struct ContributedView {
pub(super) struct TreeViews {
pub views: Vec<ContributedView>,
pub containers: Vec<super::view_containers::ViewContainer>,
- /// Collapsed views of containers other than the Explorer, which keeps its own pane state.
- pub collapsed: HashSet<&'static str>,
trees: HashMap<String, CustomTree>,
/// Views whose tree shows, as last told to the host (`$setVisible`).
visible: HashSet<String>,
@@ -194,8 +192,6 @@ pub(super) fn accessibility_help_content(extension: &exthost::scan::ScannedExten
impl Workbench {
pub(crate) fn set_tree_views(&mut self, extensions: &[exthost::scan::ScannedExtension]) {
self.tree_views.views = contributed_views(extensions);
- // viewsExtensionPoint.ts `showCollapsed`: the scm and debug containers start every contributed view collapsed.
- self.tree_views.collapsed = self.tree_views.views.iter().filter(|view| view.collapsed || view.container == "scm" || view.container == "debug").map(|view| view.id).collect();
self.tree_views.containers = super::view_containers::contributed_view_containers(extensions);
self.register_view_container_commands();
}
@@ -476,7 +472,9 @@ impl Workbench {
let collapse_all = tree.show_collapse_all.then(|| self.action_bar_item(id, "collapse-all", self.search_action("collapse-all", static_id(&format!("workbench.actions.treeView.{id}.collapseAll")), true, cx), cx));
// paneCompositePart.css: 4px after each title action.
let actions = div().flex().gap(px(4.)).child(self.inline_actions(MenuId::ViewTitle, Some(id), &context, Vec::new(), foreground, cx).gap(px(4.))).children(collapse_all).into_any_element();
- let message = tree.message.as_ref().map(|message| self.tree_view_message(id, message, &context, cx));
+ // treeView.ts `updateMessage`: `noDataProviderMessage` until the extension registers a provider.
+ let no_provider = (!tree.has_provider).then(|| json!("There is no data provider registered that can provide view data."));
+ let message = tree.message.as_ref().filter(|message| *message != "").or(no_provider.as_ref()).map(|message| self.tree_view_message(id, message, &context, cx));
let focused = focus.is_focused(window);
let tree_rows = tree.rows();
let depths: Vec<usize> = tree_rows.iter().map(|(_, depth)| depth + 1).collect();
@@ -501,9 +499,10 @@ impl Workbench {
/// treeView.ts `showMessage` in views.css `.message`: a string as text, a markdown string by `processMessage`.
fn tree_view_message(&self, id: &str, message: &Value, context: &HashMap<String, Value>, cx: &mut Context<Self>) -> Div {
- let container = div().flex().pt(px(4.)).pb(px(4.)).pl(px(18.)).pr(px(12.)).line_height(px(18.2));
+ let selector = format!("tree-message-{id}");
+ let container = div().debug_selector(move || selector).flex().pt(px(4.)).pb(px(4.)).pl(px(18.)).pr(px(12.)).line_height(px(18.2));
if let Some(text) = message.as_str() {
- return container.child(text.to_owned());
+ return container.child(div().flex_1().min_w_0().child(text.to_owned()));
}
let markdown = MarkdownString::from_value(message);
let enablements = crate::keybindings::command_enablements(&self.extensions);
diff --git a/native/crates/app/src/workbench/tree_view/tests.rs b/native/crates/app/src/workbench/tree_view/tests.rs
index f2d7df13163..974ec18ee90 100644
--- a/native/crates/app/src/workbench/tree_view/tests.rs
+++ b/native/crates/app/src/workbench/tree_view/tests.rs
@@ -148,6 +148,19 @@ fn a_markdown_message_draws_its_button_icons_and_a_string_one_stays_text(cx: &mu
assert!(cx.debug_bounds("codicon-info").is_some(), "markdownRenderer.ts renders a paragraph's theme icons");
}
+/// treeView.ts `updateMessage`: a view without a data provider shows `noDataProviderMessage`, an empty message none.
+#[gpui::test]
+fn a_view_without_a_provider_shows_the_no_data_provider_message(cx: &mut TestAppContext) {
+ let (workbench, cx, _receiver) = workbench_with("no-provider", cx);
+ workbench.update(cx, |workbench, cx| workbench.expand_pane(crate::workbench::view_panes::PaneContainer::Explorer, VIEW, cx));
+ draw(cx);
+ assert!(cx.debug_bounds("tree-message-test.tree").is_some());
+ request(&workbench, cx, "$registerTreeViewDataProvider", json!([VIEW, {}]));
+ request(&workbench, cx, "$setMessage", json!([VIEW, ""]));
+ draw(cx);
+ assert!(cx.debug_bounds("tree-message-test.tree").is_none());
+}
+
/// viewsExtensionPoint.ts `isValidViewsContainer`, `addViews` and `isValidViewDescriptors` collector messages.
#[test]
fn invalid_views_and_view_containers_are_extension_messages() {
diff --git a/native/crates/app/src/workbench/view_containers.rs b/native/crates/app/src/workbench/view_containers.rs
index 3a425b83293..7208d281887 100644
--- a/native/crates/app/src/workbench/view_containers.rs
+++ b/native/crates/app/src/workbench/view_containers.rs
@@ -1,13 +1,12 @@
//! The view containers extensions contribute (viewsExtensionPoint.ts `viewsContainers.activitybar`) and the tree
//! views of every container (viewsService.ts): the activity bar items of containers with an active view, their side
-//! bar, the contributed views appended to the Source Control, Run and Debug and Testing side bars, and the
-//! `<view id>.focus` and `workbench.view.extension.<id>` commands.
+//! bar, and the `<view id>.focus` and `workbench.view.extension.<id>` commands.
// Not ported yet: `viewsContainers.panel` (port/ledger.md, workbench/services/views).
use std::collections::HashMap;
use std::path::PathBuf;
-use gpui::{AnyElement, ClickEvent, Context, Div, InteractiveElement, IntoElement, ParentElement, StatefulInteractiveElement, Styled, Window, div, prelude::FluentBuilder, px, svg};
+use gpui::{ClickEvent, Context, Div, InteractiveElement, ParentElement, StatefulInteractiveElement, Styled, Window, div, px, svg};
use serde_json::{Value, json};
use super::Workbench;
@@ -15,7 +14,7 @@ use super::hover::HoverOptions;
use super::layout::Part;
use super::search_view::SideBarView;
use super::tree_view::static_id;
-use super::view_panes::{FILE_VIEW, HEADER_SIZE, OUTLINE_VIEW, PaneContainer, TIMELINE_VIEW};
+use super::view_panes::{FILE_VIEW, OUTLINE_VIEW, PaneContainer, TIMELINE_VIEW};
use crate::commands::Outcome;
use crate::notifications::Severity;
@@ -207,14 +206,17 @@ impl Workbench {
drop(self.execute_command("workbench.view.debug", Vec::new(), window, cx));
self.expand_pane(PaneContainer::Debug, id, cx);
}
- "test" => drop(self.execute_command("workbench.view.testing", Vec::new(), window, cx)),
+ "test" => {
+ drop(self.execute_command("workbench.view.testing", Vec::new(), window, cx));
+ self.expand_pane(PaneContainer::Contributed(super::view_locations::TESTING_CONTAINER), id, cx);
+ }
key => {
- let Some(container) = self.tree_views.containers.iter().find(|container| container.key == key) else { return };
- self.side_bar_view = SideBarView::Contributed(container.id);
+ let Some(container) = self.tree_views.containers.iter().find(|container| container.key == key).map(|container| container.id) else { return };
+ self.side_bar_view = SideBarView::Contributed(container);
self.set_part_hidden(Part::SideBar, false, cx);
+ self.expand_pane(PaneContainer::Contributed(container), id, cx);
}
}
- self.tree_views.collapsed.remove(id);
if focus {
self.focus_tree_view(id, window, cx);
}
@@ -245,17 +247,17 @@ impl Workbench {
if !self.is_part_visible(Part::SideBar) || !self.shown_views_of(&view.container).contains(&id) {
return false;
}
- let shown_container = match view.container.as_str() {
- "explorer" => return self.side_bar_view == SideBarView::Explorer && self.view_pane_expanded(PaneContainer::Explorer, id),
- "scm" => return self.side_bar_view == SideBarView::Scm && self.view_pane_expanded(PaneContainer::Scm, id),
- "debug" => return self.side_bar_view == SideBarView::Debug && self.view_pane_expanded(PaneContainer::Debug, id),
- "test" => SideBarView::Testing,
+ let (shown_container, panes) = match view.container.as_str() {
+ "explorer" => (SideBarView::Explorer, PaneContainer::Explorer),
+ "scm" => (SideBarView::Scm, PaneContainer::Scm),
+ "debug" => (SideBarView::Debug, PaneContainer::Debug),
+ "test" => (SideBarView::Testing, PaneContainer::Contributed(super::view_locations::TESTING_CONTAINER)),
key => match self.tree_views.containers.iter().find(|container| container.key == key) {
- Some(container) => SideBarView::Contributed(container.id),
+ Some(container) => (SideBarView::Contributed(container.id), PaneContainer::Contributed(container.id)),
None => return false,
},
};
- self.side_bar_view == shown_container && !self.tree_views.collapsed.contains(id)
+ self.side_bar_view == shown_container && self.view_pane_expanded(panes, id)
}
/// viewDescriptorService.ts `<view id>.active` of the contributed views.
@@ -291,60 +293,16 @@ impl Workbench {
items
}
- /// A contributed container's side bar: with one view the view merged into the container (no header, the title
- /// "<container>: <view>"), else a section per view.
+ /// A contributed container's side bar: its views as panes (`view_pane_container`).
pub(super) fn contributed_side_bar(&self, id: &'static str, window: &Window, cx: &mut Context<Self>) -> Div {
- let foreground = self.foreground_or("sideBar.foreground");
- let container_title = self.tree_views.containers.iter().find(|container| container.id == id).map(|container| container.title.clone()).unwrap_or_default();
- let views = self.container_views(id);
- let frame = self.side_bar_frame().text_color(foreground);
- if let [view] = views.as_slice() {
- let pane = self.tree_view_pane(view, window, cx);
- let title = if pane.title == container_title || pane.title.is_empty() { container_title } else { format!("{container_title}: {}", pane.title) };
- let title = self.side_bar_title_text(title).children(self.scoped_progress_bar(view).map(|bar| bar.bottom_0())).children(pane.actions.map(|actions| self.action_bar(view, false, Default::default(), div().flex_none().pl(px(8.)).child(actions), cx)));
- return frame.child(title).child(div().flex_1().min_h_0().flex().flex_col().child(pane.body));
- }
- frame.child(self.side_bar_title_text(container_title)).child(div().flex_1().min_h_0().flex().flex_col().children(self.contributed_view_sections(&views, window, cx)))
- }
-
- /// The contributed views of Testing as sections below its own view.
- pub(super) fn testing_contributed_sections(&self, window: &Window, cx: &mut Context<Self>) -> Vec<AnyElement> {
- let views: Vec<_> = self.shown_views_of("test").into_iter().filter(|view| self.stays_in(view, super::view_locations::TESTING_CONTAINER)).collect();
- self.contributed_view_sections(&views, window, cx)
+ let title = self.tree_views.containers.iter().find(|container| container.id == id).expect("a contributed container").title.clone();
+ self.view_pane_container(PaneContainer::Contributed(id), &title, Vec::new(), window, cx).child(div().h(px(5.)).flex_none())
}
- /// paneview.ts panes: a 28px header (chevron, title, description, actions while expanded) over the body.
- fn contributed_view_sections(&self, views: &[&'static str], window: &Window, cx: &mut Context<Self>) -> Vec<AnyElement> {
- let foreground = self.foreground_or("sideBarSectionHeader.foreground");
- let border = self.theme.color("sideBarSectionHeader.border");
- let mut sections = Vec::new();
- for &id in views {
- let pane = self.tree_view_pane(id, window, cx);
- let expanded = !self.tree_views.collapsed.contains(id);
- let header = div()
- .id(gpui::SharedString::from(format!("view-header-{id}")))
- .h(px(HEADER_SIZE))
- .flex_none()
- .flex()
- .items_center()
- .cursor_pointer()
- .text_color(foreground)
- .when_some(self.theme.color("sideBarSectionHeader.background"), |header, background| header.bg(background))
- .when_some(border, |header, border| header.border_t_1().border_color(border))
- .child(self.icon(if expanded { "chevron-down" } else { "chevron-right" }, 20., 16., foreground))
- .child(div().text_size(px(11.)).font_weight(gpui::FontWeight::BOLD).child(pane.title.to_uppercase()))
- .children(pane.description.map(|description| div().ml(px(4.)).text_size(px(11.)).opacity(0.6).truncate().child(description)))
- .child(div().ml_auto().when(expanded, |actions| actions.children(pane.actions)))
- .on_click(cx.listener(move |workbench, _, _, cx| {
- if !workbench.tree_views.collapsed.remove(id) {
- workbench.tree_views.collapsed.insert(id);
- }
- workbench.sync_tree_views(cx);
- cx.notify();
- }));
- sections.push(div().flex().flex_col().when(expanded, |section| section.flex_1().min_h_0()).child(header).when(expanded, |section| section.child(div().flex_1().min_h_0().flex().flex_col().child(pane.body))).into_any_element());
- }
- sections
+ /// The shown views of a `contributes.views` key, each with whether it starts collapsed (`"visibility": "collapsed"`).
+ pub(super) fn contributed_panes(&self, key: &str) -> Vec<(&'static str, bool)> {
+ let collapsed = |id: &str| self.tree_views.views.iter().any(|view| view.id == id && view.collapsed);
+ self.shown_views_of(key).into_iter().map(|id| (id, collapsed(id))).collect()
}
}
diff --git a/native/crates/app/src/workbench/view_containers/tests.rs b/native/crates/app/src/workbench/view_containers/tests.rs
index fa24881a710..f42d0c28f9e 100644
--- a/native/crates/app/src/workbench/view_containers/tests.rs
+++ b/native/crates/app/src/workbench/view_containers/tests.rs
@@ -95,3 +95,98 @@ fn the_top_activity_bar_shows_contributed_containers(cx: &mut TestAppContext) {
workbench.read_with(cx, |workbench, _| assert_eq!(workbench.side_bar_view, crate::workbench::search_view::SideBarView::Contributed(containers_id)));
let _ = std::fs::remove_dir_all(&dir);
}
+
+/// viewsExtensionPoint.ts registers an activity bar container's views in a `ViewPaneContainer`: each is a pane with a
+/// header, `"visibility": "collapsed"` starts it collapsed, its collapsed state goes to workspace storage, and a view
+/// moved into the container joins the panes.
+#[gpui::test]
+fn a_contributed_container_draws_its_views_as_panes(cx: &mut TestAppContext) {
+ 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 fixtures = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../port/fixtures/extensions/activity-bar-containers");
+ let containers = scan_extension(&fixtures.join("vscode-containers"), false).unwrap();
+ let dir = std::env::temp_dir().join(format!("vsrustium-contributed-panes-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ std::fs::create_dir_all(&dir).unwrap();
+ let workspace = config::workspace::Workspace::folder(dir.clone());
+ let settings = Arc::new(Mutex::new(Settings::load(Registry::with_extensions(&[]), dir.join("User"), Some(workspace.clone()))));
+ let (workbench, cx) = cx.add_window_view(|_, cx| {
+ let mut workbench = Workbench::new(theme, app_root.clone(), Some(workspace), Languages::new(&[]), settings, HostSync::new(std::sync::mpsc::channel().0), cx);
+ workbench.set_tree_views(std::slice::from_ref(&containers));
+ workbench
+ });
+ let containers_id = "workbench.view.extension.containersView";
+ let container = PaneContainer::Contributed(containers_id);
+ workbench.update_in(cx, |workbench, window, cx| _ = workbench.execute_command(containers_id, vec![], window, cx));
+ cx.update(|window, cx| drop(window.draw(cx)));
+ cx.run_until_parked();
+ let networks = "vscode-containers.views.networks";
+ workbench.read_with(cx, |workbench, _| {
+ let ids = workbench.panes(container).view.as_ref().expect("laid out").ids().to_vec();
+ assert_eq!(ids, ["vscode-containers.views.containers", "vscode-containers.views.images", "vscode-containers.views.registries", networks, "vscode-containers.views.volumes", "vscode-containers.views.dockerContexts", "vscode-containers.views.help"]);
+ assert!(workbench.view_pane_expanded(container, "vscode-containers.views.images"));
+ assert!(!workbench.view_pane_expanded(container, networks), "\"visibility\": \"collapsed\"");
+ });
+
+ let header = cx.debug_bounds("pane-header-vscode-containers.views.networks").expect("each view has a pane header").center();
+ cx.simulate_click(header, gpui::Modifiers::none());
+ cx.run_until_parked();
+ workbench.read_with(cx, |workbench, _| {
+ assert!(workbench.view_pane_expanded(container, networks), "a header click expands the pane");
+ let stored: serde_json::Value = serde_json::from_str(&workbench.workspace_storage.lock().unwrap().get("workbench.view.extension.containersView.state").expect("stored")).unwrap();
+ assert_eq!(stored[networks]["collapsed"], false);
+ });
+
+ workbench.update(cx, |workbench, cx| workbench.move_view_to_container(OUTLINE_VIEW, containers_id, cx));
+ cx.update(|window, cx| drop(window.draw(cx)));
+ workbench.read_with(cx, |workbench, _| assert!(workbench.panes(container).view.as_ref().unwrap().ids().contains(&OUTLINE_VIEW), "a moved view joins the container's panes"));
+ assert!(cx.debug_bounds("pane-header-outline").is_some());
+ let _ = std::fs::remove_dir_all(&dir);
+}
+
+/// testing.contribution.ts: Testing is a `ViewPaneContainer` whose Test Explorer, shown once a controller registers,
+/// comes first (order -999), with the views extensions contribute to `test` as panes after it. A contributed view alone
+/// shows the container and merges into it, titled "Testing" as in the reference.
+#[gpui::test]
+fn testing_draws_contributed_views_as_panes_after_the_test_explorer(cx: &mut TestAppContext) {
+ 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!("vsrustium-testing-panes-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&dir);
+ let extension_dir = dir.join("extension");
+ std::fs::create_dir_all(&extension_dir).unwrap();
+ let manifest = serde_json::json!({ "name": "test-views", "publisher": "port", "version": "0.0.1", "engines": { "vscode": "*" }, "contributes": { "views": { "test": [{ "id": "port.testView", "name": "Test Sample" }] } } });
+ std::fs::write(extension_dir.join("package.json"), manifest.to_string()).unwrap();
+ let extension = scan_extension(&extension_dir, false).unwrap();
+ let workspace = config::workspace::Workspace::folder(dir.clone());
+ let settings = Arc::new(Mutex::new(Settings::load(Registry::with_extensions(&[]), dir.join("User"), Some(workspace.clone()))));
+ let (workbench, cx) = cx.add_window_view(|_, cx| {
+ let mut workbench = Workbench::new(theme, app_root.clone(), Some(workspace), Languages::new(&[]), settings, HostSync::new(std::sync::mpsc::channel().0), cx);
+ workbench.set_tree_views(std::slice::from_ref(&extension));
+ workbench
+ });
+ workbench.update_in(cx, |workbench, window, cx| _ = workbench.execute_command("workbench.view.testing", vec![], window, cx));
+ cx.update(|window, cx| drop(window.draw(cx)));
+ cx.run_until_parked();
+ let container = PaneContainer::Contributed(crate::workbench::view_locations::TESTING_CONTAINER);
+ workbench.read_with(cx, |workbench, _| {
+ assert_eq!(workbench.panes(container).view.as_ref().expect("laid out").ids(), ["port.testView"]);
+ assert!(workbench.activity_bar_containers().contains(&("workbench.view.testing", "Testing")), "a contributed view shows Testing");
+ });
+ assert!(cx.debug_bounds("pane-header-port.testView").is_none(), "a single view merges into the container");
+
+ workbench.update(cx, |workbench, cx| {
+ workbench.testing.controllers.insert("port".into(), crate::workbench::testing_service::Controller { label: "Port".into(), capabilities: 0 });
+ cx.notify();
+ });
+ cx.update(|window, cx| drop(window.draw(cx)));
+ workbench.read_with(cx, |workbench, _| {
+ let ids = workbench.panes(container).view.as_ref().expect("laid out").ids().to_vec();
+ assert_eq!(ids, [crate::workbench::testing_view::TESTING_VIEW, "port.testView"]);
+ });
+ assert!(cx.debug_bounds("pane-header-workbench.view.testing").is_some(), "the Test Explorer has a pane header beside another view");
+ assert!(cx.debug_bounds("pane-header-port.testView").is_some());
+ let _ = std::fs::remove_dir_all(&dir);
+}
diff --git a/native/crates/app/src/workbench/view_locations.rs b/native/crates/app/src/workbench/view_locations.rs
index 433acba4541..84be169f43b 100644
--- a/native/crates/app/src/workbench/view_locations.rs
+++ b/native/crates/app/src/workbench/view_locations.rs
@@ -637,6 +637,7 @@ pub(super) fn pane_container(container: &'static str) -> PaneContainer {
SEARCH_CONTAINER => PaneContainer::Search,
DEBUG_CONTAINER => PaneContainer::Debug,
super::extensions_view::VIEWLET_ID => PaneContainer::Extensions,
+ other if other.starts_with("workbench.view.extension.") => PaneContainer::Contributed(other),
other => PaneContainer::Generated(other),
}
}
diff --git a/native/crates/app/src/workbench/view_panes.rs b/native/crates/app/src/workbench/view_panes.rs
index 117dd40d67f..e5e75f46061 100644
--- a/native/crates/app/src/workbench/view_panes.rs
+++ b/native/crates/app/src/workbench/view_panes.rs
@@ -16,7 +16,8 @@ use serde_json::{Value, json};
use super::Workbench;
use super::extensions_view::VIEWLET_ID as EXTENSIONS_CONTAINER;
use super::debug_view::{BREAKPOINTS_VIEW, CALL_STACK_VIEW, DEBUG_CONTAINER, LOADED_SCRIPTS_VIEW, VARIABLES_VIEW, WATCH_VIEW};
-use super::view_locations::{EXPLORER_CONTAINER, SCM_CONTAINER, SEARCH_CONTAINER, SEARCH_VIEW};
+use super::testing_view::TESTING_VIEW;
+use super::view_locations::{EXPLORER_CONTAINER, SCM_CONTAINER, SEARCH_CONTAINER, SEARCH_VIEW, TESTING_CONTAINER};
use super::view_visibility::container_storage_id;
use crate::split_view::{SashState, SplitView, View};
@@ -49,6 +50,8 @@ pub(super) enum PaneContainer {
Extensions,
/// A container generated for moved views (view_locations.rs), by its id.
Generated(&'static str),
+ /// Testing or an extension's `viewsContainers.activitybar` container, by its `workbench.view.extension.<key>` id.
+ Contributed(&'static str),
}
impl PaneContainer {
@@ -61,6 +64,7 @@ impl PaneContainer {
PaneContainer::Debug => "debug",
PaneContainer::Extensions => EXTENSIONS_CONTAINER,
PaneContainer::Generated(id) => id,
+ PaneContainer::Contributed(id) => id.strip_prefix("workbench.view.extension.").expect("an extension container id"),
}
}
@@ -71,7 +75,7 @@ impl PaneContainer {
PaneContainer::Search => SEARCH_CONTAINER,
PaneContainer::Debug => DEBUG_CONTAINER,
PaneContainer::Extensions => EXTENSIONS_CONTAINER,
- PaneContainer::Generated(id) => id,
+ PaneContainer::Generated(id) | PaneContainer::Contributed(id) => id,
}
}
}
@@ -97,6 +101,7 @@ fn view_weight(id: &str) -> f32 {
"workbench.views.extensions.installed" => 100.,
"workbench.views.extensions.popular" => 60.,
VARIABLES_VIEW | SCM_CHANGES_VIEW | SCM_HISTORY_VIEW | "extensions.recommendedList" => 40.,
+ TESTING_VIEW => 80.,
OUTLINE_VIEW | TIMELINE_VIEW | CALL_STACK_VIEW => 30.,
WATCH_VIEW => 10.,
LOADED_SCRIPTS_VIEW => 5.,
@@ -380,6 +385,14 @@ impl Workbench {
debug.extend(self.shown_views_of("debug").into_iter().map(|id| (id, true)));
self.layout_container(PaneContainer::Debug, height, debug, cx);
self.layout_extensions_panes(height, cx);
+ // testing.contribution.ts: the Test Explorer's `when` is `testing.providerCount > 0`.
+ let mut testing = if self.testing.controllers.is_empty() { Vec::new() } else { vec![(TESTING_VIEW, false)] };
+ testing.extend(self.contributed_panes("test"));
+ self.layout_container(PaneContainer::Contributed(TESTING_CONTAINER), height, testing, cx);
+ let containers: Vec<_> = self.tree_views.containers.iter().map(|container| (container.id, self.contributed_panes(&container.key))).collect();
+ for (container, own) in containers {
+ self.layout_container(PaneContainer::Contributed(container), height, own, cx);
+ }
}
/// The container's own views still in it, then the views moved into it.
@@ -523,6 +536,8 @@ impl Workbench {
_ if id == SCM_CHANGES_VIEW => crate::nls::localize_in(id, "Source Control").into_owned(),
_ if id == SCM_HISTORY_VIEW => crate::nls::localize_in(id, "Source Control Graph").into_owned(),
_ if id == SCM_REPOSITORIES_VIEW => crate::nls::localize_in(id, "Source Control Repositories").into_owned(),
+ // The reference titles Testing with a single view "Testing" (ui-pair contributed-panes.json).
+ _ if container == PaneContainer::Contributed(TESTING_CONTAINER) => container_title.into_owned(),
pane_title if pane_title.is_empty() => container_title.into_owned(),
pane_title if pane_title == container_title => pane_title.into_owned(),
pane_title => format!("{container_title}: {pane_title}"),
diff --git a/port/fixtures/extensions/contributed-panes/package.json b/port/fixtures/extensions/contributed-panes/package.json
new file mode 100644
index 00000000000..561fdaea6a2
--- /dev/null
+++ b/port/fixtures/extensions/contributed-panes/package.json
@@ -0,0 +1,20 @@
+{
+ "name": "contributed-panes",
+ "publisher": "vsrustium",
+ "displayName": "Contributed Panes",
+ "version": "0.0.1",
+ "engines": { "vscode": "^1.90.0" },
+ "contributes": {
+ "viewsContainers": {
+ "activitybar": [{ "id": "portPanes", "title": "Port Panes", "icon": "$(package)" }]
+ },
+ "views": {
+ "portPanes": [
+ { "id": "portPanes.first", "name": "First" },
+ { "id": "portPanes.second", "name": "Second" },
+ { "id": "portPanes.third", "name": "Third", "visibility": "collapsed" }
+ ],
+ "test": [{ "id": "portPanes.testView", "name": "Test Sample" }]
+ }
+ }
+}
diff --git a/port/fixtures/ui-pair/contributed-panes.json b/port/fixtures/ui-pair/contributed-panes.json
new file mode 100644
index 00000000000..8140d6ef6c8
--- /dev/null
+++ b/port/fixtures/ui-pair/contributed-panes.json
@@ -0,0 +1,9 @@
+[
+ { "wait": 5000 },
+ { "click": [26, 321] },
+ { "wait": 1500 },
+ { "shot": "containers" },
+ { "click": [26, 276] },
+ { "wait": 1500 },
+ { "shot": "testing" }
+]
diff --git a/port/ledger.md b/port/ledger.md
index 45ef46e4d08..240f7a5dfea 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -456,7 +456,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/services/userDataProfile | workbench service | M10 | verified | | one app-wide `UserDataProfilesService` (a gpui Global in app/src/user_data_profile.rs) for every window of the process: profile windows open in this process, a transient profile lives while a window runs it (userDataProfilesHandler.ts cleanup on close), and `onDidChangeProfiles` reaches every window (cargo test -p app workbench::user_data_profile: profile_windows_open_in_this_process, every_window_sees_a_profile_another_window_creates_and_removes); userDataProfileManagement.ts `switchProfile`, `removeProfile` and `changeCurrentProfile` (configuration, keybindings, global state and user extensions move to the profile's files, the extension host restarts, workbench/extension_host_restart.rs) in workbench/user_data_profile.rs; the configuration layers of a profile (`ApplicationConfiguration`, PROFILE_SCOPES, `workbench.settings.applyToAllProfiles`) with configurationService.test.ts's Profiles suite (cargo test -p config profile_tests); the settings, keybindings, tasks, snippets, globalState and extensions resources and the `.code-profile` template of userDataProfileImportExportService.ts as app/src/profile_template.rs (cargo test -p app profile_template); a template's extensions install the way extensionsResource.ts `apply` does, one publisher trust dialog for all of them and an error naming the ones that failed (cargo test -p app template_extensions_ask_for_publisher_trust_once); per-profile extensions.json (cargo test -p exthost extension_management); `createTroubleshootProfile` is removed with contrib/issue, its only caller (issueTroubleshoot.ts); profile templates from `profileTemplatesUrl` have no source, the product.json has none |
| workbench/services/userDataSync | workbench service | | removed | | no sign-in/AI by decision (port/notes.md); not ported |
| workbench/services/utilityProcess | workbench service | | verified | | no utility process workers: the file watcher worker, the one kept client, is files/src/watcher.rs on an FSEvents thread (platform/files; api-tests `vscode API - workspace-watcher` passes in the milestone 20 whole-suite run); localTranscription is AI, removed (port/notes.md milestone 20) |
-| workbench/services/views | workbench service | M11 | ported | [3 M] view_locations.rs:523: extension containers take no added views, hidden state keyed by Explorer <br> [3 M] view_containers.rs:296, :317: the views of a `viewsContainers.activitybar` container and the contributed views below Testing are sections drawn by `contributed_view_sections`, not view_panes.rs panes: no sashes, stored sizes and order, header drag, or Views submenu ("...") on the container title <br> [3 M] view_containers.rs:5: `viewsContainers.panel`: an extension's panel container gets no panel tab and its views do not draw | view containers of `viewsContainers.activitybar` and the tree views of every container (workbench/view_containers.rs): activity bar items while a view's `when` holds, `workbench.view.extension.<id>`, `<view id>.focus`, `<view id>.active`, merged single views, sections in the scm, debug and test side bars; the Explorer's ViewDescriptorsState (view_panes.rs); ui-pair port/results/references-view.md; `visibility` (`hidden` views stay out until the Views submenu of the Explorer's "..." shows them, `collapsed`; workbench/view_visibility.rs: cargo test -p app view_visibility); the Explorer container's ViewDescriptorsState (view_panes.rs); moving views (workbench/view_locations.rs, verified): `views.customizations` viewLocations and generated containers `workbench.views.service.<location>.<uuid>` with their activity bar items and panel tabs, View: Move View, Move Focused View, Reset Focused View Location, a view header dropped on another container's pane (at its position), on the activity bar or on a panel's title (a new entry), `focusedView`; the folder view, Open Editors, Outline, Timeline, Source Control's Changes, Search, the debug views and the panel's views move into any built-in container or a new entry and back, the moved view opens focused, the picker lists only visible views (shortcut in view_locations.rs: contributed extension containers take no added views; a moved view's hidden state stays under its old container's key); cargo test -p app (2594 passed); ui-pair port/fixtures/ui-pair/m11/move-view.json, port/results/move-view.md (8 steps match, Ports removed by decision); verified: ui-pair port/results/references-view.md (milestone 11 verification) |
+| workbench/services/views | workbench service | M11 | ported | [3 S] view_locations.rs:538: a moved view's hidden state stays under the Explorer's key, upstream keys it by its container <br> [3 S] view_containers.rs:92: an extension container's "View: Show <title>" (viewsService.ts `registerOpenViewContainerAction`, f1) is not in the Command Palette <br> [3 M] view_containers.rs:5: `viewsContainers.panel`: an extension's panel container gets no panel tab and its views do not draw | view containers of `viewsContainers.activitybar` and the tree views of every container (workbench/view_containers.rs): activity bar items while a view's `when` holds, `workbench.view.extension.<id>`, `<view id>.focus`, `<view id>.active`, merged single views, view_panes.rs panes for the views of an extension container and of Testing (`PaneContainer::Contributed`: cargo test -p app view_containers::; ui-pair port/fixtures/ui-pair/contributed-panes.json with port/fixtures/extensions/contributed-panes, the Port Panes and Testing side bars as the reference), treeView.ts `noDataProviderMessage` (cargo test -p app tree_view::), contributed views of scm and debug as panes of those containers; the Explorer's ViewDescriptorsState (view_panes.rs); ui-pair port/results/references-view.md; `visibility` (`hidden` views stay out until the Views submenu of the Explorer's "..." shows them, `collapsed`; workbench/view_visibility.rs: cargo test -p app view_visibility); the Explorer container's ViewDescriptorsState (view_panes.rs); moving views (workbench/view_locations.rs, verified): `views.customizations` viewLocations and generated containers `workbench.views.service.<location>.<uuid>` with their activity bar items and panel tabs, View: Move View, Move Focused View, Reset Focused View Location, a view header dropped on another container's pane (at its position), on the activity bar or on a panel's title (a new entry), `focusedView`; the folder view, Open Editors, Outline, Timeline, Source Control's Changes, Search, the debug views and the panel's views move into any built-in container or a new entry and back, the moved view opens focused, the picker lists only visible views (shortcut in view_locations.rs: a moved view's hidden state stays under its old container's key); cargo test -p app (2594 passed); ui-pair port/fixtures/ui-pair/m11/move-view.json, port/results/move-view.md (8 steps match, Ports removed by decision); verified: ui-pair port/results/references-view.md (milestone 11 verification) |
| workbench/services/workingCopy | workbench service | M8 | verified | | the text file and untitled working copies are the editor models (dirty state, save, revert, the window's edited dot of `onDidChangeDirty`): cargo test -p app untitled (30), lifecycle (3); WorkingCopyFileService create, move, copy, delete with participants: cargo test -p files operations (12); WorkingCopyHistoryService and its tracker for saves into User/History, entries following renames and folder moves (`moveEntries`): cargo test -p app local_history (10); WorkingCopyBackupService and the backup tracker with hot exit (backups.rs, workbench/backup_tracker.rs), a backup of a deleted file restoring as an orphaned model (`doResolveFromBackup`), modified scratchpads backing up: cargo test -p app backup (19); the working copies of editable custom documents (MainThreadCustomEditorModel, workbench/custom_documents.rs: `$onDidEdit` edits for undo and redo with `$disposeEdits`, `$onContentChange`, dirty tabs, `$onSave`, Save As with `$onSaveAs` and the editor moved to the target, `$revert`, `$backup` into a `vscode-custom-editor` backup restored with its backup id): cargo test -p app custom_documents (3), and port/fixtures/extensions/custom-document-tests (FIXTURE=custom-document-tests port/tools/webview-check: 4/4 in the reference and 4/4 in the port). Notebook working copies are the contrib/notebook row's; their backups are typed (`hashIdentifier` with a type id, backups.rs: cargo test -p app backups::, the upstream typed hashes) and the shutdown joins backups still being written |
| workbench/services/workspaces | workbench service | M12 | ported | [3 L] workspace_editing.rs:243, :379: enterWorkspace reopens the window where upstream switches in place (L); the Remove Folder picker has no ROOT_FOLDER icons (S) | workspace_trust.rs: WorkspaceTrustManagementService (uriTrustInfo in shared storage, longest trusted parent, empty window memento, parent folder trust) and WorkspaceTrustRequestService: cargo test -p app workspace_trust; workbench/workspace_editing.rs: abstractWorkspaceEditingService.ts addFolders, removeFolders, updateFolders, saveAndEnterWorkspace, enterWorkspace (shortcut in port/notes.md: the window reopens in place), duplicate workspace: cargo test -p app folders_added_and_removed_in_a_workspace_reach_its_file_the_explorer_settings_and_host workspace_editing; ui-pair port/fixtures/ui-pair/m12/workspace-folders.json, verified at port-m12b-verify |
| workbench/contrib/accessibility | workbench contribution | M19 | verified | | workbench/accessible_view.rs and workbench/accessibility.rs: accessible view and accessibility help (Alt+F2, Alt+F1 with the editor, hover, view help providers, the hover's and a workbench hover's accessible view, Escape from the latter focusing the hover again, a focused contributed tree or webview view's `accessibilityHelpContent`, a webview view the `focusedView` while its webview has the keyboard; Alt+F6, Alt+H, Alt+K, Alt+A, Alt+]/[), notification aria labels with the verbosity hint, unfocused editor dimming, Toggle Screen Reader Accessibility Mode, status entry; cargo test -p app accessib (alt_f1_shows_the_editor_help..., alt_f1_in_a_contributed_view..., alt_f1_in_a_webview_view..., dimming), cargo test -p app content_hover (the hover's accessible view), port/tools/a11y-check reads the help text area (port/notes.md milestone 19) |
diff --git a/port/notes.md b/port/notes.md
index c9b9edc86e3..3e50f279ec7 100644
--- a/port/notes.md
+++ b/port/notes.md
@@ -601,7 +601,7 @@ Scope (roadmap section 13): diagnostics, hover, completion, go to definition and
- Decorations (`decorations.rs`, `workbench/file_decorations.rs`; decorationsService.ts, mainThreadDecorations.ts): a label asks while it draws; the asks go out once the frame is built, one `$provideDecorations` per provider. `$onDidChange` drops and asks again for the named resources at once, so folders keep their bubble. The SCM rows take their letter and color from the service (they read git's tooltip before).
- Panel overflow (`panel.rs` `fitting_tabs`, compositeBar.ts `updateCompositeSwitcher`): tab widths come from the shaped titles and badges, the limit from the title and its actions as painted last frame (a size change draws again). A filter box squeezed below its 200px maximum counts at 200px, as upstream lays the composite bar out after the toolbar. The "..." item lists the hidden tabs ("{name} ({badge})") and runs their `<view id>.focus` command, which every panel view registers (`PanelView.view_id`, `PanelView.open`). Tests: `cargo test -p app workbench::panel::`.
- Problems filter (`markers_filter.rs` for markersFilterOptions.ts and the tree and table filters, `workbench/problems_filter.rs`, `workbench/problems_table.rs`): the filter box with history (Up/Down), `@source:`, `!` negation, include and exclude globs, the filter submenu (Show Errors, Warnings, Infos, Active File Only, Excluded Files with `files.exclude` per folder), "Showing x of y", the "No results found with provided filter criteria. Clear Filters." message, View as Table/Tree with `problems.defaultViewMode`, all in the workspace memento `memento/workbench.panel.markers`. The table has the five columns of markersTable.ts in a `SplitView` with column sashes. Not ported yet: the badge's `small` rule (hidden below 400px), the code link in the table opening its target, row focus and selection. Tests: `cargo test -p app markers_filter`.
-- View containers (`workbench/view_containers.rs`): `viewsContainers.activitybar` containers show in the activity bar while one of their views' `when` holds; `workbench.view.extension.<id>` opens one, a single view merges with it ("<container>: <view>" title), several views get sections. Views contributed to `scm`, `debug` and `test` draw as sections under those side bars' own views. Every contributed tree view registers `<view id>.focus` and sets `<view id>.active`. Not ported yet: `viewsContainers.panel`, the compact activity bar's contributed items, moving views.
+- View containers (`workbench/view_containers.rs`): `viewsContainers.activitybar` containers show in the activity bar while one of their views' `when` holds; `workbench.view.extension.<id>` opens one, a single view merges with it ("<container>: <view>" title), several views are view_panes.rs panes (`PaneContainer::Contributed`, state in `workbench.view.extension.<id>.state`) with sashes, header drag and the Views submenu. Testing is the same `PaneContainer::Contributed("workbench.view.extension.test")`: the Test Explorer (when a controller registers, testing.contribution.ts `providerCount`) first, views contributed to `test` after it; the container shows while it has a view, and a single contributed view merges under the title "Testing" (`alwaysUseContainerInfo`, ui-pair port/fixtures/ui-pair/contributed-panes.json with `port/fixtures/extensions/contributed-panes`). A tree view without a data provider shows treeView.ts `noDataProviderMessage`. Every contributed tree view registers `<view id>.focus` and sets `<view id>.active`. Not ported yet: `viewsContainers.panel`, the compact activity bar's contributed items, an extension container's "View: Show <title>" Command Palette entry.
- 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`.