Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(breadcrumbs): port the keyboard focus mode

rokartur7737b0f3bb1b
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index a6ad2774ff9..e0147524b7f 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -52,6 +52,7 @@ mod editor_commands;
mod editor_menus;
mod side_by_side_editor;
mod editor_type_picker;
+mod breadcrumbs;
mod editor_message;
pub mod editor_status;
mod editor_view;
@@ -530,6 +531,7 @@ pub struct Workbench {
centered_layout: centered_layout::CenteredLayout,
side_by_side_splits: side_by_side_editor::SideBySideSplits,
editor_type_picker: editor_type_picker::EditorTypePicker,
+ breadcrumbs: breadcrumbs::Breadcrumbs,
edit_setting: preferences::edit_setting::EditSetting,
editor_groups: editor_groups::EditorGroups,
auxiliary_windows: auxiliary_windows::AuxiliaryWindows,
@@ -878,6 +880,7 @@ impl Workbench {
centered_layout: Default::default(),
side_by_side_splits: Default::default(),
editor_type_picker: Default::default(),
+ breadcrumbs: breadcrumbs::Breadcrumbs::new(cx),
edit_setting: Default::default(),
editor_groups: Default::default(),
auxiliary_windows: Default::default(),
@@ -925,6 +928,7 @@ impl Workbench {
workbench.register_scroll_locking_commands();
workbench.register_scm_view_mode_commands();
workbench.register_merge_editor_commands();
+ workbench.register_breadcrumbs_commands();
workbench.register_empty_editor_hint_commands();
workbench.register_multi_diff_editor_commands();
workbench.register_timeline_commands();
diff --git a/native/crates/app/src/workbench/breadcrumbs.rs b/native/crates/app/src/workbench/breadcrumbs.rs
new file mode 100644
index 00000000000..eb5dbe3936c
--- /dev/null
+++ b/native/crates/app/src/workbench/breadcrumbs.rs
@@ -0,0 +1,138 @@
+//! breadcrumbsControl.ts focus mode: Focus Breadcrumbs focuses the last item, Left and Right move the focus, Space
+//! reveals the focused item and Escape goes back to the editor (breadcrumbsWidget.ts `_focus`).
+
+use std::path::PathBuf;
+
+use gpui::{Context, FocusHandle, Window};
+use serde_json::json;
+
+use super::Workbench;
+use crate::commands::Outcome;
+
+#[cfg(test)]
+mod tests;
+
+pub(super) struct Breadcrumbs {
+ /// The widget's DOM focus, `breadcrumbsActive`.
+ pub focus: FocusHandle,
+ /// The group whose breadcrumbs have a focused item, and that item.
+ focused: Option<(u32, usize)>,
+}
+
+impl Breadcrumbs {
+ pub fn new(cx: &mut gpui::App) -> Self {
+ Self { focus: cx.focus_handle(), focused: None }
+ }
+}
+
+/// What an item reveals: breadcrumbsControl.ts `FileItem` and `OutlineItem`.
+enum BreadcrumbElement {
+ /// The resource's scheme and path.
+ File(String, PathBuf),
+ Folder,
+ /// An outline symbol by id; the `…` item and a notebook's cells have none.
+ Symbol(Option<String>),
+}
+
+impl Workbench {
+ pub(super) fn register_breadcrumbs_commands(&mut self) {
+ self.commands.register("breadcrumbs.focus", |workbench, _, window, cx| {
+ workbench.focus_breadcrumbs(window, cx);
+ Outcome::done()
+ });
+ for (id, step) in [("breadcrumbs.focusNext", 1), ("breadcrumbs.focusPrevious", -1)] {
+ self.commands.register(id, move |workbench, _, _, cx| {
+ workbench.move_breadcrumbs_focus(step, cx);
+ Outcome::done()
+ });
+ }
+ self.commands.register("breadcrumbs.revealFocused", |workbench, _, window, cx| {
+ workbench.reveal_focused_breadcrumb(window, cx);
+ Outcome::done()
+ });
+ self.commands.register("breadcrumbs.selectEditor", |workbench, _, window, cx| {
+ workbench.breadcrumbs.focused = None;
+ workbench.focus_group(workbench.editors.id, window, cx);
+ Outcome::done()
+ });
+ }
+
+ /// breadcrumbsControl.ts `update`: every editor with a resource has breadcrumbs but untitled and merge editors.
+ pub(super) fn breadcrumbs_possible(&self, editor: &crate::editor::OpenEditor) -> bool {
+ !matches!(editor.document().scheme.as_str(), "untitled" | super::terminal_editor::TERMINAL_EDITOR_SCHEME) && self.editors.active_merge().is_none()
+ }
+
+ pub(super) fn breadcrumbs_visible(&self, editor: &crate::editor::OpenEditor) -> bool {
+ self.breadcrumbs_possible(editor) && !self.drawing_compact_part() && self.setting("breadcrumbs.enabled") != json!(false)
+ }
+
+ /// The focused item of the breadcrumbs of the group being drawn.
+ pub(super) fn breadcrumbs_focused(&self) -> Option<usize> {
+ self.breadcrumbs.focused.filter(|(group, _)| *group == self.editors.id).map(|(_, index)| index)
+ }
+
+ /// `focusAndSelectHandler` without the selection: the active group's last item.
+ fn focus_breadcrumbs(&mut self, window: &mut Window, cx: &mut Context<Self>) {
+ let Some(editor) = self.editors.active() else { return };
+ if !self.breadcrumbs_visible(editor) {
+ return;
+ }
+ let last = self.breadcrumb_elements().len() - 1;
+ self.breadcrumbs.focused = Some((self.editors.id, last));
+ window.focus(&self.breadcrumbs.focus, cx);
+ cx.notify();
+ }
+
+ /// breadcrumbsWidget.ts `focusNext` and `focusPrev`: the focus stops at either end.
+ fn move_breadcrumbs_focus(&mut self, step: isize, cx: &mut Context<Self>) {
+ let Some(focused) = self.breadcrumbs_focused() else { return };
+ let Some(next) = focused.checked_add_signed(step).filter(|next| *next < self.breadcrumb_elements().len()) else { return };
+ self.breadcrumbs.focused = Some((self.editors.id, next));
+ cx.notify();
+ }
+
+ /// `_onSelectEvent` with `Payload_Reveal` and `_revealInEditor`: a file opens in the group, a symbol is revealed at
+ /// the start of its name; a folder focuses the next item, whose picker is not ported.
+ fn reveal_focused_breadcrumb(&mut self, window: &mut Window, cx: &mut Context<Self>) {
+ let Some(focused) = self.breadcrumbs_focused() else { return };
+ let element = self.breadcrumb_elements().swap_remove(focused);
+ let group = self.editors.id;
+ match element {
+ BreadcrumbElement::Folder => return self.move_breadcrumbs_focus(1, cx),
+ BreadcrumbElement::File(scheme, path) => {
+ self.breadcrumbs.focused = None;
+ self.focus_group(group, window, cx);
+ self.open_file_in_active_group(&scheme, path, false, window, cx);
+ }
+ BreadcrumbElement::Symbol(id) => {
+ self.breadcrumbs.focused = None;
+ self.focus_group(group, window, cx);
+ if let Some(id) = id {
+ self.reveal_outline_symbol(&id, false, window, cx);
+ }
+ }
+ }
+ cx.notify();
+ }
+
+ /// The items of the active group's breadcrumbs, as `breadcrumbs_widget` draws them.
+ fn breadcrumb_elements(&self) -> Vec<BreadcrumbElement> {
+ let editor = self.active_text_editor_control().or(self.editors.active()).expect("breadcrumbs of an editor");
+ let foreground = self.color("breadcrumb.foreground");
+ let (notebook_path, notebook_items) = self.notebook_breadcrumbs_of(editor, foreground, super::editor_view::BREADCRUMBS_HEIGHT).unzip();
+ let path = self.breadcrumbs_resource(editor, notebook_path);
+ // shortcut: a notebook's or custom editor's resource opens as a file, upgrade when breadcrumbs keep the URI.
+ let scheme = if path == editor.document().path { editor.document().scheme.clone() } else { "file".into() };
+ let (segments, _, _) = self.breadcrumb_file_segments(&path);
+ let mut elements: Vec<_> = (1..segments.len()).map(|_| BreadcrumbElement::Folder).collect();
+ elements.push(BreadcrumbElement::File(scheme, path));
+ match notebook_items {
+ Some(items) => elements.extend(items.iter().map(|_| BreadcrumbElement::Symbol(None))),
+ None => {
+ let mut ids = self.breadcrumb_symbol_ids(editor).into_iter();
+ elements.extend(self.breadcrumb_symbols(editor).iter().map(|_| BreadcrumbElement::Symbol(ids.next())));
+ }
+ }
+ elements
+ }
+}
diff --git a/native/crates/app/src/workbench/breadcrumbs/tests.rs b/native/crates/app/src/workbench/breadcrumbs/tests.rs
new file mode 100644
index 00000000000..069efd8748e
--- /dev/null
+++ b/native/crates/app/src/workbench/breadcrumbs/tests.rs
@@ -0,0 +1,47 @@
+use gpui::TestAppContext;
+use serde_json::json;
+
+use crate::editor::Position;
+use crate::workbench::goto_symbol::tests::{answer, open};
+
+/// breadcrumbsControl.ts: Focus Breadcrumbs focuses the last item, Left and Right move the focus and stop at the
+/// ends, Space reveals the focused symbol in the editor, and Escape gives the editor the focus back.
+#[gpui::test]
+fn the_keyboard_focuses_moves_through_and_reveals_the_breadcrumbs(cx: &mut TestAppContext) {
+ let (workbench, cx, receiver, dir) = open(cx, "breadcrumbs-focus", "class A {\n run() {}\n}\n");
+ workbench.update(cx, |workbench, cx| {
+ workbench.load_keybindings(crate::keybindings::default_keybindings(&[]), dir.join("User/keybindings.json"));
+ workbench.language_features.register(crate::workbench::document_symbols::REGISTER, vec![json!(11), json!("*"), json!("Test")]);
+ workbench.language_providers_changed(crate::workbench::document_symbols::REGISTER, cx);
+ });
+ let range = |start: usize, end: usize| json!({ "startLineNumber": start, "startColumn": 1, "endLineNumber": end, "endColumn": 20 });
+ let selection = |line: usize, column: usize| json!({ "startLineNumber": line, "startColumn": column, "endLineNumber": line, "endColumn": column + 1 });
+ answer(&receiver, "$provideDocumentSymbols", json!([
+ { "name": "A", "detail": "", "kind": 4, "range": range(1, 3), "selectionRange": selection(1, 7), "children": [
+ { "name": "run", "detail": "", "kind": 5, "range": range(2, 2), "selectionRange": selection(2, 3), "children": [] },
+ ] },
+ ]), cx);
+ workbench.update_in(cx, |workbench, window, cx| {
+ workbench.refresh_outline_pane(cx);
+ workbench.reveal_outline_symbol("root/provider_0/A/run", false, window, cx);
+ });
+ let state = |cx: &mut gpui::VisualTestContext| {
+ workbench.update_in(cx, |workbench, window, _| {
+ let active = workbench.key_context(window)["breadcrumbsActive"] == json!(true);
+ (workbench.breadcrumbs_focused(), active, workbench.editor_focus.is_focused(window), workbench.editors.active().unwrap().selection().head)
+ })
+ };
+ assert_eq!(state(cx), (None, false, true, Position::new(1, 2)));
+
+ cx.simulate_keystrokes("cmd-shift-;");
+ assert_eq!(state(cx), (Some(2), true, false, Position::new(1, 2)), "a.txt, A, run: the last item");
+ cx.simulate_keystrokes("left left left");
+ assert_eq!(state(cx).0, Some(0), "the focus stops at the first item");
+ cx.simulate_keystrokes("right");
+ assert_eq!(state(cx).0, Some(1));
+ cx.simulate_keystrokes("space");
+ assert_eq!(state(cx), (None, false, true, Position::new(0, 6)), "Space reveals A at the start of its name");
+
+ cx.simulate_keystrokes("cmd-shift-; escape");
+ assert_eq!(state(cx), (None, false, true, Position::new(0, 6)), "Escape focuses the editor");
+}
diff --git a/native/crates/app/src/workbench/editor_view.rs b/native/crates/app/src/workbench/editor_view.rs
index 850e0840018..33ca5a6afeb 100644
--- a/native/crates/app/src/workbench/editor_view.rs
+++ b/native/crates/app/src/workbench/editor_view.rs
@@ -5,7 +5,7 @@
use std::cell::Cell;
use std::collections::HashMap;
use std::ops::Range;
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::time::{Duration, Instant};
@@ -76,7 +76,7 @@ enum TabRow {
/// The sticky tabs' bar above it (`pinnedTabsOnSeparateRow`).
Upper,
}
-const BREADCRUMBS_HEIGHT: f32 = 22.;
+pub(super) const BREADCRUMBS_HEIGHT: f32 = 22.;
/// scrollableElement.ts `HIDE_TIMEOUT`; scrollbars.css fades in over 100ms and out over 800ms.
const SCROLLBAR_HIDE_TIMEOUT: Duration = Duration::from_millis(500);
const SCROLLBAR_FADE_IN: Duration = Duration::from_millis(100);
@@ -833,16 +833,20 @@ impl Workbench {
self.breadcrumbs_widget(editor, true).ml(px(13. * 0.45)).h_full().text_color(self.color("breadcrumb.foreground")).when(editor.preview, |crumbs| crumbs.italic())
}
- fn breadcrumbs_widget(&self, editor: &OpenEditor, inline: bool) -> Div {
- let foreground = self.color("breadcrumb.foreground");
- let line_height = if inline { SINGLE_TAB_TITLE_HEIGHT } else { BREADCRUMBS_HEIGHT };
- // A notebook editor's breadcrumbs are its notebook's resource and the notebook outline (notebookOutline.ts).
+ /// A notebook editor's breadcrumbs are its notebook's resource and the notebook outline (notebookOutline.ts).
+ pub(super) fn notebook_breadcrumbs_of(&self, editor: &OpenEditor, foreground: Rgba, line_height: f32) -> Option<(PathBuf, Vec<(Option<Div>, String)>)> {
let is_notebook = matches!(editor.document().scheme.as_str(), crate::notebook::CELL_SCHEME | crate::notebook::NOTEBOOK_EDITOR_SCHEME);
- let (notebook_path, notebook_items) = self.notebook_breadcrumbs(foreground, line_height).filter(|_| is_notebook).unzip();
- let document = editor.document();
- // A custom editor's breadcrumbs are its resource's (`EditorResourceAccessor.getOriginalUri`).
- let custom_resource = self.webview_resource(&document.path);
- let path = notebook_path.as_ref().or(custom_resource.as_ref()).unwrap_or(&document.path);
+ self.notebook_breadcrumbs(foreground, line_height).filter(|_| is_notebook)
+ }
+
+ /// The resource the breadcrumbs show: a custom editor's is its resource's (`EditorResourceAccessor.getOriginalUri`).
+ pub(super) fn breadcrumbs_resource(&self, editor: &OpenEditor, notebook_path: Option<PathBuf>) -> PathBuf {
+ notebook_path.or_else(|| self.webview_resource(&editor.document().path)).unwrap_or_else(|| editor.document().path.clone())
+ }
+
+ /// breadcrumbsModel.ts `_initFilePathInfo`: the path's items as labels, whether the first is relative to a folder or
+ /// the home, and whether the first is a root folder.
+ pub(super) fn breadcrumb_file_segments(&self, path: &Path) -> (Vec<String>, bool, bool) {
let workspace = self.workspace();
let folder = workspace.and_then(|workspace| workspace.folder_of(path));
let home = std::env::home_dir().filter(|home| folder.is_none() && path.starts_with(home));
@@ -860,6 +864,15 @@ impl Workbench {
}
// The `~` and a workspace's folder are FileKind.ROOT_FOLDER items.
let has_root_folder = home.is_some() || folder.is_some_and(|_| workspace.is_some_and(|workspace| workspace.file.is_some()));
+ (segments, is_relative, has_root_folder)
+ }
+
+ fn breadcrumbs_widget(&self, editor: &OpenEditor, inline: bool) -> Div {
+ let foreground = self.color("breadcrumb.foreground");
+ let line_height = if inline { SINGLE_TAB_TITLE_HEIGHT } else { BREADCRUMBS_HEIGHT };
+ let (notebook_path, notebook_items) = self.notebook_breadcrumbs_of(editor, foreground, line_height).unzip();
+ let path = self.breadcrumbs_resource(editor, notebook_path.clone());
+ let (segments, is_relative, has_root_folder) = self.breadcrumb_file_segments(&path);
let file = segments.len() - 1;
let symbol_items: Vec<(Option<Div>, String)> = match notebook_items {
Some(items) => items,
@@ -888,14 +901,23 @@ impl Workbench {
});
// breadcrumbsWidget.css: an item is its icon, its label and the 16px separator codicon, without gaps; the
// first one starts 16px in, measured against the reference with ui-pair.
+ let focused = self.breadcrumbs_focused();
+ // breadcrumbsWidget.ts `_style`: the focused item and a hovered other one in `breadcrumb.focusForeground`.
+ let focus_foreground = self.color("breadcrumb.focusForeground");
let items = file_items.chain(symbol_items).enumerate().map(|(index, (icon, segment))| {
let root_folder = has_root_folder && index == 0;
let slash = !root_folder && !(index == 0 && is_relative) && !(index == 1 && has_root_folder);
+ let is_focused = focused == Some(index);
+ // breadcrumbscontrol.css: the focused item's label is underlined.
+ let segment = div().when(is_focused, |label| label.underline()).child(segment);
+ let foreground = if is_focused { focus_foreground } else { foreground };
div()
.debug_selector(move || format!("breadcrumb-item-{index}"))
.flex()
.items_center()
.whitespace_nowrap()
+ .text_color(foreground)
+ .when(!is_focused, |item| item.hover(|item| item.text_color(focus_foreground)))
.map(|item| match inline {
true => item.when(slash, |item| item.child(div().text_size(px(13. * 0.9)).child("/"))),
false => item.when(index == 0, |item| item.pl(px(16.))),
@@ -912,6 +934,7 @@ impl Workbench {
.min_w_0()
.h_full()
.overflow_hidden()
+ .when(focused.is_some(), |widget| widget.track_focus(&self.breadcrumbs.focus))
// The breadcrumbs sit in the title (editortabscontrol.css) and each item is pointer (breadcrumbsWidget.css).
.cursor_pointer()
.flex()
@@ -2843,7 +2866,7 @@ impl Workbench {
/// `getCodeEditor(editorService.activeTextEditorControl)`, which the status bar and breadcrumbs follow: a diff
/// editor's modified side, also while its original side has the focus.
- fn active_text_editor_control(&self) -> Option<&OpenEditor> {
+ pub(super) fn active_text_editor_control(&self) -> Option<&OpenEditor> {
if let Some(modified) = self.editors.active_diff().and_then(|diff| diff.modified_editor.as_ref()) {
return Some(modified);
}
diff --git a/native/crates/app/src/workbench/keyboard.rs b/native/crates/app/src/workbench/keyboard.rs
index 94106cb252c..306a907a219 100644
--- a/native/crates/app/src/workbench/keyboard.rs
+++ b/native/crates/app/src/workbench/keyboard.rs
@@ -496,10 +496,10 @@ impl Workbench {
context.insert("activeEditorIsPinned".into(), json!(self.editors.editors[index].sticky));
}
if let Some(editor) = self.editors.active() {
- // breadcrumbsControl.ts `update`: every editor with a resource has breadcrumbs but untitled and merge editors.
- let breadcrumbs_possible = !matches!(editor.document().scheme.as_str(), "untitled" | super::terminal_editor::TERMINAL_EDITOR_SCHEME) && self.editors.active_merge().is_none();
+ let breadcrumbs_possible = self.breadcrumbs_possible(editor);
context.insert("breadcrumbsPossible".into(), json!(breadcrumbs_possible));
- context.insert("breadcrumbsVisible".into(), json!(breadcrumbs_possible && !self.drawing_compact_part() && self.setting("breadcrumbs.enabled") != json!(false)));
+ context.insert("breadcrumbsVisible".into(), json!(self.breadcrumbs_visible(editor)));
+ context.insert("breadcrumbsActive".into(), json!(self.breadcrumbs.focus.is_focused(window)));
context.insert("breadcrumbsHasSymbols".into(), json!(breadcrumbs_possible && !self.breadcrumb_symbols(editor).is_empty()));
let pane = match editor.document().scheme.as_str() {
_ if self.playground_active() => "workbench.editor.walkThroughPart",
diff --git a/native/crates/app/src/workbench/outline_pane.rs b/native/crates/app/src/workbench/outline_pane.rs
index c1f93ae2c66..6f8936cc93c 100644
--- a/native/crates/app/src/workbench/outline_pane.rs
+++ b/native/crates/app/src/workbench/outline_pane.rs
@@ -355,25 +355,32 @@ impl Workbench {
/// cursor from the outermost, up to the first filtered one, as (kind, name); none around the cursor in a
/// non-empty outline is `…` without a kind (breadcrumbsModel.ts `_getOutlineElements`).
pub(super) fn breadcrumb_symbols(&self, editor: &crate::editor::OpenEditor) -> Vec<(Option<u64>, String)> {
- let Status::Ready { model_id, outline, .. } = &self.outline_pane.status else { return Vec::new() };
+ let Some((path, outline_is_empty)) = self.breadcrumb_outline_path(editor) else { return Vec::new() };
+ if path.is_empty() && !outline_is_empty {
+ return vec![(None, "\u{2026}".into())];
+ }
+ path.into_iter().map(|element| (Some(element.symbol.kind), element.symbol.name.clone())).collect()
+ }
+
+ /// The outline ids of `breadcrumb_symbols`' symbols; the `…` item has none.
+ pub(super) fn breadcrumb_symbol_ids(&self, editor: &crate::editor::OpenEditor) -> Vec<String> {
+ self.breadcrumb_outline_path(editor).map(|(path, _)| path.into_iter().map(|element| element.id.clone()).collect()).unwrap_or_default()
+ }
+
+ /// The breadcrumbs' outline elements and whether the outline is empty; none without an outline of `editor`.
+ fn breadcrumb_outline_path(&self, editor: &crate::editor::OpenEditor) -> Option<(Vec<&crate::outline_model::OutlineElement>, bool)> {
+ let Status::Ready { model_id, outline, .. } = &self.outline_pane.status else { return None };
let symbol_path = self.setting("breadcrumbs.symbolPath");
if *model_id != editor.model_id || symbol_path == "off" {
- return Vec::new();
+ return None;
}
- let Some(position) = self.outline_position(editor) else { return Vec::new() };
+ let position = self.outline_position(editor)?;
let path = outline.item_enclosing_position(position, None).map(|item| outline.path_to(&item.id).expect("an element of the outline")).unwrap_or_default();
- let mut symbols: Vec<(Option<u64>, String)> = path
- .into_iter()
- .take_while(|element| self.shows_symbol_kind("breadcrumbs", element.symbol.kind))
- .map(|element| (Some(element.symbol.kind), element.symbol.name.clone()))
- .collect();
- if symbols.is_empty() && !outline.groups.is_empty() {
- return vec![(None, "\u{2026}".into())];
- }
+ let mut elements: Vec<_> = path.into_iter().take_while(|element| self.shows_symbol_kind("breadcrumbs", element.symbol.kind)).collect();
if symbol_path == "last" {
- symbols.drain(..symbols.len().saturating_sub(1));
+ elements.drain(..elements.len().saturating_sub(1));
}
- symbols
+ Some((elements, outline.groups.is_empty()))
}
/// listWidget.ts `.monaco-list:focus .monaco-list-row.selected .codicon`: `list.activeSelectionIconForeground`,
diff --git a/port/ledger.md b/port/ledger.md
index 23696a8e20a..9790ce6feb2 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 L] breadcrumbs: no click, focus mode, file and outline pickers (breadcrumbsControl.ts, breadcrumbsPicker.ts, `breadcrumbs.focusAndSelect`) | 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) |
+| workbench/parts/editor | workbench part | M8 | ported | [3 L] breadcrumbs: no click, file and outline pickers (breadcrumbsPicker.ts; `breadcrumbs.focusAndSelect`, `selectFocused`, `focusNextWithPicker`, `revealFocusedFromTreeAside`, `toggleToOn`, `breadcrumbs.useQuickPick`) | 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/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 |