Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(views): draw extension viewsContainers.panel containers in the panel

rokarturd8cc426d2595
diff --git a/README.md b/README.md
index 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
```mermaid
pie 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/workbench/activity_bar_menu.rs b/native/crates/app/src/workbench/activity_bar_menu.rs
index bacd7104746..7a71bb484dc 100644
--- a/native/crates/app/src/workbench/activity_bar_menu.rs
+++ b/native/crates/app/src/workbench/activity_bar_menu.rs
@@ -27,7 +27,7 @@ impl Workbench {
containers.push(("workbench.view.testing", "Testing"));
}
for container in &self.tree_views.containers {
- if !self.shown_views_of(&container.key).is_empty() {
+ if container.location == super::layout::Part::SideBar && !self.shown_views_of(&container.key).is_empty() {
containers.push((container.id, super::tree_view::static_id(&container.title)));
}
}
diff --git a/native/crates/app/src/workbench/panel.rs b/native/crates/app/src/workbench/panel.rs
index 774f5f7d54d..c7ae48c97ae 100644
--- a/native/crates/app/src/workbench/panel.rs
+++ b/native/crates/app/src/workbench/panel.rs
@@ -332,6 +332,13 @@ impl Workbench {
tabs.push(CompositeTab { id: view.id, title: view.title, view: view.view_id });
}
}
+ // viewsExtensionPoint.ts: an extension's panel containers order after the built-in ones and `hideIfEmpty`.
+ for id in self.contributed_panel_containers() {
+ if self.view_container_part(id) == part && let Some(view) = self.views_in(id).into_iter().find(|view| self.view_when_holds(view)) {
+ let title = self.tree_views.containers.iter().find(|container| container.id == id).expect("a contributed container").title.as_str();
+ tabs.push(CompositeTab { id, title: super::tree_view::static_id(title), view: view.id });
+ }
+ }
for id in self.generated_containers_in(part) {
let view = self.generated_container_view(id).expect("a container with a view");
tabs.push(CompositeTab { id, title: view.name, view: view.id });
@@ -339,6 +346,11 @@ impl Workbench {
tabs
}
+ /// The extensions' `viewsContainers.panel` containers.
+ pub(super) fn contributed_panel_containers(&self) -> Vec<&'static str> {
+ self.tree_views.containers.iter().filter(|container| container.location == Part::Panel).map(|container| container.id).collect()
+ }
+
/// The part's last active view, else its default: Terminal in the panel (terminal.contribution.ts registers it
/// with `isDefault`), the first container in the secondary side bar.
pub(super) fn active_container_in(&self, part: Part) -> Option<&'static str> {
@@ -423,7 +435,7 @@ impl Workbench {
_ => None,
});
let progress_bars = active.into_iter().chain(merged_view).filter_map(|scope| self.scoped_progress_bar(scope)).map(|bar| bar.top(px(-2.)));
- let view_actions = merged_view.zip(view_actions);
+ let view_actions = merged_view.or(active).zip(view_actions);
self.pane_composite_card(part, background)
.on_drag_move(cx.listener(move |workbench, event: &DragMoveEvent<DraggedComposite>, _, cx| {
let over = event.bounds.contains(&event.event.position);
@@ -458,7 +470,7 @@ impl Workbench {
}
/// The container's content and title actions: a single view merged into it (its body, its actions in the
- /// composite title), several as panes.
+ /// composite title), several as panes with the container's "..." (`MenuId.ViewContainerTitle`).
fn panel_container_content(&mut self, container: &'static str, window: &mut Window, cx: &mut Context<Self>) -> (AnyElement, Option<AnyElement>) {
let views: Vec<&'static str> = self.views_in(container).into_iter().filter(|view| self.movable_view_shown(view)).map(|view| view.id).collect();
if let [view] = views[..] {
@@ -470,11 +482,12 @@ impl Workbench {
let horizontal = part == Part::Panel && self.arrangement().panel.is_horizontal();
let content = self.composite_bar(part).content_bounds.get().size;
let size = f32::from(if horizontal { content.width } else { content.height });
- let generated = super::view_panes::PaneContainer::Generated(container);
- self.layout_panes(generated, size, views.iter().map(|&view| (view, false)).collect(), horizontal, cx);
+ let panes_of = super::view_locations::pane_container(container);
+ self.layout_panes(panes_of, size, views.iter().map(|&view| (view, false)).collect(), horizontal, cx);
let panes = views.into_iter().map(|view| self.movable_view_pane(view, window, cx)).collect();
- let ordered = self.ordered_panes(&self.panes(generated).view.as_ref().expect("laid out above").ids(), panes, window, cx);
- (self.pane_view_element(generated, ordered, window, cx).into_any_element(), None)
+ let ordered = self.ordered_panes(&self.panes(panes_of).view.as_ref().expect("laid out above").ids(), panes, window, cx);
+ let more = self.has_view_toggle(panes_of.key()).then(|| self.action_bar_item(container, "more", self.view_container_more_actions(panes_of.key(), cx), cx).into_any_element());
+ (self.pane_view_element(panes_of, ordered, window, cx).into_any_element(), more)
}
fn composite_bar(&self, part: Part) -> &CompositeBar {
diff --git a/native/crates/app/src/workbench/tree_view.rs b/native/crates/app/src/workbench/tree_view.rs
index 1352b916d4b..346a8f8dde7 100644
--- a/native/crates/app/src/workbench/tree_view.rs
+++ b/native/crates/app/src/workbench/tree_view.rs
@@ -191,9 +191,10 @@ pub(super) fn accessibility_help_content(extension: &exthost::scan::ScannedExten
impl Workbench {
pub(crate) fn set_tree_views(&mut self, extensions: &[exthost::scan::ScannedExtension]) {
+ let mut previous: Vec<_> = self.tree_views.containers.iter().map(|container| container.id.to_owned()).collect();
+ previous.extend(self.tree_views.views.iter().map(|view| format!("{}.focus", view.id)));
+ self.quick_access.menu.retain(|item| !previous.contains(&item.id));
self.tree_views.views = contributed_views(extensions);
- let previous: Vec<_> = self.tree_views.containers.iter().map(|container| container.id).collect();
- self.quick_access.menu.retain(|item| !previous.contains(&item.id.as_str()));
self.tree_views.containers = super::view_containers::contributed_view_containers(extensions);
self.register_view_container_commands();
}
diff --git a/native/crates/app/src/workbench/view_containers.rs b/native/crates/app/src/workbench/view_containers.rs
index 71ecdedb181..17b1fd49830 100644
--- a/native/crates/app/src/workbench/view_containers.rs
+++ b/native/crates/app/src/workbench/view_containers.rs
@@ -1,7 +1,7 @@
-//! 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, and the `<view id>.focus` and `workbench.view.extension.<id>` commands.
-// Not ported yet: `viewsContainers.panel` (port/ledger.md, workbench/services/views).
+//! The view containers extensions contribute (viewsExtensionPoint.ts `viewsContainers.activitybar` and `panel`) and
+//! the tree views of every container (viewsService.ts): the activity bar items of side bar containers with an active
+//! view, their side bar, the panel tabs of panel containers (panel.rs), and the `<view id>.focus` and
+//! `workbench.view.extension.<id>` commands.
use std::collections::HashMap;
use std::path::PathBuf;
@@ -27,6 +27,8 @@ pub(super) struct ViewContainer {
pub key: String,
pub title: String,
pub icon: ContainerIcon,
+ /// The contributed location: `Part::SideBar` for `activitybar`, `Part::Panel` for `panel`.
+ pub location: Part,
}
pub(super) enum ContainerIcon {
@@ -34,18 +36,21 @@ pub(super) enum ContainerIcon {
File(PathBuf),
}
-/// `registerCustomViewContainers` for the activity bar, in extension order.
+/// `registerCustomViewContainers` for the activity bar and the panel, in extension order.
pub(super) fn contributed_view_containers(extensions: &[exthost::scan::ScannedExtension]) -> Vec<ViewContainer> {
let mut containers = Vec::new();
for (extension, location, descriptor) in valid_view_containers(extensions) {
- if location == "activitybar" {
- let (Some(key), Some(title), Some(icon)) = (descriptor["id"].as_str(), descriptor["title"].as_str(), descriptor["icon"].as_str()) else { continue };
- let icon = match icon.strip_prefix("$(").and_then(|name| name.strip_suffix(')')) {
- Some(name) => ContainerIcon::Codicon(name.to_owned()),
- None => ContainerIcon::File(extension.location.join(icon)),
- };
- containers.push(ViewContainer { id: static_id(&format!("workbench.view.extension.{key}")), key: key.to_owned(), title: title.to_owned(), icon });
- }
+ let location = match location {
+ "activitybar" => Part::SideBar,
+ "panel" => Part::Panel,
+ _ => continue,
+ };
+ let (Some(key), Some(title), Some(icon)) = (descriptor["id"].as_str(), descriptor["title"].as_str(), descriptor["icon"].as_str()) else { continue };
+ let icon = match icon.strip_prefix("$(").and_then(|name| name.strip_suffix(')')) {
+ Some(name) => ContainerIcon::Codicon(name.to_owned()),
+ None => ContainerIcon::File(extension.location.join(icon)),
+ };
+ containers.push(ViewContainer { id: static_id(&format!("workbench.view.extension.{key}")), key: key.to_owned(), title: title.to_owned(), icon, location });
}
containers
}
@@ -100,20 +105,25 @@ impl Workbench {
Outcome::done()
});
}
- // viewsService.ts `registerOpenViewContainerAction`, f1: "Show <title>" in the side bar.
+ // viewsService.ts `registerOpenViewContainerAction`, f1: "Show <title>" in the side bar, else "Toggle <title>".
let enabled = Expr::deserialize(&format!("viewContainer.{id}.enabled"));
- let title = format!("Show {}", container.title);
+ let verb = if container.location == Part::SideBar { "Show" } else { "Toggle" };
+ let title = format!("{verb} {}", container.title);
self.quick_access.menu.push(MenuItem { id: id.into(), title, category: Some("View".into()), description: None, when: enabled.clone(), precondition: enabled, source: None });
}
for view in &self.tree_views.views {
let id = view.id;
let command = format!("{id}.focus");
if self.commands.get(&command).is_none() {
- self.commands.register(command, move |workbench, _, window, cx| {
+ self.commands.register(command.clone(), move |workbench, _, window, cx| {
workbench.open_tree_view(id, true, window, cx);
Outcome::done()
});
}
+ // viewsService.ts `registerFocusViewAction`: "Focus on <name> View", its default container's title as category.
+ let category = self.tree_view_default_container(&view.container).map(|(container, _)| self.container_title(container));
+ let title = format!("Focus on {} View", view.name);
+ self.quick_access.menu.push(MenuItem { id: command, title, category, description: None, when: view.when.clone(), precondition: None, source: None });
}
}
@@ -177,10 +187,24 @@ impl Workbench {
}
}
- /// `openViewContainer(id, true)` of a contributed container.
+ /// `openViewContainer(id, true)` of a contributed container; a panel one that shows with the focus in the panel
+ /// closes (`OpenViewContainerAction.run`).
fn open_view_container(&mut self, id: &'static str, window: &mut Window, cx: &mut Context<Self>) {
- self.side_bar_view = SideBarView::Contributed(id);
- self.set_part_hidden(Part::SideBar, false, cx);
+ let part = self.container_location(id);
+ if part != Part::SideBar {
+ let focused = match self.focused_part(window, cx) {
+ Some(super::part_navigation::FocusPart::Panel) => Part::Panel,
+ Some(super::part_navigation::FocusPart::AuxiliaryBar) => Part::AuxiliaryBar,
+ _ => Part::SideBar,
+ };
+ if self.panel_view_visible(id) && focused == part {
+ return self.close_panel_view(id, cx);
+ }
+ self.show_panel_container(id, cx);
+ } else {
+ self.side_bar_view = SideBarView::Contributed(id);
+ self.set_part_hidden(Part::SideBar, false, cx);
+ }
if let Some(first) = self.container_views(id).first().copied() {
self.focus_tree_view(first, window, cx);
}
@@ -218,8 +242,12 @@ impl Workbench {
}
key => {
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);
+ if self.container_location(container) == Part::SideBar {
+ self.side_bar_view = SideBarView::Contributed(container);
+ self.set_part_hidden(Part::SideBar, false, cx);
+ } else {
+ self.show_panel_container(container, cx);
+ }
self.expand_pane(PaneContainer::Contributed(container), id, cx);
}
}
@@ -244,10 +272,11 @@ impl Workbench {
self.shown_views_of(&container.key).into_iter().filter(|view| self.stays_in(view, id)).collect()
}
- /// Whether a contributed view's tree shows: its container in the visible side bar and the view expanded.
+ /// Whether a contributed view's tree shows: its container visible and the view expanded.
pub(super) fn tree_view_body_visible(&self, id: &'static str) -> bool {
let Some(view) = self.tree_views.views.iter().find(|view| view.id == id) else { return false };
- if self.movable_view(id).is_some_and(|movable| self.view_container(&movable) != movable.default_container) {
+ let container = self.movable_view(id).map(|movable| (self.view_container(&movable), movable.default_container));
+ if container.is_some_and(|(current, default)| current != default || self.container_location(current) != Part::SideBar) {
return self.is_view_visible(id);
}
if !self.is_part_visible(Part::SideBar) || !self.shown_views_of(&view.container).contains(&id) {
@@ -284,7 +313,7 @@ impl Workbench {
let mut items = Vec::new();
let unpinned = self.unpinned_containers();
for container in &self.tree_views.containers {
- if self.shown_views_of(&container.key).is_empty() || unpinned.iter().any(|id| id == container.id) {
+ if container.location != Part::SideBar || self.shown_views_of(&container.key).is_empty() || unpinned.iter().any(|id| id == container.id) {
continue;
}
let id = container.id;
diff --git a/native/crates/app/src/workbench/view_containers/tests.rs b/native/crates/app/src/workbench/view_containers/tests.rs
index 45937c24072..3c300c7deb6 100644
--- a/native/crates/app/src/workbench/view_containers/tests.rs
+++ b/native/crates/app/src/workbench/view_containers/tests.rs
@@ -10,6 +10,7 @@ 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::view_panes::{OUTLINE_VIEW, PaneContainer, TIMELINE_VIEW};
#[gpui::test]
@@ -211,4 +212,57 @@ fn an_extension_container_is_shown_from_the_command_palette(cx: &mut TestAppCont
let labels = workbench.read_with(cx, |workbench, _| workbench.quick_inputs.current().unwrap().rows.iter().map(|row| row.item.label.clone()).collect::<Vec<_>>());
// set_tree_views runs twice, as after an install: the entry is not doubled.
assert_eq!(labels.iter().filter(|label| *label == "View: Show Port Panes").count(), 1, "{labels:?}");
+ // viewsService.ts `registerFocusViewAction`, categorized by the view's container.
+ for label in ["Port Panes: Focus on First View", "Port Panel: Focus on Panel First View", "Testing: Focus on Test Sample View"] {
+ assert_eq!(labels.iter().filter(|shown| *shown == label).count(), 1, "{label}: {labels:?}");
+ }
+}
+
+/// viewsExtensionPoint.ts `viewsContainers.panel`: the container is a panel tab, not an activity bar item, its views
+/// draw as panes under the container's "...", and viewsService.ts `OpenViewContainerAction` "View: Toggle <title>"
+/// opens it, then closes it from inside the panel.
+#[gpui::test]
+fn an_extension_panel_container_is_a_panel_tab(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 fixture = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../../port/fixtures/extensions/contributed-panes");
+ let extension = scan_extension(&fixture, false).unwrap();
+ let (workbench, cx) = cx.add_window_view(|_, cx| {
+ let mut workbench = Workbench::new(theme, app_root.clone(), None, Languages::new(&[]), crate::default_settings(), HostSync::new(std::sync::mpsc::channel().0), cx);
+ workbench.set_tree_views(std::slice::from_ref(&extension));
+ workbench
+ });
+ let container = "workbench.view.extension.portPanel";
+ workbench.read_with(cx, |workbench, _| {
+ let tab = workbench.part_tabs(Part::Panel).into_iter().find(|tab| tab.id == container).expect("a panel tab");
+ assert_eq!((tab.title, tab.view), ("Port Panel", "portPanel.first"));
+ assert!(workbench.activity_bar_containers().iter().all(|(id, _)| *id != container));
+ assert_eq!(workbench.container_location(container), Part::Panel);
+ });
+
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("workbench.action.showCommands", Vec::new(), window, cx)));
+ cx.run_until_parked();
+ let labels = workbench.read_with(cx, |workbench, _| workbench.quick_inputs.current().unwrap().rows.iter().map(|row| row.item.label.clone()).collect::<Vec<_>>());
+ assert!(labels.iter().any(|label| label == "View: Toggle Port Panel"), "{labels:?}");
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("workbench.action.closeQuickOpen", Vec::new(), window, cx)));
+
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command(container, Vec::new(), window, cx)));
+ cx.update(|window, cx| {
+ window.activate_window();
+ drop(window.draw(cx));
+ });
+ cx.run_until_parked();
+ workbench.read_with(cx, |workbench, _| {
+ assert_eq!(workbench.active_panel_id(), Some(container));
+ assert!(workbench.is_view_visible("portPanel.first") && workbench.is_view_visible("portPanel.second"));
+ assert!(workbench.tree_view_body_visible("portPanel.first"));
+ });
+ workbench.update(cx, |workbench, cx| {
+ let more = workbench.action_bar_focus(container, "more", cx);
+ assert!(workbench.drawn_action_bar_items(container).contains(&more), "the container's \"...\" draws in the panel title");
+ });
+
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command(container, Vec::new(), window, cx)));
+ workbench.read_with(cx, |workbench, _| assert!(!workbench.is_part_visible(Part::Panel)));
}
diff --git a/native/crates/app/src/workbench/view_locations.rs b/native/crates/app/src/workbench/view_locations.rs
index 80ff60407ac..4bf94be50a5 100644
--- a/native/crates/app/src/workbench/view_locations.rs
+++ b/native/crates/app/src/workbench/view_locations.rs
@@ -125,7 +125,7 @@ impl Workbench {
/// The container a `contributes.views` key names, with its codicon, which a contributed view takes as its
/// `containerIcon`.
// A view's own `icon` and a container's file icon draw as the window codicon (port/notes.md, milestone 11).
- fn tree_view_default_container(&self, key: &str) -> Option<(&'static str, &'static str)> {
+ pub(super) fn tree_view_default_container(&self, key: &str) -> Option<(&'static str, &'static str)> {
match key {
"explorer" => Some((EXPLORER_CONTAINER, "files")),
"scm" => Some((SCM_CONTAINER, "source-control")),
@@ -167,6 +167,7 @@ impl Workbench {
fn container_ids(&self) -> Vec<&'static str> {
let mut ids = self.side_bar_container_ids();
ids.extend(self.panel.views.iter().map(|view| view.id));
+ ids.extend(self.contributed_panel_containers());
ids.extend(self.generated_containers());
ids
}
@@ -181,7 +182,7 @@ impl Workbench {
fn side_bar_container_ids(&self) -> Vec<&'static str> {
let mut ids = SIDE_BAR_CONTAINERS.to_vec();
ids.push(TESTING_CONTAINER);
- ids.extend(self.tree_views.containers.iter().map(|container| container.id));
+ ids.extend(self.tree_views.containers.iter().filter(|container| container.location == Part::SideBar).map(|container| container.id));
ids
}
@@ -293,7 +294,7 @@ impl Workbench {
let container = self.view_container(&view);
match self.container_location(container) {
Part::SideBar => self.side_bar_visible_container() == Some(container) && self.view_pane_expanded(pane_container(container), id),
- part => self.is_part_visible(part) && self.active_container_in(part) == Some(container) && (self.views_in(container).len() == 1 || self.view_pane_expanded(PaneContainer::Generated(container), id)),
+ part => self.is_part_visible(part) && self.active_container_in(part) == Some(container) && (self.views_in(container).len() == 1 || self.view_pane_expanded(pane_container(container), id)),
}
}
@@ -470,7 +471,7 @@ impl Workbench {
for part in [Part::SideBar, Part::Panel, Part::AuxiliaryBar] {
let mut ids: Vec<&'static str> = match part {
Part::SideBar => self.side_bar_container_ids(),
- _ => self.panel.views.iter().filter(|view| self.view_container_part(view.id) == part).map(|view| view.id).collect(),
+ _ => self.panel.views.iter().map(|view| view.id).chain(self.contributed_panel_containers()).filter(|id| self.view_container_part(id) == part).collect(),
};
ids.extend(self.generated_containers_in(part));
for id in ids {
@@ -481,7 +482,7 @@ impl Workbench {
}
/// `ViewContainerModel.title`.
- fn container_title(&self, id: &str) -> String {
+ pub(super) fn container_title(&self, id: &str) -> String {
if let Some(container) = self.tree_views.containers.iter().find(|container| container.id == id) {
return container.title.clone();
}
diff --git a/native/crates/app/src/workbench/view_panes.rs b/native/crates/app/src/workbench/view_panes.rs
index e5e75f46061..d37e175957a 100644
--- a/native/crates/app/src/workbench/view_panes.rs
+++ b/native/crates/app/src/workbench/view_panes.rs
@@ -389,7 +389,8 @@ impl Workbench {
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();
+ let side_bar = self.tree_views.containers.iter().filter(|container| container.location == super::layout::Part::SideBar);
+ let containers: Vec<_> = side_bar.map(|container| (container.id, self.contributed_panes(&container.key))).collect();
for (container, own) in containers {
self.layout_container(PaneContainer::Contributed(container), height, own, cx);
}
diff --git a/port/fixtures/extensions/contributed-panes/package.json b/port/fixtures/extensions/contributed-panes/package.json
index 561fdaea6a2..379b0a800d8 100644
--- a/port/fixtures/extensions/contributed-panes/package.json
+++ b/port/fixtures/extensions/contributed-panes/package.json
@@ -6,7 +6,8 @@
"engines": { "vscode": "^1.90.0" },
"contributes": {
"viewsContainers": {
- "activitybar": [{ "id": "portPanes", "title": "Port Panes", "icon": "$(package)" }]
+ "activitybar": [{ "id": "portPanes", "title": "Port Panes", "icon": "$(package)" }],
+ "panel": [{ "id": "portPanel", "title": "Port Panel", "icon": "$(package)" }]
},
"views": {
"portPanes": [
@@ -14,6 +15,10 @@
{ "id": "portPanes.second", "name": "Second" },
{ "id": "portPanes.third", "name": "Third", "visibility": "collapsed" }
],
+ "portPanel": [
+ { "id": "portPanel.first", "name": "Panel First" },
+ { "id": "portPanel.second", "name": "Panel Second" }
+ ],
"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
index 8140d6ef6c8..a06c5d4d481 100644
--- a/port/fixtures/ui-pair/contributed-panes.json
+++ b/port/fixtures/ui-pair/contributed-panes.json
@@ -5,5 +5,13 @@
{ "shot": "containers" },
{ "click": [26, 276] },
{ "wait": 1500 },
- { "shot": "testing" }
+ { "shot": "testing" },
+ { "hotkey": ["cmd", "shift", "p"] },
+ { "wait": 800 },
+ { "type": "toggle port panel" },
+ { "wait": 800 },
+ { "shot": "palette" },
+ { "key": "return" },
+ { "wait": 1500 },
+ { "shot": "panel" }
]
diff --git a/port/ledger.md b/port/ledger.md
index 75946b6522f..aba159abd00 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_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>` with its "View: Show <title>" Command Palette item while `viewContainer.<id>.enabled` (cargo test -p app an_extension_container_is_shown), `<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, a moved view's hidden state is in its current container's state (cargo test -p app a_moved_view_is_hidden); 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 | verified | | view containers of `viewsContainers.activitybar` and `viewsContainers.panel` and the tree views of every container (workbench/view_containers.rs): activity bar items while a view's `when` holds, `workbench.view.extension.<id>` with its "View: Show <title>" Command Palette item while `viewContainer.<id>.enabled` (cargo test -p app an_extension_container_is_shown), a panel container's tab after the built-in ones, its views as side-by-side panes under its "..." and "View: Toggle <title>" (cargo test -p app an_extension_panel_container_is_a_panel_tab), each contributed view's "<container>: Focus on <view> View" palette item (ui-pair port/fixtures/ui-pair/contributed-panes.json "palette" and "panel" match the reference but its Ports tab, removed by decision), `<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, a moved view's hidden state is in its current container's state (cargo test -p app a_moved_view_is_hidden); 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 dabef23f156..80bb6fb79ac 100644
--- a/port/notes.md
+++ b/port/notes.md
@@ -603,7 +603,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 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 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`. `viewsContainers.panel` containers are panel tabs after the built-in ones (panel.rs `part_containers`, `hideIfEmpty`), their views panes laid side by side in a bottom panel under the container's "..." (the Views submenu); their "View: Toggle <title>" closes the panel when it shows with the focus in it (viewsService.ts `OpenViewContainerAction`). Every contributed view lists "<container>: Focus on <view> View" in the Command Palette while its `when` holds (`registerFocusViewAction`). Not ported yet: the compact activity bar's contributed items.
- 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`.