update repo list

This commit is contained in:
2026-08-30 09:18:38 +07:00
parent 8829bc5bc1
commit 729e15e27e
3 changed files with 55 additions and 5 deletions
+11 -3
View File
@@ -37,7 +37,10 @@ impl RepoListView {
_window: &mut Window,
cx: &mut Context<Self>,
) -> Self {
let store = cx.new(|cx| RepoListStore::new(None, cx));
// Created at startup by `signed_state::init`: the local database has
// already been queried, so stored repositories appear immediately
// without waiting for relays (which only add to the list).
let store = RepoListStore::global(cx);
let subscription = cx.observe(&store, |this, store, cx| {
// Each virtual list row holds `COLUMNS` repo cards.
@@ -48,12 +51,17 @@ impl RepoListView {
}
});
// The store may already hold announcements (it loaded before the
// panel opened), so seed the row sizes right away.
let rows = store.read(cx).announcements.len().div_ceil(COLUMNS);
let item_sizes = Rc::new(vec![size(px(0.), px(CARD_HEIGHT)); rows]);
Self {
store,
dock_area,
focus_handle: cx.focus_handle(),
scroll_handle: VirtualListScrollHandle::new(),
item_sizes: Rc::new(vec![]),
item_sizes,
_subscription: subscription,
}
}
@@ -230,7 +238,7 @@ impl Render for RepoListView {
div()
.text_sm()
.text_color(cx.theme().muted_foreground)
.child("No repositories found. Waiting for relays..."),
.child("No repositories found yet."),
),
)
})