History

workspace: Use FolderOpen icon for active workspace project (#49180)

Differentiate the active workspace in the sidebar project list by using IconName::FolderOpen instead of IconName::Folder Before: <img width="1761" height="1196" alt="Image" src="https://github.com/user-attachments/assets/1a6d3708-9e3b-4ebc-b8e5-7b68194e55b7" /> After: <img width="1717" height="1152" alt="image" src="https://github.com/user-attachments/assets/1784dc83-b38a-4f6a-8984-ccd3b877b100" /> Closes #49179 Before you mark this PR as ready for review, make sure that you have: - [x] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Improved active project in the workspace by changing the icon from Folder to FolderOpen

Riccardo Strina committed 9 months ago

Commit 01ac5a81 parent 01b1d7d1 file · +6 −1Browse files

Unified · Split

crates/sidebar/src/sidebar.rs+6−1
@@ -535,6 +535,7 @@ impl PickerDelegate for WorkspacePickerDelegate { · 534 unmodified lines
535535 let workspace_index = thread_entry.index;
536536 let multi_workspace = self.multi_workspace.clone();
537537 let workspace_count = self.multi_workspace.read(cx).workspaces().len();
538+ let is_active = self.active_workspace_index == workspace_index;
538539 let is_hovered = self.hovered_thread_item == Some(workspace_index);
539540
540541 let remove_btn = IconButton::new(
@@ -568,7 +569,11 @@ impl PickerDelegate for WorkspacePickerDelegate { · 27 unmodified lines
568569 ("workspace-item", thread_entry.index),
569570 thread_subtitle.unwrap_or("New Thread".into()),
570571 )
571− .icon(IconName::Folder)
572+ .icon(if is_active {
573+ IconName::FolderOpen
574+ } else {
575+ IconName::Folder
576+ })
572577 .running(running)
573578 .generation_done(has_notification)
574579 .selected(selected)