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
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:
@@ -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()),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user