make badge sizable and use badges for sidebar counts
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run

This commit is contained in:
2026-11-18 11:37:15 +07:00
parent cbf4c23731
commit 41f34d0192
5 changed files with 33 additions and 11 deletions
+2 -2
View File
@@ -378,7 +378,7 @@ pub(crate) fn commit_row(
.child(
div()
.font_family(cx.theme().mono_font)
.typeset(TextRole::Caption, cx)
.typeset(TextRole::Callout, cx)
.text_color(cx.theme().colors.muted_foreground)
.child(commit.id.clone()),
)
@@ -386,7 +386,7 @@ pub(crate) fn commit_row(
div()
.flex_1()
.min_w_0()
.typeset(TextRole::Body, cx)
.typeset(TextRole::Callout, cx)
.text_ellipsis()
.whitespace_nowrap()
.child(commit.summary.clone()),
+1
View File
@@ -155,6 +155,7 @@ impl Render for RepoHistoryView {
let commit = commits[ix].clone();
let id = commit.id.clone();
let view = view.clone();
commit_row(
ix,
&commit,
+11 -3
View File
@@ -17,6 +17,7 @@ use signed_state::{
};
use ui::alert::{Alert, AlertSeverity};
use ui::avatar::Avatar;
use ui::badge::Badge;
use ui::common::{Sizable as _, h_flex, v_flex};
use ui::icons::{Icon, IconRole};
use ui::layout::panel::Panel;
@@ -886,19 +887,25 @@ impl RepoDetailView {
let mut entries = vec![
SidebarEntry::row("repo-nav-commits", "Commits")
.prefix(Icon::named(IconRole::GitCommit))
.when_some(commit_count, |entry, count| entry.suffix(count.to_string())),
.when_some(commit_count, |entry, count| {
entry.suffix(Badge::new(count, count.to_string()).xsmall())
}),
];
if include_issues {
entries.push(
SidebarEntry::row("repo-nav-issues", "Issues")
.prefix(Icon::named(IconRole::GitIssueDone))
.when_some(issue_count, |entry, count| entry.suffix(count.to_string())),
.when_some(issue_count, |entry, count| {
entry.suffix(Badge::new(count, count.to_string()).xsmall())
}),
);
entries.push(
SidebarEntry::row("repo-nav-pulls", "Pull requests")
.prefix(Icon::named(IconRole::GitPullRequest))
.when_some(pull_count, |entry, count| entry.suffix(count.to_string())),
.when_some(pull_count, |entry, count| {
entry.suffix(Badge::new(count, count.to_string()).xsmall())
}),
);
}
@@ -991,6 +998,7 @@ impl Render for RepoDetailView {
.severity(AlertSeverity::Danger)
.title("Repository error")
.message(error)
.style(ui::alert::AlertStyle::Inline)
.on_dismiss(move |cx| {
if let Err(error) = weak.update(cx, |this, cx| {
this.error = None;