diff --git a/CHANGELOG.md b/CHANGELOG.md index d23cde3..96783e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Added +- Follow the operating system's native theme on macOS, Windows and Linux (KDE, GNOME), applying the OS colors, fonts, radii and accessibility preferences. - Add an identity import dialog, importing an existing identity by pasting its `nsec` secret key (encrypted with a new passphrase), NIP-49 `ncryptsec` (unlocked with its passphrase), or `bunker://` NIP-46 URI - Add a dropdown menu on the signed-in user button in the sidebar - Add sign-out feature, confirmed by an alert dialog before deleting the stored session credential @@ -17,6 +18,7 @@ ### Changed +- Use the built-in light/dark syntax highlighting palette instead of the Signed palette bundled in `signed.json` when the native theme is active - Increase the default theme corner radii from 2 to 4 and large radii from 6 to 8 - Surface backend errors as error notifications in the workspace instead of silently dropping them - Break ties in repository activity lists by event id, so same-second events order deterministically @@ -41,6 +43,7 @@ ### Removed +- Remove the light/dark theme pickers and the font size, corner radius, focus ring and shadow settings from the settings dialog; colors and geometry now come from the native theme - Remove dead code: the unused `login`/`logout` family, the unwired `SyncProgress` pipeline, `merge_pull_request`, inbox mark-read/archive APIs and the wasm32-only code paths ### Deprecated diff --git a/Cargo.lock b/Cargo.lock index e0d0ab3..423cc86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -176,9 +176,9 @@ dependencies = [ [[package]] name = "annotate-snippets" -version = "0.12.16" +version = "0.12.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f211a51805bc641f3ad5b7664c77d2547af685cc33b4cd8d31964027a46f13f1" +checksum = "b2a5b0a5ab8561c603f16c3b78c24a386b1f70e7fc1b1b1e8c15738828e4a176" dependencies = [ "anstyle", "memchr", @@ -199,15 +199,15 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "arbitrary" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed" [[package]] name = "arc-swap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" +checksum = "380962b3d93b99642e50b9febf72c071e97e8b32d86eae9cf4ef582bb960ae6e" dependencies = [ "rustversion", ] @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.50" +version = "0.4.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee19bd99b43e3691acbad4e840420a4881cea6c0b66a208125a824f8fd53f5a1" +checksum = "9d5755640120b24961f8231e05892e4a4f7e0d04e8aeca161508c9c397946970" dependencies = [ "compression-codecs", "compression-core", @@ -421,7 +421,7 @@ checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -456,13 +456,13 @@ checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] name = "async-utility" version = "0.3.2" -source = "git+https://github.com/yukibtc/async-utility?rev=7d3a79983d0e848aafed9d321637af7334e01349#7d3a79983d0e848aafed9d321637af7334e01349" +source = "git+https://github.com/yukibtc/async-utility?rev=b323ae0c1c1424b78bf8bb8832b95e86771f1dee#b323ae0c1c1424b78bf8bb8832b95e86771f1dee" dependencies = [ "futures-util", "gloo-timers", @@ -590,9 +590,9 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.18.1" +version = "1.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e" +checksum = "faac5829c2b74c28f830747e7818ccfb684261b5f48a1118b1e2a13d36dfab13" dependencies = [ "aws-lc-sys", "zeroize", @@ -600,9 +600,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27" +checksum = "f1622d8446a2d4b2ce0c7eefc73dd43a99779028d5ee5c2dd8073a658ba8a2bc" dependencies = [ "cc", "cmake", @@ -681,15 +681,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec 0.8.0", -] - [[package]] name = "bit-set" version = "0.9.1" @@ -700,10 +691,13 @@ dependencies = [ ] [[package]] -name = "bit-vec" -version = "0.8.0" +name = "bit-set" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c" +dependencies = [ + "bit-vec 0.10.1", +] [[package]] name = "bit-vec" @@ -711,6 +705,16 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" +[[package]] +name = "bit-vec" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269" +dependencies = [ + "borsh", + "serde", +] + [[package]] name = "bit_field" version = "0.10.3" @@ -859,6 +863,39 @@ dependencies = [ "piper", ] +[[package]] +name = "borsh" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + [[package]] name = "bstr" version = "1.13.1" @@ -899,7 +936,7 @@ checksum = "6a1f896587b6f2c069c73d2f0913e2d590c3990285cd2f0b6aa02b786b4c679c" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -969,7 +1006,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff" dependencies = [ "heck 0.4.1", - "indexmap", + "indexmap 2.14.2", "log", "proc-macro2", "quote", @@ -1090,7 +1127,7 @@ checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c" dependencies = [ "block-buffer 0.12.1", "crypto-common 0.2.2", - "inout 0.2.2", + "inout 0.2.5", ] [[package]] @@ -1206,9 +1243,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "combine" -version = "4.6.8" +version = "4.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e" +checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" dependencies = [ "bytes", "memchr", @@ -1216,9 +1253,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.45" +version = "0.4.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98fc98460ba0ad5317075d3632b8dfc45d0be8c4a49347c2a38272019717614a" +checksum = "cae36683101b2899f48bd31f8db9839437356188e3b1ff23096e73dab09ba8fe" dependencies = [ "bzip2", "compression-core", @@ -1228,9 +1265,9 @@ dependencies = [ [[package]] name = "compression-core" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8ccc4ea9f6acc32d102c0f6d471d11d913ad15f20c04de743374861fa1d414" +checksum = "2ebdda89edc534bf8d5dd2857562633b6495557e5846552ade994b99ed13c36a" [[package]] name = "concurrent-queue" @@ -1241,6 +1278,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "configparser" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031ad3d167622974ed636505ae4556267ed4aa2aea0464122fa6bc9698a32825" + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -1574,6 +1617,40 @@ dependencies = [ "cmov", ] +[[package]] +name = "darling" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 3.0.9", +] + +[[package]] +name = "darling_macro" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" +dependencies = [ + "darling_core", + "quote", + "syn 3.0.9", +] + [[package]] name = "dashmap" version = "6.2.1" @@ -1602,18 +1679,18 @@ checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" [[package]] name = "defmt" -version = "0.3.100" +version = "0.3.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad" +checksum = "4deef977660e373c458df605a913d4ab121db0ccd18d1ad6976dff7d37cddb53" dependencies = [ - "defmt 1.1.1", + "defmt 1.2.0", ] [[package]] name = "defmt" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" +checksum = "e4a0795ac740cb54d7b3775c9c17345f6aaecf884c01733b39d6017738e0e3e1" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -1621,30 +1698,33 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" +checksum = "840bb056bd99c495c9188198a258ab787c79f306d864db3e6e8451442d6d8366" dependencies = [ "defmt-parser", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] name = "defmt-parser" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +checksum = "71958f69fb2de856c5dd51ac9377e986ca1aa5919f931bf5395a807277f889a0" dependencies = [ "thiserror 2.0.21", ] [[package]] name = "deranged" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e" +dependencies = [ + "serde_core", +] [[package]] name = "derive_more" @@ -1769,7 +1849,7 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -1855,7 +1935,7 @@ dependencies = [ "cc", "memchr", "rustc_version", - "toml 1.1.6+spec-1.1.0", + "toml 1.1.8+spec-1.1.0", "vswhom", "winreg", ] @@ -1963,9 +2043,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" [[package]] name = "erased-serde" @@ -2051,7 +2131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04839bdf9d8c10f66806fad16b852fc72aab80873aebc3cb69d85b4fa41543ed" dependencies = [ "autocfg", - "defmt 0.3.100", + "defmt 0.3.101", "heapless 0.8.0", "serde", ] @@ -2103,9 +2183,9 @@ dependencies = [ [[package]] name = "find-msvc-tools" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484" +checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48" [[package]] name = "fixedbitset" @@ -2213,9 +2293,9 @@ dependencies = [ [[package]] name = "font-types" -version = "0.12.6" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c92d9081c7ab3bd83ef1eecdfad090f3d966e3ce74106779664114cfe1a6274" +checksum = "835ae9d781464a79026cde387f9cbc650c9a4909d7cf7e658b127e3c35d2f35d" dependencies = [ "bytemuck", ] @@ -2261,7 +2341,7 @@ checksum = "ea5190182e6915eb873ddbc16e23b711b6eb1f9c00a0d0a3a91b5f6228475225" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2397,7 +2477,7 @@ checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -2883,9 +2963,9 @@ dependencies = [ [[package]] name = "gix-imara-diff" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305657ad44356151d73c145f567c25b24fdf2466bfb3e90727e1d5461a4e9748" +checksum = "1c48eccd894bd15555b0346470e63491ded94aefe76b3fcb1052084b5a393238" dependencies = [ "bstr", "hashbrown 0.17.1", @@ -3548,7 +3628,7 @@ dependencies = [ "raw-window-handle", "regex", "ropey", - "schemars", + "schemars 1.2.3", "serde", "serde_json", "smallvec", @@ -3593,7 +3673,7 @@ dependencies = [ "resvg 0.45.1", "ropey", "rust-i18n", - "schemars", + "schemars 1.2.3", "serde", "serde_json", "serde_repr", @@ -3641,9 +3721,9 @@ dependencies = [ [[package]] name = "gpui-component-macros" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2968cc7f4a2bd8f51b09cfe4f1e77409951b48a0e2d48f372b010e69c3d7fb49" +checksum = "5c0c9398aaf99e595d450e38eb44ff0c500df8c332b4783d5b72022e69525359" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3653,9 +3733,9 @@ dependencies = [ [[package]] name = "gpui-kit-assets" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c481ca987f1e6f10b1aed4d47f1b301cd1dc6f3016fac93c305f2a4f307c0" +checksum = "cb5fd2b154c96abe8ac49d8c431a24a764977128fce6a72a5f9f1e8802f64fe7" dependencies = [ "anyhow", "gpui-pre", @@ -3718,7 +3798,7 @@ dependencies = [ "raw-window-handle", "regex", "resvg 0.46.0", - "schemars", + "schemars 1.2.3", "seahash", "serde", "serde_json", @@ -3776,7 +3856,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c060863025dc3b8e90febad2d1f4ffd23a5d0dcedba39d3f6b7820ea2fdd3a0" dependencies = [ "gpui-pre-util", - "indexmap", + "indexmap 2.14.2", "rustc-hash 2.1.3", ] @@ -3821,7 +3901,7 @@ dependencies = [ "log", "rustls", "rustls-platform-verifier", - "webpki-roots 1.0.9", + "webpki-roots 1.0.10", ] [[package]] @@ -4054,7 +4134,7 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "477529fd5aa90bff969785ee9a3938484d94aa5101cdf7b84719629c0345f98a" dependencies = [ - "schemars", + "schemars 1.2.3", "serde", "smol_str", ] @@ -4232,7 +4312,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap", + "indexmap 2.14.2", "slab", "tokio", "tokio-util", @@ -4273,6 +4353,12 @@ dependencies = [ "byteorder", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.5" @@ -4669,6 +4755,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "1.1.0" @@ -4757,6 +4849,17 @@ version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f" +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + [[package]] name = "indexmap" version = "2.14.2" @@ -4801,9 +4904,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4250ce6452e92010fdf7268ccc5d14faa80bb12fc741938534c58f16804e03c7" +checksum = "3b5cf4372d022092674a83b8febf5865f7a573cc0c5baec5e49c879b6a20978f" dependencies = [ "hybrid-array", ] @@ -4833,9 +4936,9 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" +checksum = "6928282826c822ad91bf1c9a1cb90a30ba1c26770749929b4656cd6be829cd7c" dependencies = [ "rustversion", ] @@ -4926,7 +5029,7 @@ version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2b005715dcbeb0089a3c0dab99f2ff1cc3b2525323552703d648585d342a383" dependencies = [ - "defmt 1.1.1", + "defmt 1.2.0", "jiff-core", "jiff-static", "jiff-tzdb-platform", @@ -4943,7 +5046,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e52fe76043ccecc9005d2305ebaadf7d7fc0cc89ca6baa10a94d6bc68c7128c" dependencies = [ - "defmt 1.1.1", + "defmt 1.2.0", "log", ] @@ -5148,9 +5251,9 @@ checksum = "34b357333733e8260735ba5894eb928c02ecc69c78715f01a8019e7fa7f2db4c" [[package]] name = "libc" -version = "0.2.190" +version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" [[package]] name = "libfuzzer-sys" @@ -5219,9 +5322,9 @@ checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" [[package]] name = "litrs" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" +checksum = "4744e383959f0db86ede514b809b1c53251889093803c05267acc7d4e7030d70" [[package]] name = "lmdb-master-sys" @@ -5571,7 +5674,7 @@ dependencies = [ "half", "hashbrown 0.16.1", "hexf-parse", - "indexmap", + "indexmap 2.14.2", "libm", "log", "num-traits", @@ -5582,6 +5685,59 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "native-theme" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea89548b5c74493eeda312d5b1dad2c3c5f3bb35076dfef7c9a5b85c5cf140bf" +dependencies = [ + "arc-swap", + "ashpd", + "async-trait", + "block2 0.6.2", + "configparser", + "fontdb", + "inventory", + "native-theme-derive", + "notify", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-core-text", + "objc2-foundation 0.3.2", + "pollster 1.0.1", + "serde", + "serde_with", + "toml 1.1.8+spec-1.1.0", + "unicase", + "windows 0.62.2", + "zbus", +] + +[[package]] +name = "native-theme-derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cddcfe1cc7b75a3ef362b242343aabf8fd9053ed9b4c72bcf4af4a45989b4d1" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.9", +] + +[[package]] +name = "native-theme-gpui" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5002c99b80209a2da63224a8ffa6a6b95feb836a1098c1189de47f69f3a40053" +dependencies = [ + "gpui-base", + "gpui-component", + "gpui-pre", + "image", + "native-theme", +] + [[package]] name = "ndk-context" version = "0.1.1" @@ -5599,9 +5755,9 @@ dependencies = [ [[package]] name = "negentropy" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81c353b400a5503efdcf398f11a83fb7aa84f59f5d76fc4bf5bbc1e4f5366caa" +checksum = "a3d66662cb5ca384d4991509755ed5a42dd8e31c4282bf881938e506fc3146ec" [[package]] name = "new_debug_unreachable" @@ -5667,7 +5823,7 @@ dependencies = [ [[package]] name = "nostr" version = "0.45.5" -source = "git+https://github.com/rust-nostr/nostr#463f0c2d48e1d3c9e295cc231715d8a3855c65d3" +source = "git+https://github.com/rust-nostr/nostr#20096765b95f4840dd3df66cad49db35e9634462" dependencies = [ "aes", "base64 0.22.1", @@ -5693,10 +5849,9 @@ dependencies = [ [[package]] name = "nostr-connect" version = "0.45.2" -source = "git+https://github.com/rust-nostr/nostr#463f0c2d48e1d3c9e295cc231715d8a3855c65d3" +source = "git+https://github.com/rust-nostr/nostr#20096765b95f4840dd3df66cad49db35e9634462" dependencies = [ "async-utility", - "futures-core", "nostr", "nostr-sdk", "opaquerr", @@ -5707,7 +5862,7 @@ dependencies = [ [[package]] name = "nostr-database" version = "0.45.2" -source = "git+https://github.com/rust-nostr/nostr#463f0c2d48e1d3c9e295cc231715d8a3855c65d3" +source = "git+https://github.com/rust-nostr/nostr#20096765b95f4840dd3df66cad49db35e9634462" dependencies = [ "nostr", "opaquerr", @@ -5716,7 +5871,7 @@ dependencies = [ [[package]] name = "nostr-gossip" version = "0.45.1" -source = "git+https://github.com/rust-nostr/nostr#463f0c2d48e1d3c9e295cc231715d8a3855c65d3" +source = "git+https://github.com/rust-nostr/nostr#20096765b95f4840dd3df66cad49db35e9634462" dependencies = [ "nostr", "opaquerr", @@ -5725,9 +5880,9 @@ dependencies = [ [[package]] name = "nostr-gossip-memory" version = "0.45.1" -source = "git+https://github.com/rust-nostr/nostr#463f0c2d48e1d3c9e295cc231715d8a3855c65d3" +source = "git+https://github.com/rust-nostr/nostr#20096765b95f4840dd3df66cad49db35e9634462" dependencies = [ - "indexmap", + "indexmap 2.14.2", "lru", "nostr", "nostr-gossip", @@ -5737,7 +5892,7 @@ dependencies = [ [[package]] name = "nostr-lmdb" version = "0.45.3" -source = "git+https://github.com/rust-nostr/nostr#463f0c2d48e1d3c9e295cc231715d8a3855c65d3" +source = "git+https://github.com/rust-nostr/nostr#20096765b95f4840dd3df66cad49db35e9634462" dependencies = [ "async-utility", "flatbuffers", @@ -5752,7 +5907,7 @@ dependencies = [ [[package]] name = "nostr-sdk" version = "0.45.4" -source = "git+https://github.com/rust-nostr/nostr#463f0c2d48e1d3c9e295cc231715d8a3855c65d3" +source = "git+https://github.com/rust-nostr/nostr#20096765b95f4840dd3df66cad49db35e9634462" dependencies = [ "async-utility", "async-wsocket", @@ -5791,9 +5946,9 @@ dependencies = [ [[package]] name = "notify-rust" -version = "4.18.1" +version = "4.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe430c879247371c47fdedd328ad4e301e6b30b533c5fd5db1c06d75253d0e46" +checksum = "4587364a9a0074333429b3df75a30a205340c56a536ca3eb6ca0e59b87bbf8af" dependencies = [ "futures-lite", "log", @@ -6094,7 +6249,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ "bitflags 2.13.2", + "block2 0.6.2", "dispatch2", + "libc", "objc2 0.6.5", ] @@ -6165,6 +6322,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" dependencies = [ "bitflags 2.13.2", + "block2 0.6.2", + "libc", "objc2 0.6.5", "objc2-core-foundation", "objc2-core-graphics", @@ -6722,6 +6881,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" +[[package]] +name = "pollster" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6355899e1c9462875b6757c79f3caa011a1fdae12bbb1a2e72dd1f234f8336" + [[package]] name = "poly1305" version = "0.8.0" @@ -6826,7 +6991,7 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ - "toml_edit 0.25.15+spec-1.1.0", + "toml_edit 0.25.17+spec-1.1.0", ] [[package]] @@ -6868,17 +7033,18 @@ dependencies = [ [[package]] name = "proptest" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" +checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0" dependencies = [ - "bit-set 0.8.0", - "bit-vec 0.8.0", + "bit-set 0.11.1", + "bit-vec 0.10.1", "bitflags 2.13.2", + "chacha20 0.10.2", + "core_detect", "num-traits", "proptest-macro", - "rand 0.9.5", - "rand_chacha 0.9.0", + "rand 0.10.3", "rand_xorshift", "regex-syntax", "rusty-fork", @@ -6888,14 +7054,14 @@ dependencies = [ [[package]] name = "proptest-macro" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efaa288b896cb2b345da7b7f2110ab19e51565b83495b56fcec98a62f8b1f33e" +checksum = "e99782ea31698c2206c6887c1220d2f594b291c26cb9ec5b6d7cf175320bc212" dependencies = [ "convert_case 0.11.0", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -7122,11 +7288,11 @@ dependencies = [ [[package]] name = "rand_xorshift" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf" dependencies = [ - "rand_core 0.9.5", + "rand_core 0.10.1", ] [[package]] @@ -7256,7 +7422,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709" dependencies = [ "bytemuck", - "font-types 0.12.6", + "font-types 0.12.7", "once_cell", ] @@ -7313,7 +7479,7 @@ checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -7474,9 +7640,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.12.0" +version = "8.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e7760e252aaba7b09f4be00e36476cf585bdb68a53552ac954cdf504ab4bc9" +checksum = "19afa5b4b6a611de00bd1bdae6ae6f39084c9399f0679c3f52d8469cf335cc23" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -7485,9 +7651,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.12.0" +version = "8.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcfc4d6f53af43755f7a723e4b6b8794fcce052a178dd8c6c1dadc5f5343097" +checksum = "e0d8afda6374eac59e066abee06d265247ebbaf3006cf878e2879e8356e34053" dependencies = [ "mime_guess", "proc-macro2", @@ -7500,12 +7666,12 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "8.12.0" +version = "8.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ffa149f6aa81b58a5b3011d01a857c4ed12c7a732d2c51947a4c7c692185f0" +checksum = "0d84e8ba78bd384263e5922f084cbe1b081c3b7e69add59c8fb097b879ba968a" dependencies = [ "globset", - "sha2 0.11.0", + "sha2 0.11.1", "walkdir", ] @@ -7599,9 +7765,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.45" +version = "0.23.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" +checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf" dependencies = [ "aws-lc-rs", "log", @@ -7615,9 +7781,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" +checksum = "4a073f5dc7469f984c52ad2752b63b0807745133b6de880b7b64c1ac4c48aec4" dependencies = [ "openssl-probe", "rustls-pki-types", @@ -7746,21 +7912,33 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5" dependencies = [ "windows-sys 0.61.2", ] [[package]] name = "schemars" -version = "1.2.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" dependencies = [ "dyn-clone", - "indexmap", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e" +dependencies = [ + "dyn-clone", + "indexmap 2.14.2", "ref-cast", "schemars_derive", "serde", @@ -7769,14 +7947,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98c67716b46af2f0b8cf752abc930f6f9aecfbf671ecfb531db8a31dbe4e2ba" +checksum = "e1c3a92094fa7d61aa124645844facb6b554dfc797136d0f5fd1f890e2bffc69" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -7823,7 +8001,7 @@ dependencies = [ "cfg-if", "pbkdf2 0.13.0", "salsa20", - "sha2 0.11.0", + "sha2 0.11.1", ] [[package]] @@ -7945,7 +8123,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -7956,7 +8134,7 @@ checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -7970,11 +8148,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.151" +version = "1.0.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" dependencies = [ - "indexmap", + "foldhash 0.2.0", + "indexmap 2.14.2", "itoa", "memchr", "serde", @@ -7990,7 +8169,7 @@ checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -8004,9 +8183,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c" dependencies = [ "serde_core", ] @@ -8023,6 +8202,39 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9adc193c780ef8f159aee8b61e2d5801aaa555e6eb0947fe45530ec506296f" +dependencies = [ + "base64 0.23.1", + "bs58", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.14.2", + "jiff", + "schemars 0.9.0", + "schemars 1.2.3", + "serde_core", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e17bbc68e28663bbbb90df47e058aa7eda4fb445b89fe70457bb94fbccf6e49" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 3.0.9", +] + [[package]] name = "settings" version = "0.2.0-alpha" @@ -8071,9 +8283,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" dependencies = [ "cfg-if", "cpufeatures 0.3.1", @@ -8126,11 +8338,14 @@ version = "0.2.0-alpha" dependencies = [ "assets", "dock", + "flume 0.11.1", "gpui-component", "gpui-pre", "gpui-pre-platform", "gpui-pre-reqwest-client", "metadata", + "native-theme", + "native-theme-gpui", "paths", "settings", "signed_state", @@ -8298,9 +8513,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.16.2" +version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e" +checksum = "5b3dc8af474f516a851ff4bd12db780f948b9250ad37211e4eec0bccea54e01b" [[package]] name = "smol" @@ -8423,6 +8638,12 @@ dependencies = [ "quote", ] +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "strum" version = "0.28.0" @@ -8579,9 +8800,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.6" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ "proc-macro2", "quote", @@ -8614,7 +8835,7 @@ checksum = "901704edd0dfe137f1987838ee4f259e4e063c31371bdb423f7ae38ec6f77f02" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -8766,7 +8987,7 @@ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -8803,6 +9024,7 @@ dependencies = [ "powerfmt", "serde_core", "time-core", + "time-macros", ] [[package]] @@ -8811,6 +9033,16 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" +[[package]] +name = "time-macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -8864,9 +9096,9 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "tokio" -version = "1.53.2" +version = "1.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e95f91fcc7a621e8b030f6aa23c71fe9838ae2fb4d8118b75602a328f5144044" +checksum = "a0c168a474b95bfecfe908a65d4bdffc523144b649a74c09c286afb35d53e0bc" dependencies = [ "bytes", "libc", @@ -8894,7 +9126,7 @@ checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -8949,9 +9181,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" +checksum = "e464cf451ba96ebfc6f9b6542f17ee8b8956e33f1e40d9690624e59d7a7f8a4b" dependencies = [ "bytes", "futures-core", @@ -8975,14 +9207,14 @@ dependencies = [ [[package]] name = "toml" -version = "1.1.6+spec-1.1.0" +version = "1.1.8+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "920602543f0911ab71da12c50d59701da54c196d1a2bf5cb4b75667f137a406a" +checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d" dependencies = [ - "indexmap", + "indexmap 2.14.2", "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 1.1.1+spec-1.1.0", + "serde_spanned 1.1.2", + "toml_datetime 1.1.2+spec-1.1.0", "toml_parser", "toml_writer", "winnow 1.0.4", @@ -8999,9 +9231,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.1.1+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" dependencies = [ "serde_core", ] @@ -9012,7 +9244,7 @@ version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ - "indexmap", + "indexmap 2.14.2", "serde", "serde_spanned 0.6.9", "toml_datetime 0.6.11", @@ -9022,21 +9254,21 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.15+spec-1.1.0" +version = "0.25.17+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1340ea94a5856333492c9064b02c778b191dd2c853778d9609debdcdfea3a614" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" dependencies = [ - "indexmap", - "toml_datetime 1.1.1+spec-1.1.0", + "indexmap 2.14.2", + "toml_datetime 1.1.2+spec-1.1.0", "toml_parser", "winnow 1.0.4", ] [[package]] name = "toml_parser" -version = "1.1.3+spec-1.1.0" +version = "1.1.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" dependencies = [ "winnow 1.0.4", ] @@ -9049,9 +9281,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" +checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770" [[package]] name = "tower" @@ -9352,9 +9584,9 @@ dependencies = [ [[package]] name = "tree-sitter-language" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0d1bf6fdd806e43ae5198f82f527056d359def39e54e67a0f478ac09dac081" +checksum = "d0af592be68c579aa78a16846bd19422978c3c52e438523d45ff5d1bff1f9d4a" [[package]] name = "tree-sitter-lua" @@ -9518,9 +9750,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40688ea6389c8171614b25491f71d4a27946e0c7ce2da1c6de27e25abf1a0ae" +checksum = "0d15f4f5898bcfc5d8a8e45ed30b2f108d710c1a2e5489dbf80e078f707181bc" dependencies = [ "arc-swap", "serde", @@ -9628,9 +9860,9 @@ checksum = "65dd75ab2d9d379dbe86d4059e91d8b5a6e7054865eaba1ddbfc7a817ff96392" [[package]] name = "unicode-ident" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" [[package]] name = "unicode-linebreak" @@ -9640,9 +9872,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d" dependencies = [ "tinyvec", ] @@ -9793,9 +10025,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97277d36b9c3ace13e58fa6e753f8b0bbbf302a18dd193240d70f9e29681059a" +checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606" dependencies = [ "getrandom 0.4.3", "js-sys", @@ -9975,7 +10207,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "wasm-bindgen-shared", ] @@ -10150,9 +10382,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b" +checksum = "58ec80e73fd8baf57bf0d9615554c75348bda990d6d5bbeab964dd068319fecb" dependencies = [ "rustls-pki-types", ] @@ -10163,14 +10395,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ - "webpki-roots 1.0.9", + "webpki-roots 1.0.10", ] [[package]] name = "webpki-roots" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +checksum = "1c1c8e20c8a38fc7d65abfe74eb7280e4aa667e8eec8bc84996d2874810748d9" dependencies = [ "rustls-pki-types", ] @@ -10225,7 +10457,7 @@ dependencies = [ "cfg_aliases", "document-features", "hashbrown 0.16.1", - "indexmap", + "indexmap 2.14.2", "log", "naga", "once_cell", @@ -11212,7 +11444,7 @@ checksum = "ec8ebde2db3681e8c9980cc27822030e68752690ddfa9473e739aeb4dbde6d71" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "synstructure", ] @@ -11284,7 +11516,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "zbus_names", "zvariant", "zvariant_utils", @@ -11292,9 +11524,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "4.3.4" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bf88b4a3ff53e883001e0e0115b297a9d53c31b9c1edd2bfdd853e3428624e" +checksum = "812a12be4ead7a59e18ea8f047d08add0066b73bc62fc1467066a2472ae088dd" dependencies = [ "serde", "winnow 1.0.4", @@ -11391,18 +11623,18 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" [[package]] name = "zerocopy" -version = "0.8.60" +version = "0.8.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6400fc4bb7426f6faac3fb07566122bb18622e3022bd2c36426a92ed489b1dbe" +checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.60" +version = "0.8.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c27cc7525bad4df59a45e073c45b2c2aa820efb588234cc23a547ec69a34db" +checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f" dependencies = [ "proc-macro2", "quote", @@ -11426,7 +11658,7 @@ checksum = "f75b4683f6c7f45248d4d64056a24298c6281e0993356d7d1b4a1a962ef10d4a" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "synstructure", ] @@ -11480,7 +11712,7 @@ checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -11536,9 +11768,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "5.15.0" +version = "5.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1d34c27cc6cdd1f458427519dd6b8612f7b7e3f7b9a0b2355d041dda9869147" +checksum = "80bf6d6cd6a4b601acb64cfb8284cdc643fcfa75ef26ae3c46ec8aa4e8a1fbb7" dependencies = [ "endi", "enumflags2", @@ -11552,14 +11784,14 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "5.15.0" +version = "5.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864155e69b4352db0c7f374917bf45d1e0c8d17659c8b3dbf9795f3673f8c497" +checksum = "ef2672456ba1cb54b5eaec136e63135b3c7495fb938e53b28a62e633496d486d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "zvariant_utils", ] @@ -11572,6 +11804,6 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 3.0.6", + "syn 3.0.9", "winnow 1.0.4", ] diff --git a/Cargo.toml b/Cargo.toml index 275b713..ad8bd41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,13 @@ gpui = { package = "gpui-pre", version = "0.3.8" } gpui_platform = { package = "gpui-pre-platform", version = "0.3.8", features = ["font-kit", "x11", "wayland"] } reqwest_client = { package = "gpui-pre-reqwest-client", version = "0.3.8" } -# GPUI Kit -gpui-component = { version = "0.7.1", features = ["tree-sitter-languages"] } -gpui-base = "0.7.1" +# GPUI Kit; exact pins keep the graph on the gpui-pre 0.3.8 closure that +# native-theme-gpui 0.6.1 is verified against (0.7.3 and 0.8 pin 0.3.9). +gpui-component = { version = "=0.7.1", features = ["tree-sitter-languages"] } +gpui-base = "=0.7.1" + +native-theme = { version = "0.6.1", features = ["watch"] } +native-theme-gpui = { version = "0.6.1", default-features = false, features = ["system-fonts"] } dock = { path = "crates/dock" } settings = { path = "crates/settings" } diff --git a/crates/signed_state/src/backend.rs b/crates/signed_state/src/backend.rs index e8f4016..0dd1576 100644 --- a/crates/signed_state/src/backend.rs +++ b/crates/signed_state/src/backend.rs @@ -1,6 +1,7 @@ use std::collections::HashSet; use std::path::PathBuf; use std::str::FromStr; +use std::sync::Arc; use std::time::{Duration, Instant}; use anyhow::{Error, anyhow, bail}; @@ -24,8 +25,6 @@ use crate::repos::RepoListStore; use crate::state::{GitPushMode, GitPushPolicy, GitRef, PushStepStatus, SyncState}; pub const USER_KEYRING: &str = "Signed Safe Storage"; -pub const NOSTR_CONNECT_TIMEOUT: u64 = 60; - const PUMP_DEBOUNCE: Duration = Duration::from_millis(200); #[derive(Debug, Clone)] @@ -199,13 +198,9 @@ impl Backend { } else if content.starts_with("bunker://") { let (base, keys) = extract_master_key(&content)?; let uri = NostrConnectUri::parse(base)?; - let mut signer = NostrConnect::new( - uri, - keys, - Duration::from_secs(NOSTR_CONNECT_TIMEOUT), - None, - )?; - signer.auth_url_handler(SignedAuthUrlHandler); + let signer = NostrConnect::builder(uri, keys) + .auth_url_handler(Arc::new(SignedAuthUrlHandler)) + .build()?; this.update(cx, |this, cx| { this.set_signer(signer, cx); @@ -366,13 +361,9 @@ impl Backend { let write = cx.write_credentials(USER_KEYRING, "bunker", credential.as_bytes()); cx.spawn(async move |this, cx| { - let mut signer = NostrConnect::new( - connect_uri, - keys, - Duration::from_secs(NOSTR_CONNECT_TIMEOUT), - None, - )?; - signer.auth_url_handler(SignedAuthUrlHandler); + let signer = NostrConnect::builder(connect_uri, keys) + .auth_url_handler(Arc::new(SignedAuthUrlHandler)) + .build()?; // Verify the bunker responds before persisting the credential. let public_key = signer.get_public_key_async().await?; diff --git a/crates/workspace/src/views/sidebar/settings_dialog.rs b/crates/workspace/src/views/sidebar/settings_dialog.rs index e986a3c..2518277 100644 --- a/crates/workspace/src/views/sidebar/settings_dialog.rs +++ b/crates/workspace/src/views/sidebar/settings_dialog.rs @@ -1,22 +1,15 @@ -use std::cell::Cell; use std::path::PathBuf; use std::rc::Rc; use gpui::prelude::*; -use gpui::{ - AnyWindowHandle, App, Entity, PathPromptOptions, SharedString, Subscription, Window, div, px, -}; +use gpui::{App, Entity, PathPromptOptions, SharedString, Subscription, Window, div, px}; use gpui_component::button::{Button, ButtonVariants}; -use gpui_component::input::{ - Input, InputEvent, InputState, NumberInput, NumberInputEvent, StepAction, -}; +use gpui_component::input::{Input, InputState}; use gpui_component::select::{Select, SelectEvent, SelectState}; use gpui_component::separator::Separator; -use gpui_component::setting::NumberFieldOptions; use gpui_component::switch::Switch; use gpui_component::{ - ActiveTheme, IconName, IndexPath, Sizable, Theme, ThemeMode, ThemeRegistry, WindowExt, h_flex, - v_flex, + ActiveTheme, IconName, IndexPath, Sizable, Theme, ThemeMode, WindowExt, h_flex, v_flex, }; use settings::{AppearanceMode, EventFetchingStrategy, Settings, SettingsStore}; use signed_ui::{SelectOption, setting_block, setting_row}; @@ -31,34 +24,10 @@ fn selected_index(options: &[SelectOption], value: &str) -> Option { .map(|row| IndexPath::default().row(row)) } -/// Registered themes split into light and dark options, light first. -fn theme_options(cx: &App) -> (Vec, Vec) { - let registry = ThemeRegistry::global(cx); - let mut light = Vec::new(); - let mut dark = Vec::new(); - for config in registry.themes().values() { - let name = config.name.clone(); - if config.mode.is_dark() { - dark.push(SelectOption::new(name.clone(), name)); - } else { - light.push(SelectOption::new(name.clone(), name)); - } - } - light.sort_by(|a, b| a.label().as_ref().cmp(b.label().as_ref())); - dark.sort_by(|a, b| a.label().as_ref().cmp(b.label().as_ref())); - (light, dark) -} - /// Created once when the dialog opens, so control state survives re-renders. struct SettingsControls { appearance: Entity>>, event_fetching: Entity>>, - light_theme: Entity>>, - dark_theme: Entity>>, - font_size: Entity, - mono_font_size: Entity, - radius: Entity, - radius_lg: Entity, grasp_server_input: Entity, /// The effective create-repository folder, shown in a disabled input. default_folder: Entity, @@ -107,38 +76,9 @@ impl SettingsControls { ) }); - let (light_options, dark_options) = theme_options(cx); - let light_theme = cx.new(|cx| { - SelectState::new( - light_options.clone(), - selected_index(&light_options, &settings.theme.light_theme), - window, - cx, - ) - }); - let dark_theme = cx.new(|cx| { - SelectState::new( - dark_options.clone(), - selected_index(&dark_options, &settings.theme.dark_theme), - window, - cx, - ) - }); - - let font_size = cx.new(|cx| { - InputState::new(window, cx).default_value(settings.theme.font_size.to_string()) - }); - let mono_font_size = cx.new(|cx| { - InputState::new(window, cx).default_value(settings.theme.mono_font_size.to_string()) - }); - let radius = cx - .new(|cx| InputState::new(window, cx).default_value(settings.theme.radius.to_string())); - let radius_lg = cx.new(|cx| { - InputState::new(window, cx).default_value(settings.theme.radius_lg.to_string()) - }); - let grasp_server_input = cx.new(|cx| InputState::new(window, cx).placeholder("wss://relay.example.com")); + let default_folder = cx.new(|cx| { let folder = settings .create_repository @@ -178,118 +118,9 @@ impl SettingsControls { } })); - subscriptions.push(cx.subscribe(&light_theme, |_, event, cx| { - if let SelectEvent::Confirm(Some(value)) = event { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit( - |settings| settings.theme.light_theme = value.to_string(), - cx, - ); - }); - apply_theme(cx); - } - })); - - subscriptions.push(cx.subscribe(&dark_theme, |_, event, cx| { - if let SelectEvent::Confirm(Some(value)) = event { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit(|settings| settings.theme.dark_theme = value.to_string(), cx); - }); - apply_theme(cx); - } - })); - - wire_number_input( - &font_size, - &mut subscriptions, - window.window_handle(), - cx, - NumberFieldOptions { - min: 10., - max: 32., - ..Default::default() - }, - settings.theme.font_size as f64, - |value, cx| { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit(|settings| settings.theme.font_size = value as f32, cx); - }); - apply_theme(cx); - }, - ); - - wire_number_input( - &mono_font_size, - &mut subscriptions, - window.window_handle(), - cx, - NumberFieldOptions { - min: 8., - max: 32., - ..Default::default() - }, - settings.theme.mono_font_size as f64, - |value, cx| { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit(|settings| settings.theme.mono_font_size = value as f32, cx); - }); - apply_theme(cx); - }, - ); - - wire_number_input( - &radius, - &mut subscriptions, - window.window_handle(), - cx, - NumberFieldOptions { - min: 0., - max: 24., - ..Default::default() - }, - settings.theme.radius as f64, - |value, cx| { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit(|settings| settings.theme.radius = value as f32, cx); - }); - apply_theme(cx); - }, - ); - - wire_number_input( - &radius_lg, - &mut subscriptions, - window.window_handle(), - cx, - NumberFieldOptions { - min: 0., - max: 24., - ..Default::default() - }, - settings.theme.radius_lg as f64, - |value, cx| { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit(|settings| settings.theme.radius_lg = value as f32, cx); - }); - apply_theme(cx); - }, - ); - Self { appearance, event_fetching, - light_theme, - dark_theme, - font_size, - mono_font_size, - radius, - radius_lg, grasp_server_input, default_folder, _subscriptions: subscriptions, @@ -320,8 +151,6 @@ fn settings_view(controls: &SettingsControls, cx: &mut App) -> impl IntoElement .w_full() .child(appearance_section(controls, cx)) .child(Separator::horizontal()) - .child(theme_section(&settings, controls, cx)) - .child(Separator::horizontal()) .child(tab_bar_section(&settings, cx)) .child(Separator::horizontal()) .child(grasp_servers_section(&settings, controls, cx)) @@ -350,76 +179,6 @@ fn event_fetching_section(controls: &SettingsControls, cx: &App) -> impl IntoEle )) } -fn theme_section(settings: &Settings, controls: &SettingsControls, cx: &App) -> impl IntoElement { - v_flex() - .gap_3() - .w_full() - .child(setting_row( - cx, - "Light Theme", - "The theme to use when the appearance is light.", - Select::new(&controls.light_theme).w_full(), - )) - .child(setting_row( - cx, - "Dark Theme", - "The theme to use when the appearance is dark.", - Select::new(&controls.dark_theme).w_full(), - )) - .child(setting_row( - cx, - "UI Font Size", - "Font size for the UI.", - NumberInput::new(&controls.font_size).w_full(), - )) - .child(setting_row( - cx, - "Editor Font Size", - "Font size for editor text.", - NumberInput::new(&controls.mono_font_size).w_full(), - )) - .child(setting_row( - cx, - "Corner Radius", - "The corner radius for UI elements.", - NumberInput::new(&controls.radius).w_full(), - )) - .child(setting_row( - cx, - "Large Corner Radius", - "The corner radius for large UI elements (dialogs, notifications).", - NumberInput::new(&controls.radius_lg).w_full(), - )) - .child(setting_row( - cx, - "Focus Ring", - "Draw a ring around focused controls.", - Switch::new("focus-ring") - .checked(settings.theme.focus_ring) - .on_click(move |checked: &bool, _window, cx| { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit(|settings| settings.theme.focus_ring = *checked, cx); - }); - apply_theme(cx); - }), - )) - .child(setting_row( - cx, - "Shadows", - "The shadow effect for UI elements.", - Switch::new("shadows") - .checked(settings.theme.shadow) - .on_click(move |checked: &bool, _window, cx| { - let store = SettingsStore::global(cx); - store.update(cx, |store, cx| { - store.edit(|settings| settings.theme.shadow = *checked, cx); - }); - apply_theme(cx); - }), - )) -} - /// Tab bar chrome, such as its next/previous tab buttons. fn tab_bar_section(settings: &Settings, cx: &App) -> impl IntoElement { v_flex().w_full().gap_3().child(setting_row( @@ -724,79 +483,6 @@ fn choose_default_folder(default_folder: &Entity, window: &mut Windo .detach(); } -/// Step actions clamp and persist the value; typed changes parse, clamp and persist. -fn wire_number_input( - state: &Entity, - subscriptions: &mut Vec, - window_handle: AnyWindowHandle, - cx: &mut App, - options: NumberFieldOptions, - initial: f64, - on_change: impl Fn(f64, &mut App) + 'static, -) { - let on_change = Rc::new(on_change); - let initial_value = Rc::new(Cell::new(initial)); - let (min, max, step) = (options.min, options.max, options.step); - - subscriptions.push(cx.subscribe(&state.clone(), { - let state = state.clone(); - let initial_value = initial_value.clone(); - let on_change = on_change.clone(); - move |_, event: &NumberInputEvent, cx| { - let NumberInputEvent::Step(action) = event; - let value = state.read(cx).value(); - if let Ok(value) = value.parse::() { - let new_value = match action { - StepAction::Increment => value + step, - StepAction::Decrement => value - step, - }; - let clamped = new_value.clamp(min, max); - window_handle - .update(cx, |_, window, cx| { - state.update(cx, |input, cx| { - input.set_value(SharedString::from(clamped.to_string()), window, cx); - }); - }) - .ok(); - initial_value.set(clamped); - on_change(clamped, cx); - } - } - })); - - subscriptions.push(cx.subscribe(&state.clone(), { - let state = state.clone(); - let initial_value = initial_value.clone(); - let on_change = on_change.clone(); - move |_, event: &InputEvent, cx| { - if matches!(event, InputEvent::Change) { - let value = state.read(cx).value(); - if value == initial_value.get().to_string() { - return; - } - if let Ok(parsed) = value.parse::() { - let clamped = parsed.clamp(min, max); - initial_value.set(clamped); - on_change(clamped, cx); - if clamped != parsed { - window_handle - .update(cx, |_, window, cx| { - state.update(cx, |input, cx| { - input.set_value( - SharedString::from(clamped.to_string()), - window, - cx, - ); - }); - }) - .ok(); - } - } - } - } - })); -} - fn apply_appearance(appearance: AppearanceMode, cx: &mut App) { match appearance { AppearanceMode::System => Theme::sync_system_appearance(None, cx), @@ -804,33 +490,3 @@ fn apply_appearance(appearance: AppearanceMode, cx: &mut App) { AppearanceMode::Dark => Theme::change(ThemeMode::Dark, None, cx), } } - -fn apply_theme(cx: &mut App) { - let store = SettingsStore::global(cx); - let settings = store.read(cx).settings().theme.clone(); - - let registry = ThemeRegistry::global(cx); - let light_config = registry - .themes() - .get(settings.light_theme.as_str()) - .cloned(); - let dark_config = registry.themes().get(settings.dark_theme.as_str()).cloned(); - let mode = Theme::global(cx).mode; - - let theme = Theme::global_mut(cx); - theme.radius = px(settings.radius); - theme.radius_lg = px(settings.radius_lg); - theme.focus_ring = settings.focus_ring; - theme.shadow = settings.shadow; - theme.font_size = px(settings.font_size); - theme.mono_font_size = px(settings.mono_font_size); - if let Some(config) = light_config { - theme.light_theme = config; - } - if let Some(config) = dark_config { - theme.dark_theme = config; - } - - // Re-apply the active mode so the updated configs take effect. - Theme::change(mode, None, cx); -} diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index 92623b9..0175475 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -38,6 +38,9 @@ gpui.workspace = true gpui_platform.workspace = true dock = { workspace = true } gpui-component.workspace = true +native-theme.workspace = true +native-theme-gpui.workspace = true +flume.workspace = true reqwest_client.workspace = true tracing.workspace = true tracing-subscriber.workspace = true diff --git a/desktop/src/main.rs b/desktop/src/main.rs index c732e4a..5606dec 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -5,7 +5,9 @@ use dock::TAB_BAR_HEIGHT; use gpui::*; use gpui_component::{Theme, ThemeMode, ThemeRegistry, theme}; use gpui_platform::application; -use settings::{AppearanceMode, SettingsStore}; +use native_theme::watch::ThemeSubscription; +use native_theme_gpui::{SystemTheme, apply_system_theme}; +use settings::{AppearanceMode, Settings, SettingsStore}; actions!(signed, [Quit]); @@ -25,57 +27,64 @@ fn main() { // The persisted settings must load before the theme is applied. let store = cx.new(|cx| SettingsStore::new(paths::settings_file(), cx)); SettingsStore::set_global(store.clone(), cx); - let settings = store.read(cx).settings().clone(); - let registry = ThemeRegistry::global_mut(cx); - for (name, content) in Assets.themes() { - if let Err(err) = registry.load_themes_from_str(&content) { - tracing::error!("Failed to load theme {name}: {err}"); + let settings = store.read(cx).settings().clone(); + { + let registry = ThemeRegistry::global_mut(cx); + for (name, content) in Assets.themes() { + if let Err(err) = registry.load_themes_from_str(&content) { + tracing::error!("Failed to load theme {name}: {err}"); + } } } - let light_theme = registry - .themes() - .get(settings.theme.light_theme.as_str()) - .cloned(); - let dark_theme = registry - .themes() - .get(settings.theme.dark_theme.as_str()) - .cloned(); - let theme = Theme::global_mut(cx); - theme.radius = px(settings.theme.radius); - theme.radius_lg = px(settings.theme.radius_lg); - theme.focus_ring = settings.theme.focus_ring; - theme.shadow = settings.theme.shadow; - theme.font_size = px(settings.theme.font_size); - theme.mono_font_size = px(settings.theme.mono_font_size); + match apply_native_theme(&settings, cx) { + Ok(()) => start_theme_watcher(cx), + Err(error) => { + tracing::warn!("native theme unavailable ({error})"); - if let Some(light) = light_theme { - theme.light_theme = light; - } else { - tracing::warn!( - "{} theme is missing from the registry", - settings.theme.light_theme - ); - } + let registry = ThemeRegistry::global_mut(cx); + let light_theme = registry + .themes() + .get(settings.theme.light_theme.as_str()) + .cloned(); - if let Some(dark) = dark_theme { - theme.dark_theme = dark; - } else { - tracing::warn!( - "{} theme is missing from the registry", - settings.theme.dark_theme - ); - } + let dark_theme = registry + .themes() + .get(settings.theme.dark_theme.as_str()) + .cloned(); - match settings.appearance { - AppearanceMode::System => Theme::sync_system_appearance(None, cx), - AppearanceMode::Light => Theme::change(ThemeMode::Light, None, cx), - AppearanceMode::Dark => Theme::change(ThemeMode::Dark, None, cx), + let theme = Theme::global_mut(cx); + theme.radius = px(settings.theme.radius); + theme.radius_lg = px(settings.theme.radius_lg); + theme.focus_ring = settings.theme.focus_ring; + theme.shadow = settings.theme.shadow; + theme.font_size = px(settings.theme.font_size); + theme.mono_font_size = px(settings.theme.mono_font_size); + + if let Some(light) = light_theme { + theme.light_theme = light; + } else { + tracing::warn!("{} theme is missing", settings.theme.light_theme); + } + + if let Some(dark) = dark_theme { + theme.dark_theme = dark; + } else { + tracing::warn!("{} theme is missing", settings.theme.dark_theme); + } + + match settings.appearance { + AppearanceMode::System => Theme::sync_system_appearance(None, cx), + AppearanceMode::Light => Theme::change(ThemeMode::Light, None, cx), + AppearanceMode::Dark => Theme::change(ThemeMode::Dark, None, cx), + } + } } std::fs::create_dir_all(paths::nostr_dir()).ok(); std::fs::create_dir_all(paths::repos_dir()).ok(); + signed_state::init( paths::nostr_dir(), paths::repos_dir().clone(), @@ -115,3 +124,62 @@ fn main() { cx.activate(true); }); } + +/// Apply the OS theme to the app, scaling the font size to match the system font size. +fn apply_native_theme(settings: &Settings, cx: &mut App) -> native_theme::Result<()> { + let mut system = SystemTheme::from_system()?; + let native = system.light.defaults.font.size; + if native > 0.0 { + let scaling = settings.theme.font_size / native; + system.accessibility.text_scaling_factor *= scaling; + } + + apply_system_theme(&system, cx); + + match settings.appearance { + AppearanceMode::System => Theme::sync_system_appearance(None, cx), + AppearanceMode::Light => Theme::change(ThemeMode::Light, None, cx), + AppearanceMode::Dark => Theme::change(ThemeMode::Dark, None, cx), + } + + Ok(()) +} + +/// Holds the watcher subscription so it lives as long as the app. +struct ThemeWatcher { + _subscription: ThemeSubscription, +} + +impl Global for ThemeWatcher {} + +/// Re-apply the OS theme whenever it changes at runtime. +fn start_theme_watcher(cx: &mut App) { + let (sender, receiver) = flume::unbounded(); + match native_theme::watch::on_theme_change(move |event| { + if let Err(error) = sender.send(event) { + tracing::warn!("theme change dropped ({error})"); + } + }) { + Ok(subscription) => { + cx.set_global(ThemeWatcher { + _subscription: subscription, + }); + cx.spawn(async move |cx| { + while receiver.recv_async().await.is_ok() { + tracing::info!("OS theme changed; re-applying"); + cx.update(|cx| { + let store = SettingsStore::global(cx); + let settings = store.read(cx).settings().clone(); + if let Err(error) = apply_native_theme(&settings, cx) { + tracing::warn!("failed to apply updated OS theme ({error})"); + } + }); + } + }) + .detach(); + } + Err(error) => { + tracing::warn!("OS theme watching unavailable ({error})") + } + } +}