feat: impl dashboard & issue list

This commit is contained in:
2026-05-06 01:42:38 +08:00
parent bef3a0b9ed
commit 7de0039d38
36 changed files with 2381 additions and 107 deletions

View File

@@ -1,3 +1,6 @@
use gpui::AppContext;
use gpui::BorrowAppContext;
use crate::api;
use crate::query;
use crate::theme;
@@ -22,3 +25,28 @@ pub fn rng(cx: &mut gpui::App) -> &mut rand::prelude::ThreadRng {
pub fn query_store(cx: &gpui::App) -> &query::Store<api::QueryContext> {
cx.global::<query::Store<api::QueryContext>>()
}
pub fn open_window<V>(
cx: &mut gpui::App,
options: gpui::WindowOptions,
screen: impl FnOnce(&mut gpui::Window, &mut gpui::Context<V>) -> V,
) -> anyhow::Result<()>
where
V: gpui::Render,
{
cx.open_window(options, |window, cx| {
cx.new(|cx| {
cx.observe_window_appearance(window, |_, window, cx| {
cx.update_global::<Global, ()>(|global, cx| {
global.current_theme = global
.theme_family
.theme_for_appearance(window.appearance());
cx.notify();
});
})
.detach();
screen(window, cx)
})
})
.map(|_| ())
}