Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(editor): show modalEditor/editorTitle actions in the modal header

rokartur13bdcb33b1c2
diff --git a/native/crates/app/src/menus.rs b/native/crates/app/src/menus.rs
index 48db584dfd5..e5e7e384905 100644
--- a/native/crates/app/src/menus.rs
+++ b/native/crates/app/src/menus.rs
@@ -70,6 +70,8 @@ pub enum MenuId {
/// `MenuId.EmptyEditorGroupContext`: the context menu of an empty editor group.
EmptyEditorGroupContext,
StickyScrollContext,
+ /// `MenuId.ModalEditorEditorTitle`: the modal editor part's editor actions.
+ ModalEditorEditorTitle,
/// `MenuId.TitleBar`: the title bar's global toolbar.
TitleBar,
TitleBarContext,
@@ -971,7 +973,7 @@ pub fn workbench_menus() -> Vec<MenuItem> {
/// menusExtensionPoint.ts `apiMenus`: the `contributes.menus` keys of the menus the port shows. `commandPalette`
/// is read by `command_palette::menu`.
-const API_MENUS: [(&str, MenuId); 59] = [
+const API_MENUS: [(&str, MenuId); 60] = [
("file/newFile", MenuId::NewFile),
("editor/context", MenuId::EditorContext),
("explorer/context", MenuId::ExplorerContext),
@@ -1029,6 +1031,7 @@ const API_MENUS: [(&str, MenuId); 59] = [
("comments/commentThread/comment/context", MenuId::CommentThreadCommentContext),
("mergeEditor/result/title", MenuId::MergeInputResultToolbar),
("titleBar", MenuId::TitleBar),
+ ("modalEditor/editorTitle", MenuId::ModalEditorEditorTitle),
("terminal/context", MenuId::TerminalInstanceContext),
("terminal/title/context", MenuId::TerminalTabContext),
];
diff --git a/native/crates/app/src/workbench/keybindings_editor_view.rs b/native/crates/app/src/workbench/keybindings_editor_view.rs
index 514b7ba7826..03d40f3d124 100644
--- a/native/crates/app/src/workbench/keybindings_editor_view.rs
+++ b/native/crates/app/src/workbench/keybindings_editor_view.rs
@@ -108,6 +108,8 @@ pub(super) struct ModalHeader {
pub json_command: &'static str,
/// A text editor's file icon, name and description, drawn in place of `icon` and `title`.
pub resource: Option<AnyElement>,
+ /// The arguments of the editor actions: a text editor's resource.
+ pub args: Vec<Value>,
}
pub struct KeybindingsEditor {
@@ -881,7 +883,7 @@ impl Workbench {
/// The modal editor part: the dimmed window, the dialog with its header, and the Keyboard Shortcuts editor.
pub(super) fn keybindings_editor_widget(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
- let header = ModalHeader { icon: "record-keys", title: "Keyboard Shortcuts", json_title: "Open Keyboard Shortcuts (JSON)", json_command: "workbench.action.openGlobalKeybindingsFile", resource: None };
+ let header = ModalHeader { icon: "record-keys", title: "Keyboard Shortcuts", json_title: "Open Keyboard Shortcuts (JSON)", json_command: "workbench.action.openGlobalKeybindingsFile", resource: None, args: Vec::new() };
let focus = self.keybindings_editor.modal_focus.clone();
self.modal_editor_part(header, &focus, window, cx, |workbench, width, height, window, cx| workbench.keybindings_editor_pane(width, height, window, cx).into_any_element())
}
@@ -932,6 +934,11 @@ impl Workbench {
let top = ((window_height - height) / 2.).max(TITLE_BAR_HEIGHT).round();
let editor_height = height - 2. - MODAL_HEADER_HEIGHT - 1.;
let editor = editor(self, width - 2., editor_height, window, cx);
+ // The editor actions see the context of the modal group's text editor.
+ let context = match header.resource {
+ Some(_) => self.with_group(crate::editor::MODAL_GROUP, |workbench| workbench.key_context(window)),
+ None => self.key_context(window),
+ };
let modal = div()
.id("modal-editor")
.debug_selector(|| "modal-editor".into())
@@ -953,7 +960,7 @@ impl Workbench {
// --vscode-shadow-xl blurs 20px; GPUI's blur_radius is the sigma, half the CSS blur.
.shadow(vec![BoxShadow { color: rgba(0x00000026).into(), offset: point(px(0.), px(0.)), blur_radius: px(10.), spread_radius: px(0.), inset: false }])
.on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation())
- .child(self.modal_header(header, cx))
+ .child(self.modal_header(header, context, cx))
.child(editor);
let block = div()
.id("modal-editor-block")
@@ -973,8 +980,9 @@ impl Workbench {
}
/// `.modal-editor-header`: the editor's icon and title, and the `ModalEditorTitle` actions.
- fn modal_header(&self, header: ModalHeader, cx: &mut Context<Self>) -> impl IntoElement + use<> {
+ fn modal_header(&self, header: ModalHeader, context: HashMap<String, Value>, cx: &mut Context<Self>) -> impl IntoElement + use<> {
let foreground = self.foreground_or("titleBar.activeForeground");
+ let (mut editor_actions, more) = self.modal_editor_menu_actions(&header.args, context, foreground, cx);
let action = |name: &'static str, title: &'static str, command: &'static str| {
self.icon(name, 22., 16., foreground)
.id(command)
@@ -1013,16 +1021,58 @@ impl Workbench {
Some(resource) => row.child(div().flex_1().min_w_0().flex().items_center().text_size(px(12.)).child(resource)),
None => row.child(self.icon(header.icon, 16., 16., foreground).mr(px(6.))).child(div().flex_1().text_size(px(12.)).font_weight(FontWeight::SEMIBOLD).truncate().child(header.title)),
})
- // `ModalEditorEditorTitle`, then a separator and `ModalEditorTitle`, 4px apart.
- // The Profiles editor has no JSON action and no separator.
- .when(!header.json_command.is_empty(), |row| {
- row.child(action("go-to-file", header.json_title, header.json_command)).child(div().mx(px(4.)).w(px(1.)).h(px(16.)).bg(foreground).opacity(0.3))
+ // `ModalEditorEditorTitle`, then a separator and `ModalEditorTitle`, 4px apart; the separator only
+ // follows editor actions.
+ .map(|row| {
+ if !header.json_command.is_empty() {
+ // preferences.contribution.ts: Open Keyboard Shortcuts (JSON) has no order, the others order 1.
+ let order = if header.json_command == "workbench.action.openGlobalKeybindingsFile" { 0. } else { 1. };
+ editor_actions.push((order, header.json_title.to_string(), action("go-to-file", header.json_title, header.json_command)));
+ }
+ // menuService.ts compareMenuItems: by order, then by title.
+ editor_actions.sort_by(|a, b| a.0.total_cmp(&b.0).then_with(|| crate::command_palette::locale_compare(&a.1, &b.1)));
+ let shown = !editor_actions.is_empty() || more.is_some();
+ row.children(editor_actions.into_iter().map(|(_, _, action)| action)).children(more).when(shown, |row| row.child(div().mx(px(4.)).w(px(1.)).h(px(16.)).bg(foreground).opacity(0.3)))
})
.child(action("open-in-product", "Open Modal Editor in Main Window", "workbench.action.moveModalEditorToMain"))
.child(action(if self.keybindings_editor.maximized { "screen-normal" } else { "screen-full" }, maximize_title, "workbench.action.toggleModalEditorMaximized").ml(px(4.)))
.child(action("close", "Close Modal Editor", CLOSE_MODAL_COMMAND).ml(px(4.)))
}
+ /// modalEditorPart.ts `createEditorActions(MenuId.ModalEditorEditorTitle)`: the menu's `navigation` items with
+ /// their orders, and a `...` with its other groups.
+ fn modal_editor_menu_actions(&self, args: &[Value], context: HashMap<String, Value>, foreground: gpui::Rgba, cx: &mut Context<Self>) -> (Vec<(f64, String, gpui::Stateful<gpui::Div>)>, Option<gpui::Stateful<gpui::Div>>) {
+ let menu = crate::menus::MenuId::ModalEditorEditorTitle;
+ let mut buttons = Vec::new();
+ for item in self.menus.iter().filter(|item| item.menu == menu && item.group == "navigation" && item.when.as_ref().is_none_or(|when| when.evaluate(&context))) {
+ // shortcut: a submenu gets no dropdown button, port SubmenuItemActionViewItem when an extension needs one.
+ let crate::menus::Entry::Command { id, .. } = &item.entry else { continue };
+ let selector = format!("modal-editor-action-{id}");
+ buttons.push((item.order, item.title.clone(), self.command_button(id, item.title.clone(), args.to_vec(), foreground, cx).debug_selector(move || selector)));
+ }
+ let secondary = crate::menus::menu_group_actions(&self.menus, menu, &context, |group| group != "navigation");
+ if secondary.is_empty() {
+ return (buttons, None);
+ }
+ let bounds = std::rc::Rc::new(std::cell::Cell::new(gpui::Bounds::default()));
+ let measured = bounds.clone();
+ let args = args.to_vec();
+ let more = self
+ .icon("toolbar-more", 22., 16., foreground)
+ .id("modal-editor-more")
+ .debug_selector(|| "modal-editor-more".into())
+ .rounded(px(4.))
+ .cursor_pointer()
+ .hover(|button| button.bg(self.color("toolbar.hoverBackground")))
+ .child(self.hover_target("modal-editor-more-hover", super::hover::HoverContent::Text("More Actions...".into()), super::hover::HoverOptions::mouse()))
+ .on_mouse_down(MouseButton::Left, cx.listener(move |workbench, _: &gpui::MouseDownEvent, window, cx| {
+ cx.stop_propagation();
+ workbench.show_dropdown_menu_actions(secondary.clone(), &context, bounds.get(), args.clone(), window, cx);
+ }))
+ .child(gpui::canvas(move |element_bounds, _, _| measured.set(element_bounds), |_, _, _, _| {}).absolute().size_full());
+ (buttons, Some(more))
+ }
+
/// `.keybindings-editor`: the header with the search and the table, the define widget over them.
fn keybindings_editor_pane(&mut self, width: f32, height: f32, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement + use<> {
let table_width = width - 27.;
diff --git a/native/crates/app/src/workbench/modal_editor_group.rs b/native/crates/app/src/workbench/modal_editor_group.rs
index 752e75a3fbf..cfb7c831376 100644
--- a/native/crates/app/src/workbench/modal_editor_group.rs
+++ b/native/crates/app/src/workbench/modal_editor_group.rs
@@ -230,13 +230,13 @@ impl Workbench {
_ => Some(self.keybindings_editor_widget(window, cx)),
};
}
- let (resource, json_title, json_command) = self.with_group(MODAL_GROUP, |workbench| {
+ let (resource, json_title, json_command, uri) = self.with_group(MODAL_GROUP, |workbench| {
let editor = workbench.editors.active().expect("an open modal group has an active editor");
let path = editor.document().path.clone();
let (json_title, json_command) = workbench.modal_editor_title_action(&path);
- (workbench.modal_resource_label(editor), json_title, json_command)
+ (workbench.modal_resource_label(editor), json_title, json_command, editor.document().uri())
});
- let header = ModalHeader { icon: "", title: "", json_title, json_command, resource: Some(resource) };
+ let header = ModalHeader { icon: "", title: "", json_title, json_command, resource: Some(resource), args: vec![uri] };
let focus = self.editor_focus.clone();
Some(self.modal_editor_part(header, &focus, window, cx, |workbench, _, _, window, cx| {
let body = |workbench: &mut Self, window: &mut Window, cx: &mut Context<Self>| {
diff --git a/native/crates/app/src/workbench/modal_editor_group/tests.rs b/native/crates/app/src/workbench/modal_editor_group/tests.rs
index d7658d3e7d1..0fadceb5b06 100644
--- a/native/crates/app/src/workbench/modal_editor_group/tests.rs
+++ b/native/crates/app/src/workbench/modal_editor_group/tests.rs
@@ -115,6 +115,43 @@ fn preferences_window<'a>(cx: &'a mut TestAppContext, name: &str) -> (gpui::Enti
(workbench, cx, dir)
}
+/// modalEditorPart.ts `createEditorActions(MenuId.ModalEditorEditorTitle)`: the menu's `navigation` items whose
+/// `when` holds for the modal's editor sort with the preferences JSON actions by order, then title; its other groups
+/// go to a `...`.
+#[gpui::test]
+fn the_modal_header_shows_the_modal_editor_title_menu(cx: &mut TestAppContext) {
+ use crate::menus::{Entry, MenuAction, MenuId, MenuItem};
+ let (workbench, cx, dir) = preferences_window(cx, "editor-title-menu");
+ workbench.update(cx, |workbench, _| {
+ for (id, group, when) in [("port.modal", "navigation", "resourceFilename == 'keybindings.json'"), ("port.hidden", "navigation", "resourceFilename == 'other.json'"), ("port.modalMore", "1_port", "true"), ("port.tie", "navigation", "true")] {
+ let entry = Entry::Command { id: id.into(), precondition: None, toggled: None, alt: None };
+ workbench.menus.push(MenuItem { menu: MenuId::ModalEditorEditorTitle, entry, title: id.into(), group: group.into(), order: 0., when: crate::contextkey::Expr::deserialize(when) });
+ }
+ });
+ run(&workbench, "workbench.action.openGlobalKeybindingsFile", cx);
+ let modal = cx.debug_bounds("modal-editor-action-port.modal").expect("port.modal is drawn");
+ let open = cx.debug_bounds("workbench.action.openGlobalKeybindings").expect("Open Keyboard Shortcuts is drawn");
+ assert!(modal.left() < open.left(), "order 0 before order 1");
+ assert!(cx.debug_bounds("modal-editor-action-port.hidden").is_none());
+ let more = cx.debug_bounds("modal-editor-more").expect("the overflow holds port.modalMore");
+ cx.simulate_click(more.center(), gpui::Modifiers::default());
+ let titles = workbench.read_with(cx, |workbench, _| {
+ let menu = workbench.context_menu.as_ref().expect("the overflow menu shows");
+ menu.levels[0].actions.iter().filter_map(|action| match action {
+ MenuAction::Command { title, .. } => Some(title.clone()),
+ _ => None,
+ }).collect::<Vec<_>>()
+ });
+ assert_eq!(titles, ["port.modalMore"]);
+
+ cx.simulate_keystrokes("escape");
+ run(&workbench, "workbench.action.openGlobalKeybindings", cx);
+ let json = cx.debug_bounds("workbench.action.openGlobalKeybindingsFile").expect("Open Keyboard Shortcuts (JSON) is drawn");
+ let tie = cx.debug_bounds("modal-editor-action-port.tie").expect("port.tie is drawn");
+ assert!(json.left() < tie.left(), "both order 0: Open Keyboard Shortcuts (JSON) sorts before port.tie by title");
+ std::fs::remove_dir_all(dir).unwrap();
+}
+
fn run(workbench: &gpui::Entity<Workbench>, command: &str, cx: &mut gpui::VisualTestContext) {
workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command(command, vec![], window, cx)));
cx.run_until_parked();
diff --git a/native/crates/app/src/workbench/profiles_editor_view.rs b/native/crates/app/src/workbench/profiles_editor_view.rs
index 7b3c9543c80..ccc0c4ef9be 100644
--- a/native/crates/app/src/workbench/profiles_editor_view.rs
+++ b/native/crates/app/src/workbench/profiles_editor_view.rs
@@ -676,7 +676,7 @@ impl Workbench {
}
pub(super) fn profiles_editor_widget(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
- let header = ModalHeader { icon: "settings", title: "Profiles", json_title: "", json_command: "", resource: None };
+ let header = ModalHeader { icon: "settings", title: "Profiles", json_title: "", json_command: "", resource: None, args: Vec::new() };
let focus = self.user_data_profiles.editor.focus.clone().expect("the editor is open");
self.modal_editor_part(header, &focus, window, cx, |workbench, width, height, window, cx| workbench.profiles_editor_pane(width, height, window, cx))
}
diff --git a/native/crates/app/src/workbench/settings_editor_view.rs b/native/crates/app/src/workbench/settings_editor_view.rs
index a14b5b33ce9..83b7a01c25f 100644
--- a/native/crates/app/src/workbench/settings_editor_view.rs
+++ b/native/crates/app/src/workbench/settings_editor_view.rs
@@ -868,7 +868,7 @@ impl Workbench {
}
pub(super) fn settings_editor_widget(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
- let header = ModalHeader { icon: "settings", title: "Settings", json_title: "Open Settings (JSON)", json_command: "workbench.action.openSettingsJson", resource: None };
+ let header = ModalHeader { icon: "settings", title: "Settings", json_title: "Open Settings (JSON)", json_command: "workbench.action.openSettingsJson", resource: None, args: Vec::new() };
let focus = self.settings_editor.modal_focus.clone();
self.modal_editor_part(header, &focus, window, cx, |workbench, width, height, window, cx| workbench.settings_editor_pane(width, height, window, cx))
}
diff --git a/native/crates/app/src/workbench/workspace_trust_editor.rs b/native/crates/app/src/workbench/workspace_trust_editor.rs
index cf929152616..3d8851e8381 100644
--- a/native/crates/app/src/workbench/workspace_trust_editor.rs
+++ b/native/crates/app/src/workbench/workspace_trust_editor.rs
@@ -83,7 +83,7 @@ impl Workbench {
}
pub(super) fn workspace_trust_editor_widget(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
- let header = ModalHeader { icon: "shield", title: "Workspace Trust", json_title: "", json_command: "", resource: None };
+ let header = ModalHeader { icon: "shield", title: "Workspace Trust", json_title: "", json_command: "", resource: None, args: Vec::new() };
let part_focus = self.trust_editor.part_focus.clone().expect("the editor is open");
self.modal_editor_part(header, &part_focus, window, cx, |workbench, _, _, window, cx| workbench.workspace_trust_editor_part(window, cx).1)
}
diff --git a/port/fixtures/extensions/menus/package.json b/port/fixtures/extensions/menus/package.json
index 115b0c546fd..e1b4fe6387d 100644
--- a/port/fixtures/extensions/menus/package.json
+++ b/port/fixtures/extensions/menus/package.json
@@ -109,6 +109,16 @@
"group": "1_port"
}
],
+ "modalEditor/editorTitle": [
+ {
+ "command": "port.menus.titleNav",
+ "group": "navigation"
+ },
+ {
+ "command": "port.menus.titleMore",
+ "group": "1_port"
+ }
+ ],
"mergeEditor/result/title": [
{
"command": "port.menus.mergeApply",
diff --git a/port/fixtures/ui-pair/menus/modal-editor-title.json b/port/fixtures/ui-pair/menus/modal-editor-title.json
new file mode 100644
index 00000000000..18ff368b009
--- /dev/null
+++ b/port/fixtures/ui-pair/menus/modal-editor-title.json
@@ -0,0 +1,11 @@
+[
+ {"wait": 15000},
+ {"hotkey": ["cmd", "k"]},
+ {"wait": 500},
+ {"hotkey": ["cmd", "s"]},
+ {"wait": 3000},
+ {"shot": "modal"},
+ {"click": [818, 108]},
+ {"wait": 1000},
+ {"shot": "more"}
+]
diff --git a/port/ledger.md b/port/ledger.md
index 85cbfb8269a..f7c36beb347 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -354,7 +354,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/parts/banner | workbench part | M11 | verified | | workbench/banner.rs (bannerPart.ts): one item by priority, icon, message with ellipsis, link actions, Close Banner; Focus Banner, `bannerFocused`, arrow keys through the links and the close button, Enter and Space on them. `cargo test -p app banner`; verified: ui-pair banner.json vs the reference (port/results/windows.md, milestone 11 verification) |
| workbench/parts/chat | workbench part | | removed | | no sign-in/AI by decision (port/notes.md); not ported |
| workbench/parts/dialogs | workbench part | M11 | verified | | workbench/dialog_view.rs custom dialog, used for every message box with `window.dialogStyle: custom` (severity codicons, plain detail); cargo test -p app dialogs; verified: ui-pair dialogs.json `custom-modal` vs the reference (port/results/windows.md, milestone 11 verification): size, buttons in macOS order, Close Dialog; its buttons and Close Dialog are accessibility buttons named by their labels (dialog.ts monaco Buttons, the close action's aria-label): port/tools/update-check pre-release presses "Trust Publisher & Install" through them |
-| workbench/parts/editor | workbench part | M8 | ported | [3 M] keybindings_editor_view.rs `ModalHeader`: the modal part's editor actions are one hardcoded JSON action, not the `modalEditor/editorTitle` menu (modalEditorPart.ts:425 `createEditorActions`): the preferences items with their when-clauses, editor.contribution.ts `enableInModalMode` items and contributed ones | breadcrumbs click, file and outline pickers, `focusAndSelect`, `selectFocused`, `focusNext/PreviousWithPicker`, `revealFocusedFromTreeAside`, `toggleToOn` and `breadcrumbs.useQuickPick` (breadcrumbsControl.ts, breadcrumbsPicker.ts: cargo test -p app workbench::breadcrumbs; verified: ui-pair m8/breadcrumbs-pickers.json with `FILE=src/main.ts`, the picker's place, arrow, rows and icons and the focused last item match the reference), connected tab strip (preview/pinned, close, split and more actions), a dirty tab still open in another group closes without the save prompt (editorGroupView.ts `isOpenedInOtherGroup`: cargo test -p app the_wait_marker_waits_for_the_dirty_file_to_be_saved), breadcrumbs, text editor with gutter, current line, indent guides, word highlight, overview ruler, click, drag and keyboard selection, typing, undo, clipboard, save and dirty tabs (port/notes.md milestone 5): cargo test -p app editor::tests (91), keys_and_typed_text_edit_the_focused_editor_and_reach_the_host; tab context menu (Close, Close Others, Close to the Right, Close Saved, Close All, Keep Open; port/results/contextmenu.md): cargo test -p app editor_menus (8); `_workbench.open` and `vscode.open` (file, untitled with its path, web link, view columns): cargo test -p app workbench_open (3), `_workbench.diff` with the diff editor: cargo test -p app diff_editor; editor groups and splits (split, move, join, focus, tab drag and drop with editorDropTarget.ts split areas): cargo test -p app editor_groups (11), editor_grid (14); locked scrolling (workbench/scroll_locking.rs): cargo test -p app scroll_locking; editorpart.state restored from workspace storage: cargo test -p app the_grid_and_its_editors_come_back_from_workspace_storage; pixel-check file window (port/results/pixels.md milestone 4); all run at the milestone 20 sweep; one group: connected tab strip (preview/pinned, close, split and more actions drawn), breadcrumbs, text editor with gutter, current line, indent guides, word highlight, overview ruler, click, drag and keyboard selection, typing, undo, clipboard, save and dirty tabs (port/notes.md milestone 5); tab context menu with Close, Close Others, Close to the Right, Close Saved, Close All, Keep Open since milestone 9 (port/results/contextmenu.md, cargo test -p app editor_menus); `_workbench.open` and `vscode.open` open a file, an untitled file with its path or a web link (cargo test -p app workbench_open, port/results/api-tests.md M12 `_workbench.open`), every view column in the one group; no `_workbench.diff` (diff editor); editor groups and splits since milestone 11 (split, move, join, focus, tab drag and drop with editorDropTarget.ts split areas; cargo test -p app editor_groups, editor_grid); no scrolling sync; minimap since milestone 8; cargo test -p app (editor::tests, workbench keys_and_typed_text_edit_the_focused_editor_and_reach_the_host); pixel-check file window (port/results/pixels.md milestone 4, unchanged at milestone 5); editorpart.state: the grid and the groups' file editors restored from workspace storage (cargo test -p app the_grid_and_its_editors_come_back_from_workspace_storage); one group: connected tab strip (preview/pinned, close, split and more actions drawn), breadcrumbs, text editor with gutter, current line, indent guides, word highlight, overview ruler, click, drag and keyboard selection, typing, undo, clipboard, save and dirty tabs (port/notes.md milestone 5); tab context menu with Close, Close Others, Close to the Right, Close Saved, Close All, Keep Open since milestone 9 (port/results/contextmenu.md, cargo test -p app editor_menus); `_workbench.open` and `vscode.open` open a file, an untitled file with its path or a web link (cargo test -p app workbench_open, port/results/api-tests.md M12 `_workbench.open`), every view column in the one group; no `_workbench.diff` (diff editor); editor groups and splits since milestone 11 (split, move, join, focus, tab drag and drop with editorDropTarget.ts split areas; cargo test -p app editor_groups, editor_grid); no scrolling sync; minimap since milestone 8; cargo test -p app (editor::tests, workbench keys_and_typed_text_edit_the_focused_editor_and_reach_the_host); pixel-check file window (port/results/pixels.md milestone 4, unchanged at milestone 5); breadcrumbs editor type picker (editor_type_picker.rs, editorTypePicker.ts) for text and diff editors: Text Diff Editor label, `priority.diffEditor` ranks, `workbench.diffEditorAssociations`, Set Default (Diff Only), Open Original/Modified: cargo test -p app editor_type_picker; ui-pair m12/editor-type.json matches, the menus' width included; the editor title's ... menu (MenuId.EditorTitle with Reopen Editor With, the button's `toolbar.activeBackground` while it shows), the empty group context menu (MenuId.EmptyEditorGroupContext) and the watermark shortcuts: ui-pair m11/editor-menus.json and m11/watermark-tips.json (port/results/auxiliary-windows.md), cargo test -p app editor_menus editor_type_picker; the empty group menu's New Terminal; the Text Editor control at a second start, restored from the `memento/customEditors` profile memento as contributedCustomEditors.ts does (cargo test -p app editor_type_picker custom_editors, ui-pair m12/editor-type-second-start.json); terminal editors (terminalEditorService.ts, terminalEditorInput.ts): Create New Terminal in Editor Area, Move Terminal into Editor Area and into the Panel, the terminal tab's context and title menus, `TabInputKind.TerminalEditorInput` tabs (cargo test -p app terminal_editor, ui-pair m12/terminal-editor.json); terminal editors restored after a restart (terminalEditorSerializer.ts); the terminal tab menus' Change Color, Change Icon, Toggle Size to Content Width and Move Terminal into New Window with the color and icon pickers (cargo test -p app terminal_editor icon_select_box, ui-pair m12/terminal-pickers.json and m12/terminal-tab-list-menu.json, m12/editor-type-second-start.json); `workbench.editor.enablePreview` off opens every editor pinned and Toggle Keep Editors pins the preview editor (cargo test -p app previews_off_pins_every_opened_editor); tab labels keep fractional text widths (vendored GPUI elements/text.rs; cargo test -p app tab_labels_keep, ui-pair icons/seti.json); `workbench.editor.showTabs` per part (editorTitleControl.ts): `single` draws singleEditorTabsControl.ts, the active editor's label 35px high, its breadcrumbs inline with `/` while the group is active, else its `workbench.editor.labelFormat` description, the close or unpin action, the actions at half opacity in an inactive group, `none` only the breadcrumbs row, `editorTabsVisible` (workbench/editor_view.rs `single_editor_tab_title`; cargo test -p app show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own; ui-pair `show-tabs.json` with SETTINGS single and none). `workbench.editor.editorActionsLocation` (titlebarPart.ts `editorActionsEnabled`): `titleBar`, or `default` with `showTabs: none`, draws the editor actions in the title bar before the layout controls with their overflow, Customize Layout moves into it (layoutActions.ts `EditorActionsInTitleBar`), the command center names the active file with its dirty dot, `hidden` draws them nowhere, and titlebarActions.ts `ToggleEditorActions` keeps the hidden location in profile storage; the six Show/Hide Editor Tabs commands (layoutActions.ts `AbstractSetShowTabsAction`) and the Editor Actions Position setters with their Tab Bar and Editor Actions Position submenus in View > Appearance and the tab bar's `EditorTabsBarContext` menu (workbench/editor_view.rs `title_bar_has_editor_actions`, workbench/editor_menus.rs `show_tabs_bar_context_menu`; cargo test -p app show_tabs_none_moves_the_editor_actions_into_the_title_bar the_tab_bar_menu_switches_the_tabs_mode the_editor_actions_toggle_restores_the_hidden_location menubar; ui-pair `show-tabs.json` with SETTINGS none: the title bar's split, close, separator, layout controls and `...` and the command center's main.ts match the reference); breadcrumbs focus mode (workbench/breadcrumbs.rs, breadcrumbsControl.ts): Focus Breadcrumbs focuses the last item, Left and Right move the focus, Space and Cmd+Enter reveal the focused file or symbol, Escape focuses the editor, the focused item underlined in `breadcrumb.focusForeground`, `breadcrumbsActive`: cargo test -p app the_keyboard_focuses_moves_through_and_reveals_the_breadcrumbs |
+| workbench/parts/editor | workbench part | M8 | ported | [3 S] keybindings_editor_view.rs `modal_header`: the built-in `modalEditor/editorTitle` items are not menu entries: the preferences ones are one hardcoded JSON action (`modal_editor_title_action`), editor.contribution.ts `enableInModalMode` items (Previous/Next Change, Reopen as Text) are missing; [3 S] keybindings_editor_view.rs `modal_editor_menu_actions`: header buttons are ~3pt narrower than the reference's, the "..." menu opens right-aligned to the button where the reference's is left-aligned, and the "..." draws no active background while open (ui-pair menus/modal-editor-title.json, shot `more`); [3 S] a submenu contributed to `modalEditor/editorTitle` gets no dropdown button | breadcrumbs click, file and outline pickers, `focusAndSelect`, `selectFocused`, `focusNext/PreviousWithPicker`, `revealFocusedFromTreeAside`, `toggleToOn` and `breadcrumbs.useQuickPick` (breadcrumbsControl.ts, breadcrumbsPicker.ts: cargo test -p app workbench::breadcrumbs; verified: ui-pair m8/breadcrumbs-pickers.json with `FILE=src/main.ts`, the picker's place, arrow, rows and icons and the focused last item match the reference), connected tab strip (preview/pinned, close, split and more actions), a dirty tab still open in another group closes without the save prompt (editorGroupView.ts `isOpenedInOtherGroup`: cargo test -p app the_wait_marker_waits_for_the_dirty_file_to_be_saved), breadcrumbs, text editor with gutter, current line, indent guides, word highlight, overview ruler, click, drag and keyboard selection, typing, undo, clipboard, save and dirty tabs (port/notes.md milestone 5): cargo test -p app editor::tests (91), keys_and_typed_text_edit_the_focused_editor_and_reach_the_host; tab context menu (Close, Close Others, Close to the Right, Close Saved, Close All, Keep Open; port/results/contextmenu.md): cargo test -p app editor_menus (8); `_workbench.open` and `vscode.open` (file, untitled with its path, web link, view columns): cargo test -p app workbench_open (3), `_workbench.diff` with the diff editor: cargo test -p app diff_editor; editor groups and splits (split, move, join, focus, tab drag and drop with editorDropTarget.ts split areas): cargo test -p app editor_groups (11), editor_grid (14); locked scrolling (workbench/scroll_locking.rs): cargo test -p app scroll_locking; editorpart.state restored from workspace storage: cargo test -p app the_grid_and_its_editors_come_back_from_workspace_storage; pixel-check file window (port/results/pixels.md milestone 4); all run at the milestone 20 sweep; one group: connected tab strip (preview/pinned, close, split and more actions drawn), breadcrumbs, text editor with gutter, current line, indent guides, word highlight, overview ruler, click, drag and keyboard selection, typing, undo, clipboard, save and dirty tabs (port/notes.md milestone 5); tab context menu with Close, Close Others, Close to the Right, Close Saved, Close All, Keep Open since milestone 9 (port/results/contextmenu.md, cargo test -p app editor_menus); `_workbench.open` and `vscode.open` open a file, an untitled file with its path or a web link (cargo test -p app workbench_open, port/results/api-tests.md M12 `_workbench.open`), every view column in the one group; no `_workbench.diff` (diff editor); editor groups and splits since milestone 11 (split, move, join, focus, tab drag and drop with editorDropTarget.ts split areas; cargo test -p app editor_groups, editor_grid); no scrolling sync; minimap since milestone 8; cargo test -p app (editor::tests, workbench keys_and_typed_text_edit_the_focused_editor_and_reach_the_host); pixel-check file window (port/results/pixels.md milestone 4, unchanged at milestone 5); editorpart.state: the grid and the groups' file editors restored from workspace storage (cargo test -p app the_grid_and_its_editors_come_back_from_workspace_storage); one group: connected tab strip (preview/pinned, close, split and more actions drawn), breadcrumbs, text editor with gutter, current line, indent guides, word highlight, overview ruler, click, drag and keyboard selection, typing, undo, clipboard, save and dirty tabs (port/notes.md milestone 5); tab context menu with Close, Close Others, Close to the Right, Close Saved, Close All, Keep Open since milestone 9 (port/results/contextmenu.md, cargo test -p app editor_menus); `_workbench.open` and `vscode.open` open a file, an untitled file with its path or a web link (cargo test -p app workbench_open, port/results/api-tests.md M12 `_workbench.open`), every view column in the one group; no `_workbench.diff` (diff editor); editor groups and splits since milestone 11 (split, move, join, focus, tab drag and drop with editorDropTarget.ts split areas; cargo test -p app editor_groups, editor_grid); no scrolling sync; minimap since milestone 8; cargo test -p app (editor::tests, workbench keys_and_typed_text_edit_the_focused_editor_and_reach_the_host); pixel-check file window (port/results/pixels.md milestone 4, unchanged at milestone 5); breadcrumbs editor type picker (editor_type_picker.rs, editorTypePicker.ts) for text and diff editors: Text Diff Editor label, `priority.diffEditor` ranks, `workbench.diffEditorAssociations`, Set Default (Diff Only), Open Original/Modified: cargo test -p app editor_type_picker; ui-pair m12/editor-type.json matches, the menus' width included; the editor title's ... menu (MenuId.EditorTitle with Reopen Editor With, the button's `toolbar.activeBackground` while it shows), the empty group context menu (MenuId.EmptyEditorGroupContext) and the watermark shortcuts: ui-pair m11/editor-menus.json and m11/watermark-tips.json (port/results/auxiliary-windows.md), cargo test -p app editor_menus editor_type_picker; the empty group menu's New Terminal; the Text Editor control at a second start, restored from the `memento/customEditors` profile memento as contributedCustomEditors.ts does (cargo test -p app editor_type_picker custom_editors, ui-pair m12/editor-type-second-start.json); terminal editors (terminalEditorService.ts, terminalEditorInput.ts): Create New Terminal in Editor Area, Move Terminal into Editor Area and into the Panel, the terminal tab's context and title menus, `TabInputKind.TerminalEditorInput` tabs (cargo test -p app terminal_editor, ui-pair m12/terminal-editor.json); terminal editors restored after a restart (terminalEditorSerializer.ts); the terminal tab menus' Change Color, Change Icon, Toggle Size to Content Width and Move Terminal into New Window with the color and icon pickers (cargo test -p app terminal_editor icon_select_box, ui-pair m12/terminal-pickers.json and m12/terminal-tab-list-menu.json, m12/editor-type-second-start.json); `workbench.editor.enablePreview` off opens every editor pinned and Toggle Keep Editors pins the preview editor (cargo test -p app previews_off_pins_every_opened_editor); tab labels keep fractional text widths (vendored GPUI elements/text.rs; cargo test -p app tab_labels_keep, ui-pair icons/seti.json); `workbench.editor.showTabs` per part (editorTitleControl.ts): `single` draws singleEditorTabsControl.ts, the active editor's label 35px high, its breadcrumbs inline with `/` while the group is active, else its `workbench.editor.labelFormat` description, the close or unpin action, the actions at half opacity in an inactive group, `none` only the breadcrumbs row, `editorTabsVisible` (workbench/editor_view.rs `single_editor_tab_title`; cargo test -p app show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own; ui-pair `show-tabs.json` with SETTINGS single and none). `workbench.editor.editorActionsLocation` (titlebarPart.ts `editorActionsEnabled`): `titleBar`, or `default` with `showTabs: none`, draws the editor actions in the title bar before the layout controls with their overflow, Customize Layout moves into it (layoutActions.ts `EditorActionsInTitleBar`), the command center names the active file with its dirty dot, `hidden` draws them nowhere, and titlebarActions.ts `ToggleEditorActions` keeps the hidden location in profile storage; the six Show/Hide Editor Tabs commands (layoutActions.ts `AbstractSetShowTabsAction`) and the Editor Actions Position setters with their Tab Bar and Editor Actions Position submenus in View > Appearance and the tab bar's `EditorTabsBarContext` menu (workbench/editor_view.rs `title_bar_has_editor_actions`, workbench/editor_menus.rs `show_tabs_bar_context_menu`; cargo test -p app show_tabs_none_moves_the_editor_actions_into_the_title_bar the_tab_bar_menu_switches_the_tabs_mode the_editor_actions_toggle_restores_the_hidden_location menubar; ui-pair `show-tabs.json` with SETTINGS none: the title bar's split, close, separator, layout controls and `...` and the command center's main.ts match the reference); breadcrumbs focus mode (workbench/breadcrumbs.rs, breadcrumbsControl.ts): Focus Breadcrumbs focuses the last item, Left and Right move the focus, Space and Cmd+Enter reveal the focused file or symbol, Escape focuses the editor, the focused item underlined in `breadcrumb.focusForeground`, `breadcrumbsActive`: cargo test -p app the_keyboard_focuses_moves_through_and_reveals_the_breadcrumbs; the modal part's `modalEditor/editorTitle` actions (modalEditorPart.ts:425 `createEditorActions`): the menu's `navigation` items sorted with the JSON action by order then title, its other groups in a `...` (keybindings_editor_view.rs `modal_editor_menu_actions`; cargo test -p app the_modal_header_shows_the_modal_editor_title_menu; ui-pair menus/modal-editor-title.json: the order and the overflow item match the reference) |
| workbench/parts/notifications | workbench part | M11 | verified | | workbench/notifications_view.rs: toasts (3 at most, purge 10/12/15s unless sticky, focused or hovered, spam protection), notifications center (Clear All, Do Not Disturb menu with per-source filters, Hide), rows with expand, collapse, clear, More Actions, buttons, links, Copy Text, double-click toggle; status bar bell states and tooltips; notificationsCommands.ts commands and context keys; geometry from the reference DOM (port/tools/ref-dom); cargo test -p app notifications_view; `workbench.notifications.position` (bottom right, bottom left, top right with the title bar bell); no toast animation, no screen reader announcements; verified: ui-pair messages.json `center`, `progress` vs the reference (port/results/windows.md, milestone 11 verification) |
| workbench/parts/panel | workbench part | M11 | verified | | bottom centered card, view tabs from register_panel_view with the "..." overflow of compositeBar.ts (cargo test -p app workbench::panel::, ui-pair port/results/problems.md), `<view id>.focus` per view, Maximize/Restore, Close, Cmd+J, active view in workspace storage; Problems, Output, Debug Console, Test Results (`hideIfEmpty`) and Terminal views with their title actions (cargo test -p app editor_groups the_output_view_shows_in_the_panel, output_view, the_debug_console_and_test_results_are_panel_views, terminal); part_grid tests, ui-pair port/results/layout.md; no panel position or alignment change, no Views and More Actions menu; verified: ui-pair port/results/problems.md (milestone 11 verification): tabs, "..." overflow and the filter box as the reference; tabs at Chromium's fractional text widths (the Problems tab with its badge was 2px wider: GPUI rounds a text element's width up), the filter in the view below 600px of width (`shouldShowFilterInHeader`) |
| workbench/parts/partGrid | workbench part | M11 | verified | | workbench/layout.rs grid on split_view.rs (splitview.ts priorities, snap, visibility), workbench/part_grid.rs sashes, hidden parts, sizes and visibility in LayoutStateModel storage keys: cargo test -p app layout part_grid split_view (reference geometry at 1024x768, Cmd+B for the next open, sash drag, snap); ui-pair grid steps, port/results/layout.md |