diff --git a/Cargo.lock b/Cargo.lock
index 7c6d5e2..d81ea63 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1302,7 +1302,6 @@ dependencies = [
"gpui_tokio",
"indexset",
"itertools 0.13.0",
- "key_store",
"log",
"nostr-connect",
"nostr-sdk",
@@ -3341,22 +3340,6 @@ dependencies = [
"wasm-bindgen",
]
-[[package]]
-name = "key_store"
-version = "0.3.0"
-dependencies = [
- "anyhow",
- "common",
- "futures",
- "gpui",
- "log",
- "nostr-sdk",
- "serde",
- "serde_json",
- "smallvec",
- "smol",
-]
-
[[package]]
name = "khronos-egl"
version = "6.0.0"
diff --git a/assets/icons/chevron-down.svg b/assets/icons/chevron-down.svg
new file mode 100644
index 0000000..d8788af
--- /dev/null
+++ b/assets/icons/chevron-down.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/fistbump-fill.svg b/assets/icons/fistbump-fill.svg
new file mode 100644
index 0000000..ad34489
--- /dev/null
+++ b/assets/icons/fistbump-fill.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/fistbump.svg b/assets/icons/fistbump.svg
new file mode 100644
index 0000000..4a3d0dc
--- /dev/null
+++ b/assets/icons/fistbump.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/inbox-fill.svg b/assets/icons/inbox-fill.svg
new file mode 100644
index 0000000..719c050
--- /dev/null
+++ b/assets/icons/inbox-fill.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/icons/inbox.svg b/assets/icons/inbox.svg
new file mode 100644
index 0000000..5569c57
--- /dev/null
+++ b/assets/icons/inbox.svg
@@ -0,0 +1,3 @@
+
diff --git a/crates/chat/src/lib.rs b/crates/chat/src/lib.rs
index 3946225..d4eebf0 100644
--- a/crates/chat/src/lib.rs
+++ b/crates/chat/src/lib.rs
@@ -309,27 +309,21 @@ impl ChatRegistry {
.map(|this| this.downgrade())
}
- /// Get all rooms.
- pub fn rooms(&self, _cx: &App) -> &Vec> {
- &self.rooms
- }
-
- /// Get all ongoing rooms.
- pub fn ongoing_rooms(&self, cx: &App) -> Vec> {
+ /// Get all rooms based on the filter.
+ pub fn rooms(&self, filter: &RoomKind, cx: &App) -> Vec> {
self.rooms
.iter()
- .filter(|room| room.read(cx).kind == RoomKind::Ongoing)
+ .filter(|room| &room.read(cx).kind == filter)
.cloned()
.collect()
}
- /// Get all request rooms.
- pub fn request_rooms(&self, cx: &App) -> Vec> {
+ /// Count the number of rooms based on the filter.
+ pub fn count(&self, filter: &RoomKind, cx: &App) -> usize {
self.rooms
.iter()
- .filter(|room| room.read(cx).kind != RoomKind::Ongoing)
- .cloned()
- .collect()
+ .filter(|room| &room.read(cx).kind == filter)
+ .count()
}
/// Add a new room to the start of list.
diff --git a/crates/common/src/constants.rs b/crates/common/src/constants.rs
index bfa6c11..9cad0a5 100644
--- a/crates/common/src/constants.rs
+++ b/crates/common/src/constants.rs
@@ -26,6 +26,3 @@ pub const NOSTR_CONNECT_TIMEOUT: u64 = 200;
/// Default timeout (in seconds) for Nostr Connect (Bunker)
pub const BUNKER_TIMEOUT: u64 = 30;
-
-/// Default width of the sidebar.
-pub const DEFAULT_SIDEBAR_WIDTH: f32 = 240.;
diff --git a/crates/coop/Cargo.toml b/crates/coop/Cargo.toml
index d110f69..94a62ac 100644
--- a/crates/coop/Cargo.toml
+++ b/crates/coop/Cargo.toml
@@ -35,7 +35,6 @@ theme = { path = "../theme" }
common = { path = "../common" }
state = { path = "../state" }
device = { path = "../device" }
-key_store = { path = "../key_store" }
chat = { path = "../chat" }
chat_ui = { path = "../chat_ui" }
settings = { path = "../settings" }
diff --git a/crates/coop/src/actions.rs b/crates/coop/src/actions.rs
index a6cbdf8..37c2cb9 100644
--- a/crates/coop/src/actions.rs
+++ b/crates/coop/src/actions.rs
@@ -1,6 +1,4 @@
-use gpui::{actions, App};
-use key_store::{KeyItem, KeyStore};
-use state::NostrRegistry;
+use gpui::actions;
// Sidebar actions
actions!(sidebar, [Reload, RelayStatus]);
@@ -19,30 +17,3 @@ actions!(
Quit
]
);
-
-pub fn reset(cx: &mut App) {
- let backend = KeyStore::global(cx).read(cx).backend();
- let client = NostrRegistry::global(cx).read(cx).client();
-
- cx.spawn(async move |cx| {
- // Remove the signer
- client.unset_signer().await;
-
- // Delete user's credentials
- backend
- .delete_credentials(&KeyItem::User.to_string(), cx)
- .await
- .ok();
-
- // Remove bunker's credentials if available
- backend
- .delete_credentials(&KeyItem::Bunker.to_string(), cx)
- .await
- .ok();
-
- cx.update(|cx| {
- cx.restart();
- });
- })
- .detach();
-}
diff --git a/crates/coop/src/main.rs b/crates/coop/src/main.rs
index 1a0fd73..139bba6 100644
--- a/crates/coop/src/main.rs
+++ b/crates/coop/src/main.rs
@@ -82,9 +82,6 @@ fn main() {
// Initialize theme registry
theme::init(cx);
- // Initialize backend for keys storage
- key_store::init(cx);
-
// Initialize the nostr client
state::init(cx);
diff --git a/crates/coop/src/panels/greeter.rs b/crates/coop/src/panels/greeter.rs
index a66598f..1a9798d 100644
--- a/crates/coop/src/panels/greeter.rs
+++ b/crates/coop/src/panels/greeter.rs
@@ -37,20 +37,13 @@ impl Panel for GreeterPanel {
}
fn title(&self, cx: &App) -> AnyElement {
- h_flex()
- .gap_1p5()
+ div()
.child(
svg()
.path("brand/coop.svg")
.size_4()
.text_color(cx.theme().text_muted),
)
- .child(
- div()
- .text_xs()
- .text_color(cx.theme().text_muted)
- .child(self.name.clone()),
- )
.into_any_element()
}
}
diff --git a/crates/coop/src/sidebar/list_item.rs b/crates/coop/src/sidebar/list_item.rs
index 01d94eb..a49f78f 100644
--- a/crates/coop/src/sidebar/list_item.rs
+++ b/crates/coop/src/sidebar/list_item.rs
@@ -125,14 +125,7 @@ impl RenderOnce for RoomListItem {
.flex_shrink_0()
.text_xs()
.text_color(cx.theme().text_placeholder)
- .when_some(self.created_at, |this, created_at| this.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),
- )
- })
- }),
+ .when_some(self.created_at, |this, created_at| this.child(created_at)),
),
)
.hover(|this| this.bg(cx.theme().elevated_surface_background))
diff --git a/crates/coop/src/sidebar/mod.rs b/crates/coop/src/sidebar/mod.rs
index 82e1199..487a3ec 100644
--- a/crates/coop/src/sidebar/mod.rs
+++ b/crates/coop/src/sidebar/mod.rs
@@ -1,36 +1,23 @@
use std::ops::Range;
-use std::time::Duration;
-use anyhow::{anyhow, Error};
-use chat::{ChatEvent, ChatRegistry, Room};
-use common::{DebouncedDelay, RenderedTimestamp, TextUtils, BOOTSTRAP_RELAYS, SEARCH_RELAYS};
+use chat::{ChatEvent, ChatRegistry, RoomKind};
+use common::RenderedTimestamp;
use dock::panel::{Panel, PanelEvent};
use gpui::prelude::FluentBuilder;
use gpui::{
- deferred, div, rems, uniform_list, App, AppContext, Context, Entity, EventEmitter, FocusHandle,
+ deferred, div, uniform_list, App, AppContext, Context, Entity, EventEmitter, FocusHandle,
Focusable, IntoElement, ParentElement, Render, RetainAllImageCache, SharedString, Styled,
- Subscription, Task, Window,
+ Subscription, Window,
};
-use gpui_tokio::Tokio;
use list_item::RoomListItem;
-use nostr_sdk::prelude::*;
-use person::PersonRegistry;
use smallvec::{smallvec, SmallVec};
-use state::NostrRegistry;
-use theme::{ActiveTheme, TITLEBAR_HEIGHT};
-use ui::avatar::Avatar;
+use theme::{ActiveTheme, TABBAR_HEIGHT};
use ui::button::{Button, ButtonVariants};
use ui::indicator::Indicator;
-use ui::input::{InputEvent, InputState, TextInput};
-use ui::{h_flex, v_flex, IconName, Sizable, StyledExt, WindowExtension};
-
-use crate::dialogs::compose::compose_button;
+use ui::{h_flex, v_flex, IconName, Selectable, Sizable, StyledExt};
mod list_item;
-const FIND_DELAY: u64 = 600;
-const FIND_LIMIT: usize = 20;
-
pub fn init(window: &mut Window, cx: &mut App) -> Entity {
cx.new(|cx| Sidebar::new(window, cx))
}
@@ -38,48 +25,25 @@ pub fn init(window: &mut Window, cx: &mut App) -> Entity {
/// Sidebar.
pub struct Sidebar {
name: SharedString,
-
- /// Focus handle for the sidebar
focus_handle: FocusHandle,
/// Image cache
image_cache: Entity,
- /// Search results
- search_results: Entity