From a5457029ccb61379b775fcbc20607546301bf3ce Mon Sep 17 00:00:00 2001 From: Albert Bogusz Date: Tue, 26 May 2026 03:10:47 +0100 Subject: [PATCH] Add icons for Bitbucket, Codeberg, Forgejo, Gitea, and GitLab remotes (#57500) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] ~Unsafe blocks (if any) have justifying comments~ (N/A) - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Improves #44738 by including icons for more non-GitHub remotes instead of a generic link icon. The SVG icons I added in `assets/icons` are sourced from [simpleicons.org](https://simpleicons.org) as placeholders. They most definitely aren't in Zed's style and need design team input. Previews from History tab in Git panel (clicking on a commit in git graph also shows matched icons): ![Bitbucket](https://github.com/user-attachments/assets/f6397716-8ac7-42f2-ba6d-7f2564cce19e) ![Codeberg](https://github.com/user-attachments/assets/d4c40d93-2cde-498d-8205-02c7dc495498) ![Forgejo](https://github.com/user-attachments/assets/a11d3ccb-05e3-4af6-9b14-8a89b4390e7e) ![Gitea](https://github.com/user-attachments/assets/7e84701a-a8c4-4298-851b-472765ef05b8) ![GitLab](https://github.com/user-attachments/assets/fb798f67-79f1-4937-add0-c3d636854182) Release Notes: - Added icons for Bitbucket, Codeberg, Forgejo, Gitea, and GitLab remote providers. --------- Co-authored-by: Danilo Leal --- assets/icons/bitbucket.svg | 3 +++ assets/icons/codeberg.svg | 3 +++ assets/icons/forgejo.svg | 3 +++ assets/icons/gitea.svg | 3 +++ assets/icons/gitlab.svg | 3 +++ crates/git_graph/src/git_graph.rs | 5 +---- crates/git_ui/src/commit_view.rs | 5 +---- crates/git_ui/src/git_ui.rs | 12 ++++++++++++ crates/icons/src/icons.rs | 5 +++++ 9 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 assets/icons/bitbucket.svg create mode 100644 assets/icons/codeberg.svg create mode 100644 assets/icons/forgejo.svg create mode 100644 assets/icons/gitea.svg create mode 100644 assets/icons/gitlab.svg diff --git a/assets/icons/bitbucket.svg b/assets/icons/bitbucket.svg new file mode 100644 index 00000000000..823ffc00c3c --- /dev/null +++ b/assets/icons/bitbucket.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/codeberg.svg b/assets/icons/codeberg.svg new file mode 100644 index 00000000000..52be5909b31 --- /dev/null +++ b/assets/icons/codeberg.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/forgejo.svg b/assets/icons/forgejo.svg new file mode 100644 index 00000000000..b818af4e020 --- /dev/null +++ b/assets/icons/forgejo.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/gitea.svg b/assets/icons/gitea.svg new file mode 100644 index 00000000000..c3c6abec2dd --- /dev/null +++ b/assets/icons/gitea.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/gitlab.svg b/assets/icons/gitlab.svg new file mode 100644 index 00000000000..d7c5c6b2b49 --- /dev/null +++ b/assets/icons/gitlab.svg @@ -0,0 +1,3 @@ + + + diff --git a/crates/git_graph/src/git_graph.rs b/crates/git_graph/src/git_graph.rs index 80acde23c2d..e176a34e2b7 100644 --- a/crates/git_graph/src/git_graph.rs +++ b/crates/git_graph/src/git_graph.rs @@ -2733,10 +2733,7 @@ impl GitGraph { }) .when_some(remote.clone(), |this, remote| { let provider_name = remote.host.name(); - let icon = match provider_name.as_str() { - "GitHub" => IconName::Github, - _ => IconName::Link, - }; + let icon = git_ui::get_provider_icon(provider_name.as_str()); let parsed_remote = ParsedGitRemote { owner: remote.owner.as_ref().into(), repo: remote.repo.as_ref().into(), diff --git a/crates/git_ui/src/commit_view.rs b/crates/git_ui/src/commit_view.rs index c6e1ae6ea73..42e89bb7ba1 100644 --- a/crates/git_ui/src/commit_view.rs +++ b/crates/git_ui/src/commit_view.rs @@ -1205,10 +1205,7 @@ impl Render for CommitViewToolbar { }), ) .children(remote_info.map(|(provider_name, url)| { - let icon = match provider_name.as_str() { - "GitHub" => IconName::Github, - _ => IconName::Link, - }; + let icon = crate::get_provider_icon(provider_name.as_str()); IconButton::new("view_on_provider", icon) .icon_size(IconSize::Small) diff --git a/crates/git_ui/src/git_ui.rs b/crates/git_ui/src/git_ui.rs index f791ade8e0c..740c5fbc837 100644 --- a/crates/git_ui/src/git_ui.rs +++ b/crates/git_ui/src/git_ui.rs @@ -53,6 +53,18 @@ pub mod worktree_service; pub use conflict_view::MergeConflictIndicator; +pub fn get_provider_icon(name: &str) -> IconName { + match name { + "Bitbucket" => IconName::Bitbucket, + "Codeberg" => IconName::Codeberg, + "Forgejo Self-Hosted" => IconName::Forgejo, + "GitHub" => IconName::Github, + "GitLab" => IconName::Gitlab, + "Gitea" => IconName::Gitea, + _ => IconName::Link, + } +} + pub fn init(cx: &mut App) { editor::set_blame_renderer(blame_ui::GitBlameRenderer, cx); commit_view::init(cx); diff --git a/crates/icons/src/icons.rs b/crates/icons/src/icons.rs index 1559622fc98..d71fc42859f 100644 --- a/crates/icons/src/icons.rs +++ b/crates/icons/src/icons.rs @@ -46,6 +46,7 @@ pub enum IconName { BellOff, BellRing, Binary, + Bitbucket, Blocks, Bookmark, BoltFilled, @@ -70,6 +71,7 @@ pub enum IconName { Close, CloudDownload, Code, + Codeberg, Command, Control, Copilot, @@ -140,6 +142,7 @@ pub enum IconName { Font, FontSize, FontWeight, + Forgejo, ForwardArrow, ForwardArrowUp, GenericClose, @@ -152,7 +155,9 @@ pub enum IconName { GitGraph, GitMergeConflict, GitWorktree, + Gitea, Github, + Gitlab, Hash, HistoryRerun, Image,