add basic repo browser

This commit is contained in:
2026-08-05 09:03:42 +07:00
parent 7249a323f8
commit f497279886
10 changed files with 411 additions and 27 deletions
+4
View File
@@ -9,6 +9,10 @@ name = "signed"
path = "src/main.rs"
[dependencies]
paths = { path = "../crates/paths" }
signed_state = { path = "../crates/signed_state" }
workspace = { path = "../crates/workspace" }
gpui.workspace = true
gpui_platform.workspace = true
gpui_linux.workspace = true
+5 -27
View File
@@ -1,30 +1,8 @@
use std::sync::Arc;
use gpui::*;
use gpui_component::button::*;
use gpui_component::*;
use gpui_platform::application;
pub struct HelloWorld;
impl Render for HelloWorld {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
div()
.v_flex()
.gap_2()
.size_full()
.items_center()
.justify_center()
.child("Hello, World!")
.child(
Button::new("ok")
.primary()
.label("Let's Go!")
.on_click(|_ev, _window, _cx| println!("Clicked!")),
)
}
}
fn main() {
// Initialize logging
tracing_subscriber::fmt::init();
@@ -34,6 +12,10 @@ fn main() {
.run(move |cx| {
gpui_component::init(cx);
// Initialize backend and stores (connects relays, restores session)
std::fs::create_dir_all(paths::nostr_dir()).ok();
signed_state::init(paths::nostr_dir(), cx);
// Set up the window bounds
let bounds = Bounds::centered(None, size(px(960.0), px(720.0)), cx);
@@ -53,11 +35,7 @@ fn main() {
};
cx.spawn(async move |cx| {
cx.open_window(opts, |window, cx| {
let view = cx.new(|_| HelloWorld);
cx.new(|cx| Root::new(view, window, cx))
})
.ok();
let _ = cx.open_window(opts, workspace::root);
})
.detach();