This commit is contained in:
2026-10-24 18:19:03 +07:00
parent 3212951ed4
commit 8929e3137b
6 changed files with 61 additions and 45 deletions
Generated
+18 -18
View File
@@ -299,7 +299,7 @@ dependencies = [
[[package]] [[package]]
name = "assets" name = "assets"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"gpui-kit", "gpui-kit",
@@ -542,7 +542,7 @@ dependencies = [
[[package]] [[package]]
name = "auto_update" name = "auto_update"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"futures", "futures",
"gpui-pre", "gpui-pre",
@@ -1041,7 +1041,7 @@ dependencies = [
[[package]] [[package]]
name = "chat" name = "chat"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"common", "common",
@@ -1064,7 +1064,7 @@ dependencies = [
[[package]] [[package]]
name = "chat_ui" name = "chat_ui"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chat", "chat",
@@ -1221,7 +1221,7 @@ dependencies = [
[[package]] [[package]]
name = "common" name = "common"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"chrono", "chrono",
"dirs 5.0.1", "dirs 5.0.1",
@@ -1335,7 +1335,7 @@ dependencies = [
[[package]] [[package]]
name = "coop" name = "coop"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"assets", "assets",
"auto_update", "auto_update",
@@ -1364,7 +1364,7 @@ dependencies = [
[[package]] [[package]]
name = "coop_web" name = "coop_web"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"chat", "chat",
"console_error_panic_hook", "console_error_panic_hook",
@@ -4765,7 +4765,7 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
[[package]] [[package]]
name = "nip29" name = "nip29"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chat", "chat",
@@ -4783,7 +4783,7 @@ dependencies = [
[[package]] [[package]]
name = "nip29_ui" name = "nip29_ui"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chat", "chat",
@@ -4804,7 +4804,7 @@ dependencies = [
[[package]] [[package]]
name = "nip4e" name = "nip4e"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"flume 0.11.1", "flume 0.11.1",
@@ -5697,7 +5697,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]] [[package]]
name = "person" name = "person"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"common", "common",
@@ -6576,9 +6576,9 @@ checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
[[package]] [[package]]
name = "roxmltree" name = "roxmltree"
version = "0.21.1" version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1964b10c76125c36f8afe190065a4bf9a87bf324842c05701330bba9f1cacbb" checksum = "9da7f59328b09405b181fee1018925fad50f157afb43c0c0f5c522c256dd5907"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -7161,7 +7161,7 @@ dependencies = [
[[package]] [[package]]
name = "settings" name = "settings"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"common", "common",
@@ -7417,7 +7417,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
[[package]] [[package]]
name = "state" name = "state"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"aes-gcm", "aes-gcm",
"anyhow", "anyhow",
@@ -8236,7 +8236,7 @@ dependencies = [
[[package]] [[package]]
name = "ui" name = "ui"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"common", "common",
"gpui-base", "gpui-base",
@@ -8444,7 +8444,7 @@ dependencies = [
"kurbo 0.13.1", "kurbo 0.13.1",
"log", "log",
"pico-args", "pico-args",
"roxmltree 0.21.1", "roxmltree 0.21.2",
"rustybuzz", "rustybuzz",
"simplecss", "simplecss",
"siphasher", "siphasher",
@@ -9674,7 +9674,7 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
[[package]] [[package]]
name = "workspace" name = "workspace"
version = "2.0.0-alpha" version = "2.0.0-alpha2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"auto_update", "auto_update",
+1
View File
@@ -11,6 +11,7 @@ serde.workspace = true
serde_json.workspace = true serde_json.workspace = true
futures.workspace = true futures.workspace = true
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
gpui-updater-pre = "0.2" gpui-updater-pre = "0.2"
[dev-dependencies] [dev-dependencies]
+1
View File
@@ -6,6 +6,7 @@ use anyhow::{Error, anyhow};
use browser_signer_proxy::prelude::*; use browser_signer_proxy::prelude::*;
use common::config_dir; use common::config_dir;
use gpui::{App, AppContext, Context, Entity, EventEmitter, Global, Task, TaskExt}; use gpui::{App, AppContext, Context, Entity, EventEmitter, Global, Task, TaskExt};
#[cfg(not(target_arch = "wasm32"))]
use gpui_tokio::Tokio; use gpui_tokio::Tokio;
use instant::Duration; use instant::Duration;
use nostr_connect::prelude::*; use nostr_connect::prelude::*;
+9 -4
View File
@@ -226,7 +226,6 @@ impl Render for ImportIdentity {
const BUNKER_WARN: &str = "Nostr Connect will usually take more time to get all your messages. Please keep your session open until you see all your messages."; const BUNKER_WARN: &str = "Nostr Connect will usually take more time to get all your messages. Please keep your session open until you see all your messages.";
const KEY_WARN: &str = "Coop encrypts your key with your passphrase and stores it on this device. You only need the passphrase to sign in next time."; const KEY_WARN: &str = "Coop encrypts your key with your passphrase and stores it on this device. You only need the passphrase to sign in next time.";
let is_wasm = cfg!(target_arch = "wasm32");
let is_unlock = self.mode == Mode::Unlock; let is_unlock = self.mode == Mode::Unlock;
let value = self.key_input.read(cx).value().trim().to_string(); let value = self.key_input.read(cx).value().trim().to_string();
@@ -305,7 +304,8 @@ impl Render for ImportIdentity {
) )
}), }),
) )
.child( .child({
let content = v_flex().child(
Button::new("login") Button::new("login")
.label(if is_unlock { "Unlock" } else { "Continue" }) .label(if is_unlock { "Unlock" } else { "Continue" })
.primary() .primary()
@@ -314,8 +314,10 @@ impl Render for ImportIdentity {
.on_click(cx.listener(move |this, _ev, _window, cx| { .on_click(cx.listener(move |this, _ev, _window, cx| {
this.login(cx); this.login(cx);
})), })),
) );
.when(!is_wasm && !is_unlock, |this| {
#[cfg(not(target_arch = "wasm32"))]
let content = content.when(!is_unlock, |this| {
this.child( this.child(
Button::new("proxy") Button::new("proxy")
.label("Connect via Web Extension (Experimental)") .label("Connect via Web Extension (Experimental)")
@@ -325,6 +327,9 @@ impl Render for ImportIdentity {
this.proxy(cx); this.proxy(cx);
})), })),
) )
});
content
}) })
.when_some(self.error.read(cx).as_ref(), |this, error| { .when_some(self.error.read(cx).as_ref(), |this, error| {
this.child( this.child(
+4 -1
View File
@@ -2,6 +2,7 @@ use std::sync::Arc;
use ::settings::{AppSettings, AppearanceMode}; use ::settings::{AppSettings, AppearanceMode};
use anyhow::Error; use anyhow::Error;
#[cfg(not(target_arch = "wasm32"))]
use auto_update::AutoUpdater; use auto_update::AutoUpdater;
use chat::{ChatEvent, ChatRegistry}; use chat::{ChatEvent, ChatRegistry};
use common::download_dir; use common::download_dir;
@@ -372,7 +373,9 @@ impl Workspace {
Command::ImportEncryption => { Command::ImportEncryption => {
self.import_encryption(window, cx); self.import_encryption(window, cx);
} }
Command::Update => { Command::Update =>
{
#[cfg(not(target_arch = "wasm32"))]
if let Some(auto_updater) = AutoUpdater::try_global(cx) { if let Some(auto_updater) = AutoUpdater::try_global(cx) {
auto_updater.update(cx, |this, cx| this.check(cx)); auto_updater.update(cx, |this, cx| this.check(cx));
} }
+13 -7
View File
@@ -1,3 +1,4 @@
#[cfg(not(target_arch = "wasm32"))]
use auto_update::AutoUpdater; use auto_update::AutoUpdater;
use gpui::prelude::FluentBuilder; use gpui::prelude::FluentBuilder;
use gpui::{ use gpui::{
@@ -25,6 +26,7 @@ impl Sidebar {
current_user: &PublicKey, current_user: &PublicKey,
cx: &mut Context<Self>, cx: &mut Context<Self>,
) -> Stateful<Div> { ) -> Stateful<Div> {
#[cfg(not(target_arch = "wasm32"))]
let updater = AutoUpdater::try_global(cx); let updater = AutoUpdater::try_global(cx);
let profile = self.directory.read(cx).person(current_user, cx); let profile = self.directory.read(cx).person(current_user, cx);
let avatar = profile.avatar(); let avatar = profile.avatar();
@@ -62,12 +64,15 @@ impl Sidebar {
) )
}), }),
) )
.child( .child({
h_flex() let actions = h_flex().gap_1();
.gap_1()
.when_some(updater, |this, updater| { #[cfg(not(target_arch = "wasm32"))]
let actions = actions.when_some(updater, |this, updater| {
this.child(self.render_updater(updater, cx)) this.child(self.render_updater(updater, cx))
}) });
actions
.child( .child(
Button::new("sidebar-search") Button::new("sidebar-search")
.icon(IconName::Search) .icon(IconName::Search)
@@ -104,8 +109,8 @@ impl Sidebar {
this.hide_group(cx); this.hide_group(cx);
})), })),
) )
}), })
) })
} }
/// The bottom navigation, pinned below the list like signed's sidebar. /// The bottom navigation, pinned below the list like signed's sidebar.
@@ -128,6 +133,7 @@ impl Sidebar {
) )
} }
#[cfg(not(target_arch = "wasm32"))]
fn render_updater(&self, updater: Entity<AutoUpdater>, cx: &mut App) -> AnyElement { fn render_updater(&self, updater: Entity<AutoUpdater>, cx: &mut App) -> AnyElement {
let status = updater.read(cx).status(); let status = updater.read(cx).status();
let up_to_date = updater.read(cx).up_to_date(); let up_to_date = updater.read(cx).up_to_date();