chore: improve ui consistently (#35)
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

Reviewed-on: #35
This commit was merged in pull request #35.
This commit is contained in:
2026-11-20 12:28:25 +00:00
parent 51dd5c8630
commit f850f4c4c1
90 changed files with 2859 additions and 2061 deletions
+2 -5
View File
@@ -13,6 +13,7 @@ use ui::theme::ActiveTheme as _;
use utils::relative_time;
use crate::repo::actions::open_repo_panel;
use crate::repo::helpers::announcement_display_name;
use crate::workspace::Workspace;
const RECENT_COUNT: usize = 10;
@@ -62,11 +63,7 @@ pub(super) fn render_card(
let workspace = workspace.clone();
let announcement = announcement.clone();
let name = announcement
.name
.as_deref()
.map(SharedString::from)
.unwrap_or_else(|| SharedString::from(announcement.id.clone()));
let name = announcement_display_name(&announcement);
let description = announcement
.description
+22 -33
View File
@@ -14,7 +14,6 @@ use ui::empty_state::EmptyState;
use ui::icons::{Icon, IconRole};
use ui::input::{Input, InputState, InputStateEvent};
use ui::layout::panel::Panel;
use ui::scrollbar::Scrollbar;
use ui::segmented::{Segmented, SegmentedOption};
use ui::theme::ActiveTheme as _;
@@ -22,6 +21,7 @@ use crate::shared::panels;
use crate::workspace::Workspace;
const COLUMNS: usize = 2;
// Name row, avatar strip, meta row, and their borders and gaps, in px.
const CARD_HEIGHT: f32 = 40. + 64. + 48. + 2. + 6.;
pub struct ExploreView {
@@ -153,29 +153,23 @@ impl ExploreView {
),
)
.child(
div()
.absolute()
.left_0()
.bottom_0()
.pl_4()
.pb_4()
.child(
Segmented::new("explore-filter", filter)
.options(vec![
SegmentedOption::new(RepoFilter::All, "All")
.icon(Icon::named(IconRole::Grid).small().color(muted)),
SegmentedOption::new(RepoFilter::Recent, "Recent")
.icon(Icon::named(IconRole::Clock).small().color(muted)),
])
.on_change(move |filter, _, cx| {
if let Err(error) = weak.update(cx, |this, cx| {
this.filter = filter;
this.rebuild_rows(cx);
}) {
log::warn!("failed to change explore filter: {error}");
}
}),
),
div().absolute().left_0().bottom_0().pl_4().pb_4().child(
Segmented::new("explore-filter", filter)
.options(vec![
SegmentedOption::new(RepoFilter::All, "All")
.icon(Icon::named(IconRole::Grid).small().color(muted)),
SegmentedOption::new(RepoFilter::Recent, "Recent")
.icon(Icon::named(IconRole::Clock).small().color(muted)),
])
.on_change(move |filter, _, cx| {
if let Err(error) = weak.update(cx, |this, cx| {
this.filter = filter;
this.rebuild_rows(cx);
}) {
log::warn!("failed to change explore filter: {error}");
}
}),
),
)
.into_any_element()
}
@@ -262,14 +256,9 @@ impl Render for ExploreView {
})
.size_full(),
)
.child(
div()
.absolute()
.top_0()
.left_0()
.right_0()
.bottom_0()
.child(Scrollbar::vertical("explore-scroll", scroll_handle)),
)
.child(crate::shared::widgets::scroll_overlay(
"explore-scroll",
scroll_handle,
))
}
}