Redesign for the v1 stable release #3

Merged
reya merged 30 commits from v1-redesign into master 2026-02-04 01:43:24 +00:00
3 changed files with 23 additions and 17 deletions
Showing only changes of commit 0d5bc286f7 - Show all commits

View File

@@ -121,6 +121,8 @@ impl ChatRegistry {
// Track unwrapping progress // Track unwrapping progress
this.tracking(cx); this.tracking(cx);
} }
// Get chat rooms from the database on every identity change
this.get_rooms(cx);
}), }),
); );

View File

@@ -158,11 +158,19 @@ impl RenderOnce for RoomListItem {
.child(name), .child(name),
) )
.child( .child(
div() h_flex()
.gap_1p5()
.flex_shrink_0() .flex_shrink_0()
.text_xs() .text_xs()
.text_color(cx.theme().text_placeholder) .text_color(cx.theme().text_placeholder)
.child(created_at), .child(created_at)
.when_some(self.kind, |this, kind| {
this.when(kind == RoomKind::Request, |this| {
this.child(
div().size_1().rounded_full().bg(cx.theme().icon_accent),
)
})
}),
), ),
) )
.hover(|this| this.bg(cx.theme().elevated_surface_background)) .hover(|this| this.bg(cx.theme().elevated_surface_background))

View File

@@ -523,24 +523,20 @@ impl Sidebar {
_window: &Window, _window: &Window,
cx: &Context<Self>, cx: &Context<Self>,
) -> Vec<impl IntoElement> { ) -> Vec<impl IntoElement> {
let chat = ChatRegistry::global(cx); // Get rooms from search results first
let rooms = match self.search_results.read(cx).as_ref() {
// Get all rooms from search results or chat registry
let all_rooms = match self.search_results.read(cx).as_ref() {
Some(results) => results, Some(results) => results,
None => chat.read(cx).rooms(cx), None => {
// Fallback to chat registry if there are no search results
let chat = ChatRegistry::global(cx);
chat.read(cx).rooms(cx)
}
}; };
// If no rooms are found, return a placeholder element for each index in the range rooms
let Some(visible_rooms) = all_rooms.get(range.clone()) else { .get(range.clone())
return range .into_iter()
.into_iter() .flatten()
.map(|ix| RoomListItem::new(ix).into_any_element())
.collect();
};
visible_rooms
.iter()
.enumerate() .enumerate()
.map(|(ix, item)| { .map(|(ix, item)| {
let this = item.read(cx); let this = item.read(cx);