Skip to content

Visual Studio Code, rebuilt in Rust

Rust

fix(activity-bar): match the top bar item spacing and icon offset

rokartur591d8fc7f76f
diff --git a/native/crates/app/src/workbench/side_bar.rs b/native/crates/app/src/workbench/side_bar.rs
index d36ca304e94..98cde83b118 100644
--- a/native/crates/app/src/workbench/side_bar.rs
+++ b/native/crates/app/src/workbench/side_bar.rs
@@ -74,7 +74,7 @@ impl Workbench {
.h(px(32.))
.when(active, |tab| tab.child(self.connected_pane_tab_fill(index == 0, footer, "sideBar.background")))
.when(!active, |tab| tab.child(self.inactive_pane_tab_hover(&hover_group, true)))
- .child(self.compact_activity_icon(command, color, hover_color));
+ .child(self.compact_activity_icon(command, color, hover_color).h(px(32.)));
let tab = self.action_bar_item(COMPACT_ACTIVITY_BAR, command, tab, cx);
self.activity_composite_item(tab, COMPACT_ACTIVITY_BAR, command, title, self.compact_activity_drag_icon(command), active, cx)
.debug_selector(move || command.to_owned())
@@ -85,10 +85,10 @@ impl Workbench {
_ => workbench.activity_item_clicked(active, command, event, window, cx),
}))
}).collect();
- // connectedPaneTabs.css: the strip's line under a header, over a footer; padding.css: 2px between the tabs.
+ // connectedPaneTabs.css: the strip's line under a header, over a footer; tabs.css `gap: 0` wins over padding.css's 2px.
let line = div().absolute().left_0().right_0().h(px(1.)).bg(self.connected_pane_tab_border());
let line = if footer { line.top_0() } else { line.bottom_0() };
- let strip = div().relative().h(px(32.)).flex_none().flex().gap(px(2.)).bg(self.tab_strip_background()).child(line);
+ let strip = div().relative().h(px(32.)).flex_none().flex().bg(self.tab_strip_background()).child(line);
self.action_bar(COMPACT_ACTIVITY_BAR, false, strip, cx).children(tabs)
}
diff --git a/native/crates/app/src/workbench/view_locations/tests.rs b/native/crates/app/src/workbench/view_locations/tests.rs
index ff467db4d48..247549396ba 100644
--- a/native/crates/app/src/workbench/view_locations/tests.rs
+++ b/native/crates/app/src/workbench/view_locations/tests.rs
@@ -510,6 +510,11 @@ fn the_compact_activity_bar_tabs_have_the_item_menu_and_drag(cx: &mut TestAppCon
cx.update(|window, cx| drop(window.draw(cx)));
let explorer = cx.debug_bounds(EXPLORER_CONTAINER).unwrap();
let search = cx.debug_bounds(SEARCH_CONTAINER).unwrap();
+ // The reference's DOM (ui-pair bugs/top-activity-icons.json): 36x32 items without a gap (tabs.css `gap: 0`), the
+ // 16px icon 10px in and 8px down.
+ assert_eq!((explorer.size, search.origin - explorer.origin), (gpui::size(gpui::px(36.), gpui::px(32.)), gpui::point(gpui::px(36.), gpui::px(0.))));
+ let icon_center = cx.debug_bounds("codicon-explorer-view-icon").unwrap().center();
+ assert_eq!(icon_center - explorer.origin, gpui::point(gpui::px(18.), gpui::px(16.)), "the 16px icon's center");
drag(search.center(), explorer.left_center() + gpui::point(gpui::px(3.), gpui::px(0.)), cx);
let bar: Vec<_> = workbench.read_with(cx, |workbench, _| workbench.activity_bar_containers().into_iter().map(|(id, _)| id).collect());
assert_eq!(bar[..2], [SEARCH_CONTAINER, EXPLORER_CONTAINER]);
diff --git a/port/fixtures/ui-pair/bugs/top-activity-icons.json b/port/fixtures/ui-pair/bugs/top-activity-icons.json
new file mode 100644
index 00000000000..3554f08d45e
--- /dev/null
+++ b/port/fixtures/ui-pair/bugs/top-activity-icons.json
@@ -0,0 +1,4 @@
+[
+ { "wait": 5000 },
+ { "shot": "top-icons" }
+]
diff --git a/port/ledger.md b/port/ledger.md
index 9670ba6a2d6..630e3f0cc07 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -606,7 +606,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/mediaPreview | workbench contribution | M17 | verified | | workbench/media_preview.rs, media_preview/codecs.rs: cargo test -p app media_preview media_preview::codecs answers_the_player_page_with_the_file_s_codecs lists_the_editor_types opens_a_startup_image previews_read_git_resources_and_show_git_lfs_pointers_as_a_message an_image_previewed_in_another_group_gets_a_preview_in_the_active_one; `FIXTURE=media-preview-tests port/tools/webview-check` 6/6; ui-pair image, video, audio, editor-type-reopen.json (port/results/webviews.md), media-preview-focus.json. Not done: Copy image, legacy `media-preview` editor migration |
| workbench/contrib/mergeEditor | workbench contribution | M14 | verified | | merge_editor.rs model (mapping, conflict states, accept/combine) and workbench/editor_view/merge_editor_view.rs (input 1/2, result, base view, layouts, gutter checkboxes behind `mergeEditor.showCheckboxes`, base-to-result diff backgrounds, "Comparing with" in base, the result's breadcrumbs, git's Complete Merge in the result's floating menu, `_open.mergeEditor`, dev commands, the inputs as read-only code editors of the group, Toggle Between Inputs, the active range in the last focused input or the result, scroll synchronization): cargo test -p app merge; the result title's `mergeEditor/result/title` toolbar (Reset sorted among the contributed `primary` items, the other groups behind "..."): ui-pair menus/merge-result-title.json, `FOLDER` a repository mid-merge with a conflicted `a.txt`, `FILE=a.txt`, `ARGS=--extensionDevelopmentPath=<repo>/port/fixtures/extensions/menus`; verified: cargo test -p app open_merge_editor_resets_the_conflict_and_accepts_incoming ("..." active while its menu shows, cursor Ln 1, Col 1, no encoding entry), ui-pair menus/merge-result-title.json with FOLDER a repository mid-merge: shots `merge` and `more` match the reference (counter width, input titles with "·" at the same height, tab decoration, "Text Editor" switch, status bar) |
| workbench/contrib/meteredConnection | workbench contribution | M19 | verified | | the metered warning status entry and Configure Metered Connection (workbench/power.rs); port/tools/shell-check (port/fixtures/extensions/shell-tests, 6/6); cargo test -p app metered_connection |
-| workbench/contrib/modernUI | workbench contribution | M11 | verified | | the pill editor tab style, on separate pinned rows too (cargo test -p app -- the_pill_tab_style_draws_floating_pills pills_on_separate_rows_keep_a_4px_gap color_mix_matches_the_reference_tab_hover_fill; ui-pair bugs/pill-tabs.json with SETTINGS `{"workbench.experimental.modernUIEditorTabStyle": "pill"}`); the modern layout only: the classic layout (`workbench.experimental.modernUI: false`) is removed by Artur's decision (port/notes.md Modern UI); `window.density.layout` compact and the Manage menu's Layout Density (cargo test -p app -- compact_density layout_density; ui-pair m11/layout-density.json and m11/status-backgrounds.json in both densities with SETTINGS `{"window.density.layout": "compact"}`, port/results/layout-density.md); the 1.147.0 modernUI CSS audit in port/notes.md Modern UI |
+| workbench/contrib/modernUI | workbench contribution | M11 | verified | | the pill editor tab style, on separate pinned rows too (cargo test -p app -- the_pill_tab_style_draws_floating_pills pills_on_separate_rows_keep_a_4px_gap color_mix_matches_the_reference_tab_hover_fill; ui-pair bugs/pill-tabs.json with SETTINGS `{"workbench.experimental.modernUIEditorTabStyle": "pill"}`); the top activity bar's 36x32 items without a gap (tabs.css `gap: 0`) and 8px icon offset (cargo test -p app -- the_compact_activity_bar_tabs_have_the_item_menu_and_drag; ui-pair bugs/top-activity-icons.json with SETTINGS `{"workbench.activityBar.location": "top"}`); the modern layout only: the classic layout (`workbench.experimental.modernUI: false`) is removed by Artur's decision (port/notes.md Modern UI); `window.density.layout` compact and the Manage menu's Layout Density (cargo test -p app -- compact_density layout_density; ui-pair m11/layout-density.json and m11/status-backgrounds.json in both densities with SETTINGS `{"window.density.layout": "compact"}`, port/results/layout-density.md); the 1.147.0 modernUI CSS audit in port/notes.md Modern UI |
| workbench/contrib/multiDiffEditor | workbench contribution | M14 | verified | | multi_diff_editor.rs, workbench/editor_view/multi_diff_editor_view.rs, workbench/code_editors.rs: cargo test -p app multi_diff unchanged_bars_drag the_content_menu_floats_over_the_diffs a_file_side_is_a_code_editor every_drawn_file_side; ui-pair port/fixtures/ui-pair/menus/multi-diff-content.json with `FILE=notes.txt`, `steps-multi-diff-edit.json` (matches but for the reference's TypeScript diagnostics; port/notes.md Comments in diff editors); verified: cargo test -p app the_content_menu_floats_over_the_diffs, ui-pair menus/multi-diff-content.json: the toolbar's rows match the reference's |
| workbench/contrib/notebook | workbench contribution | M17 | verified | | notebook.rs, notebook/kernels.rs, notebook/layout.rs, notebook/outline.rs, workbench/notebooks.rs, workbench/notebook_editor.rs, workbench/notebook_editor/outputs.rs, cell_actions.rs, folding.rs, dnd.rs, kernel_picker.rs, notebook_variables.rs (port/notes.md milestone 17): cargo test -p app -- notebook kernel renderer backup interactive repl outline quick_input explorer list_scroll walkthrough markdown_editor debug view menus (872/0), incl. the_cell_execute_menu, kernel_source_actions_run_from_the_kernel_picker, the_notebook_variables_view_lists_the_kernels_variables; cargo test -p app markdown_editor_files_offer notebook::tests::stream_compression a_dirty_notebook_backs_up the_cell_language_picker the_output_toolbar_menu renderers a_notebook_editor_comes_back the_customize_notebook_submenu the_cell_toolbar markdown_headers_fold headings_fold split_points the_toolbar_position a_cell_dragged_by_its_left_column_moves_or_copies_to_the_drop_place markdown_headers_fold_their_sections every_selected_range_moves_to_the_drop_place the_outline_header_collapses_and_expands_the_notebook_s_headers; api-tests `MOCHA_GREP="Notebook|ipynb|Interactive Window|Ensure tabs getter"` 41/10/0 three runs in a row (10 pending are upstream skips); ui-pair m17 notebook-open, -keys-outline, -output-toolbar, -kernel-picker, -restore, -cell-click, -scroll, -toolbars, -find (within 1 device px); ui-pair m17 notebook-cell-execute with `SETTINGS={"notebook.consolidatedRunButton":true}` (run button, chevron and menu items match). Differences left are reference quirks not copied (port/notes.md session m17d) |
| workbench/contrib/onboarding | workbench contribution | M19 | removed | | the only registered tours are the Agents window ones (src/vs/sessions/contrib/onboardingTours): no AI by decision (port/notes.md) |