feat: add inbox panel (#18)
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

Reviewed-on: #18
This commit was merged in pull request #18.
This commit is contained in:
2026-09-12 03:34:51 +00:00
parent 38e8b2b933
commit 40deb9db66
17 changed files with 3429 additions and 245 deletions
+11 -2
View File
@@ -1,7 +1,7 @@
use gpui::prelude::*;
use gpui::{App, SharedString, StyleRefinement, Window};
use gpui_component::avatar::Avatar;
use gpui_component::{ActiveTheme, Sizable, StyledExt};
use gpui_component::{ActiveTheme, Sizable, Size, StyledExt};
/// A small user avatar from gpui-component [`Avatar`], rounded with the theme radius.
/// It shows the user's picture or falls back to name initials.
@@ -9,6 +9,7 @@ use gpui_component::{ActiveTheme, Sizable, StyledExt};
pub struct UserAvatar {
name: SharedString,
picture: Option<SharedString>,
size: Size,
style: StyleRefinement,
}
@@ -19,6 +20,7 @@ impl UserAvatar {
Self {
name: name.into(),
picture: None,
size: Size::Small,
style: StyleRefinement::default(),
}
}
@@ -30,6 +32,13 @@ impl UserAvatar {
}
}
impl Sizable for UserAvatar {
fn with_size(mut self, size: impl Into<Size>) -> Self {
self.size = size.into();
self
}
}
impl Styled for UserAvatar {
fn style(&mut self) -> &mut StyleRefinement {
&mut self.style
@@ -43,6 +52,6 @@ impl RenderOnce for UserAvatar {
.when_some(self.picture, |this, url| this.src(url))
.rounded(cx.theme().radius)
.refine_style(&self.style)
.small()
.with_size(self.size)
}
}