Visual Studio Code, rebuilt in Rust
Rust
test(quickinput): prove createQuickWidget through the terminal icon picker
rokarturd516183bccc4
diff --git a/native/crates/app/src/workbench/terminal_editor/tests.rs b/native/crates/app/src/workbench/terminal_editor/tests.rsindex 431b6af3e74..2ed537345e7 100644--- a/native/crates/app/src/workbench/terminal_editor/tests.rs+++ b/native/crates/app/src/workbench/terminal_editor/tests.rs@@ -132,6 +132,27 @@ fn the_icon_picker_search_is_a_bare_input_box(cx: &mut TestAppContext) {cx.run_until_parked();assert_eq!(cx.debug_bounds("icon-select-id-label").expect("the picker names the focused icon").size.height, gpui::px(18.5));}++/// quickinput.test.ts "custom content is exclusive to QuickWidget and cleared when switching controls": a quick pick+/// shown over the icon picker's quick widget drops the widget's content.+#[gpui::test]+fn a_quick_pick_shown_over_the_icon_picker_drops_its_content(cx: &mut TestAppContext) {+ let app_root = Path::new(env!("VSCODE_SRC")).to_path_buf();+ let theme = load_theme(&[scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap()], "Dark Modern").unwrap();+ let (workbench, cx) = cx.add_window_view(|_, cx| Workbench::new(theme, app_root.clone(), None, Languages::new(&[]), crate::default_settings(), HostSync::new(std::sync::mpsc::channel().0), cx));+ workbench.update_in(cx, |workbench, window, cx| {+ workbench.auxiliary_windows.main_window = Some(window.window_handle());+ workbench.execute_command("workbench.action.createTerminalEditorSameGroup", Vec::new(), window, cx);+ workbench.execute_command("workbench.action.terminal.changeIcon", Vec::new(), window, cx);+ });+ cx.run_until_parked();+ assert!(cx.debug_bounds("icon-select-search").is_some(), "the quick widget shows the icon picker");+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("workbench.action.showCommands", Vec::new(), window, cx)));+ cx.run_until_parked();+ assert!(workbench.read_with(cx, |workbench, _| workbench.quick_inputs.current().is_some()), "the command palette shows");+ assert!(cx.debug_bounds("icon-select-search").is_none(), "the quick pick drops the widget's content");+ assert!(workbench.read_with(cx, |workbench, _| workbench.icon_select.picker.is_none()), "the widget's content is gone, not only hidden");+}/// The tab-menu ui-pair: terminal.initialHint.contribution.ts keeps the hint once a prompt starts, also while the/// context menu has the focus.#[gpui::test]diff --git a/port/ledger.md b/port/ledger.mdindex 3de0873708f..f3518304f2a 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -252,7 +252,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| platform/profiling | src/vs/platform | M19 | n/a | | V8 inspector CPU profiles of the Electron renderer (windowProfiling.ts, rendererAutoProfiler.ts) and their analysis worker, which feeds only telemetry (profilingTelemetrySpec.ts); the workbench is a native process, profiled with Instruments, and no telemetry by decision; the extension host profile commands belong to workbench/contrib/extensions || platform/progress | src/vs/platform | M11 | verified | | ProgressLocation values and the step shape, in main_thread_progress.rs; verified: ui-pair messages.json `progress` vs the reference (port/results/windows.md, milestone 11 verification) || platform/protocol | src/vs/platform | | n/a | | Electron process, IPC or DOM layer; replaced by the single-process Rust/GPUI architecture (port/notes.md) |-| platform/quickinput | src/vs/platform | M9 | verified | [1 S] platform/quickinput: createQuickWidget, whose only non-chat caller is the profile icon picker (QuickTree is chat only, port/notes.md) | quickPickPin.ts pins match a terminal session command by its timestamp `id`, store label, description and detail, and stay for the session after the picker hides: cargo test -p app a_pinned_session_command_stays_pinned_until_the_session_ends; cargo test -p app quick_input, filters, tf_idf (`\p{Letter}` words: tf_idf::tests::words_follow_the_javascript_regex), command_palette: the model cases of quickinput.test.ts (pick, input, active and selected items, section navigation, keepScrollPosition, title bar visibility, close animation and reopening); api-tests quick input 11/11; ad-hoc palette screenshot 0.28% pixels differ at 2% fuzz; a row's description at the highlighted name's exact width (cargo test -p app the_description_follows_the_highlighted_name_s_exact_width; Cmd+P `ts` pair: `src` within 0.3 device px of the reference); a separator's buttons show while an item of its section is active (a_separator_s_buttons_show_while_an_item_of_its_section_is_active); an item's tooltip is its hover, 6px wider from the list's padding, kept on key down and hidden on a value change (an_item_s_tooltip_is_its_row_s_hover_until_the_value_changes; port/fixtures/ui-pair/quick-input-item-hover.json: the command palette hover falls back below the row as the reference's) |+| platform/quickinput | src/vs/platform | M9 | verified | | createQuickWidget as `Kind::Widget` (quick_input_view.rs: title, no input header, the icon picker as content) for its one workbench caller, iconPicker.ts `IconPicker` of Terminal: Change Icon: cargo test -p app the_icon_picker_search_is_a_bare_input_box a_quick_pick_shown_over_the_icon_picker_drops_its_content (quickinput.test.ts "custom content is exclusive to QuickWidget"); quickPickPin.ts pins match a terminal session command by its timestamp `id`, store label, description and detail, and stay for the session after the picker hides: cargo test -p app a_pinned_session_command_stays_pinned_until_the_session_ends; cargo test -p app quick_input, filters, tf_idf (`\p{Letter}` words: tf_idf::tests::words_follow_the_javascript_regex), command_palette: the model cases of quickinput.test.ts (pick, input, active and selected items, section navigation, keepScrollPosition, title bar visibility, close animation and reopening); api-tests quick input 11/11; ad-hoc palette screenshot 0.28% pixels differ at 2% fuzz; a row's description at the highlighted name's exact width (cargo test -p app the_description_follows_the_highlighted_name_s_exact_width; Cmd+P `ts` pair: `src` within 0.3 device px of the reference); a separator's buttons show while an item of its section is active (a_separator_s_buttons_show_while_an_item_of_its_section_is_active); an item's tooltip is its hover, 6px wider from the list's padding, kept on key down and hidden on a value change (an_item_s_tooltip_is_its_row_s_hover_until_the_value_changes; port/fixtures/ui-pair/quick-input-item-hover.json: the command palette hover falls back below the row as the reference's) || platform/registry | src/vs/platform | M9 | n/a | | Registry.add/as, a string-keyed registry of registries for the JS module graph; the port passes its typed registries directly (config::registry::Registry, Commands, the menus and keybindings modules), so there is no lookup by id to port || platform/remote | src/vs/platform | | removed | | no remote or tunnels by decision (port/notes.md); one local extension host || platform/remoteTunnel | src/vs/platform | | removed | | no sign-in/AI by decision (port/notes.md); not ported |diff --git a/port/notes.md b/port/notes.mdindex b8db209e834..5a0af0a961c 100644--- a/port/notes.md+++ b/port/notes.md@@ -262,7 +262,7 @@ Scope as in its Work row of port/ledger.md. Done in this milestone: the command- `--export-default-keybindings [folder]` (keybindingsExport.contribution.ts; ignored on a stable build, a packaged latest one): writes `doc.keybindings.osx.json` into the folder (relative to the working directory, default `<appRoot>/doc`), the core defaults in registry order and then each built-in extension's rules unsorted, followed by the unbound commands, and quits. The Windows and Linux files are not written: the port carries only the macOS default table (`keybindings/default-macos.json`), a product decision of a macOS-only port.- File Icon Theme picker (`workbench.action.selectIconTheme`, themes.contribution.ts): None (`''`, written as `null`) and the `contributes.iconThemes` entries by label, previewed and restored as the color theme picker. Icon theme files are JSONC (vs_minimal-icon-theme.json has comments), so `FileIconTheme::load` strips comments as the color theme loader does. shortcut: no product icon theme picker; no built-in extension contributes one, and a third-party one needs its font to replace codicons.-- quickinput.test.ts cases the port leaves for their callers: `createQuickWidget` (only the profile icon picker, milestone 10, and chat), `createQuickTree` (chat only; quickInputTreeSorter.test.ts with it), `anchor`/`anchorPosition` (only removed parts set them in 1.147: the integrated browser's browserUrlBarWidget.ts, chat and sessions; `withQuickInputAnchor` has no workbench caller, and the editor tab bar's `+` of editorAddTabControl.ts is a context menu dropdown). Separators with buttons show while an item of their section is active (`focusInsideSeparator`); an item's `tooltip` is its row's hover, padded by the list's `.monaco-scrollable-element` rule since its host sits in the list, and it hides when the value changes (`hideHoverOnValueChange`) though not on other keys (`hideOnKeyDown: false`); `quickPickItemTooltip` markdown tooltips from extensions are a proposed API. `isKeyModified` and `quickInputButtonsToActionArrays` secondary buttons have no non-AI caller; toggle and alwaysVisible buttons are in `quick_input.rs`.+- quickinput.test.ts cases the port leaves for their callers: `createQuickWidget` cases past content exclusivity (its one workbench caller is Terminal: Change Icon's `IconPicker`; the other callers are chat and sessions), `createQuickTree` (chat only; quickInputTreeSorter.test.ts with it), `anchor`/`anchorPosition` (only removed parts set them in 1.147: the integrated browser's browserUrlBarWidget.ts, chat and sessions; `withQuickInputAnchor` has no workbench caller, and the editor tab bar's `+` of editorAddTabControl.ts is a context menu dropdown). Separators with buttons show while an item of their section is active (`focusInsideSeparator`); an item's `tooltip` is its row's hover, padded by the list's `.monaco-scrollable-element` rule since its host sits in the list, and it hides when the value changes (`hideHoverOnValueChange`) though not on other keys (`hideOnKeyDown: false`); `quickPickItemTooltip` markdown tooltips from extensions are a proposed API. `isKeyModified` and `quickInputButtonsToActionArrays` secondary buttons have no non-AI caller; toggle and alwaysVisible buttons are in `quick_input.rs`.- Help quick access (`?`, helpQuickAccess.ts): one pick per help entry of the providers the port has, sorted by prefix with `locale_compare`, labelled with the prefix (`…` for Quick Open), with the command's keybinding; accepting or typing a provider's prefix after `?` shows that provider with its value kept. The command center's help picks gain More `?`. The list filters by label containment, where upstream's quick pick filter matches fuzzily. shortcut: the `view ` provider (Open View) waits for view containers and the panel of milestone 11; the reference's `%`, `@`, `#`, `debug`, `task`, `term`, `edt`, `ext` providers come with their milestones.- Context menu submenus (`workbench/context_menu.rs`, menu.ts `SubmenuMenuActionViewItem`): the menu is a stack of levels, keys go to the last. Hover opens a submenu after 250ms, another item of its menu (or the pointer leaving the menus) closes it after 750ms unless the pointer returns; a click, Right, Enter or Space opens it with its first item focused; Left and Escape close only the submenu. Submenus are placed by `calculateSubmenuMenuLayout` and have no open animation. The Manage gear opens `MenuId.GlobalActivity` beside it (`layout2d` with `AnchorAxisAlignment.HORIZONTAL`, `AnchorAlignment.RIGHT`). Share and Copy As submenus (clipboard.ts, editor.contribution.ts) take the `*/share` and `*/copy` contributions. shortcut: no `window.menuStyle: native` context menus, GPUI has no native popup menu.