update sidebar

This commit is contained in:
2026-08-29 20:47:30 +07:00
parent c76ebfb8f6
commit ae2938112f
10 changed files with 225 additions and 280 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

+2
View File
@@ -7,6 +7,8 @@ use rust_embed::RustEmbed;
#[folder = "assets"]
#[include = "icons/**/*.svg"]
#[include = "themes/**/*.json"]
#[include = "backgrounds/**/*.jpg"]
#[include = "backgrounds/**/*.png"]
#[exclude = "*.DS_Store"]
pub struct Assets;
+1 -5
View File
@@ -29,11 +29,7 @@ pub const BOOTSTRAP_RELAYS: [&str; 4] = [
];
/// Relays used for indexing user's relay list (NIP-65).
pub const INDEXER_RELAYS: [&str; 3] = [
"wss://indexer.coracle.social",
"wss://purplepag.es",
"wss://user.kindpag.es",
];
pub const INDEXER_RELAYS: [&str; 2] = ["wss://indexer.coracle.social", "wss://user.kindpag.es"];
#[derive(Debug, Clone)]
pub enum BackendEvent {
+61 -32
View File
@@ -7,8 +7,9 @@ use dock::{
};
use gpui::prelude::*;
use gpui::{
AnyElement, App, ClickEvent, Context, ElementId, Entity, EventEmitter, FocusHandle, Focusable,
Render, SharedString, StyleRefinement, Subscription, WeakEntity, Window, div, px, uniform_list,
AnyElement, App, ClickEvent, Context, Div, ElementId, Entity, EventEmitter, FocusHandle,
Focusable, ObjectFit, Render, SharedString, StyleRefinement, Subscription, WeakEntity, Window,
div, img, px, uniform_list,
};
use gpui_component::avatar::Avatar;
use gpui_component::button::{Button, ButtonVariants};
@@ -287,6 +288,63 @@ impl SidebarPanel {
cx,
)
}
/// Sign-in placeholder shown while logged out: the banner artwork fills the
/// panel behind a scrim that fades into the theme's sidebar color, keeping
/// the CTA buttons readable on a clean surface.
fn render_sign_in(&self, cx: &mut Context<Self>) -> Div {
const HEADLINE: &str = "Forge together. Ship anything.";
const SUBHEADLINE: &str = "An open forge for humans and agents";
v_flex()
.size_full()
.relative()
.bg(cx.theme().sidebar)
.text_color(cx.theme().sidebar_foreground)
.child(
div().absolute().inset_0().child(
img("backgrounds/banner.jpg")
.size_full()
.object_fit(ObjectFit::Cover),
),
)
.child(
v_flex()
.size_full()
.items_center()
.justify_end()
.p_4()
.mb_4()
.gap_4()
.child(
v_flex()
.text_color(gpui::white())
.child(div().text_sm().font_semibold().child(HEADLINE))
.child(div().text_xs().child(SUBHEADLINE)),
)
.child(
v_flex()
.gap_1()
.w_full()
.child(
Button::new("onboarding")
.label("Join now")
.primary()
.on_click(cx.listener(|this, _ev, window, cx| {
this.open_onboarding(window, cx)
})),
)
.child(
Button::new("import")
.label("Import identity")
.ghost()
.on_click(cx.listener(|this, _ev, window, cx| {
this.open_import(window, cx)
})),
),
),
)
}
}
impl BasePanel for SidebarPanel {
@@ -316,36 +374,7 @@ impl Focusable for SidebarPanel {
impl Render for SidebarPanel {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
if !self.logged_in {
return v_flex()
.p_4()
.size_full()
.items_center()
.justify_center()
.gap_2()
.child(
div()
.text_sm()
.text_color(cx.theme().muted_foreground)
.child("Sign in to continue"),
)
.child(
Button::new("onboarding")
.label("Join now")
.primary()
.w_full()
.on_click(
cx.listener(|this, _ev, window, cx| this.open_onboarding(window, cx)),
),
)
.child(
Button::new("import-identity")
.label("Import identity")
.secondary()
.w_full()
.on_click(
cx.listener(|this, _ev, window, cx| this.open_import(window, cx)),
),
);
return self.render_sign_in(cx);
}
let backend = Backend::global(cx);