Commit Graph

1974 Commits

Author SHA1 Message Date
William Casarin
eac5d41e3c fix nostrdb-rs platform independence
commit 6956b9f955463404b8eff3b7abe0cc3092cb5958
Author: Martti Malmi <sirius@iki.fi>
Date:   Fri Nov 7 17:35:31 2025 +0200

    fix non-android target metadata.rs u8

    platform-independent fix

diff --git a/src/metadata.rs b/src/metadata.rs
index 977cfc859915..bbaa0e4e724c 100644
--- a/src/metadata.rs
+++ b/src/metadata.rs
@@ -117,11 +117,9 @@ impl<'a> ReactionEntry<'a> {
     pub fn as_str(&'a self, buf: &'a mut [i8; 128]) -> &'a str {
         unsafe {
             let rstr = bindings::ndb_note_meta_reaction_str(self.as_ptr());
-            // weird android compilation issue
-            #[cfg(target_os = "android")]
-            let ptr = { bindings::ndb_reaction_to_str(rstr, buf.as_mut_ptr() as *mut u8) };
-            #[cfg(not(target_os = "android"))]
-            let ptr = { bindings::ndb_reaction_to_str(rstr, buf.as_mut_ptr()) };
+            // Cast to c_char for platform independence (i8 on Linux, u8 on macOS)
+            let ptr =
+                bindings::ndb_reaction_to_str(rstr, buf.as_mut_ptr() as *mut std::os::raw::c_char);
             let byte_slice: &[u8] = std::slice::from_raw_parts(ptr as *mut u8, libc::strlen(ptr));
             std::str::from_utf8_unchecked(byte_slice)
         }

Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-07 11:57:25 -08:00
William Casarin
952ba14d46 Merge Note Metadata + stats #1188
William Casarin (13):
      net: switch ping/pong messages to trace
      update nostrdb
      clippy fixes
      add is_root_note helper
      ui: note metadata stats
      ui: rename actionbar function
      ui: move debug slider to ui crate
      ui: add rolling number function
      ui/note: use rolling numbers for note stats
      windows: fix time overflow crash
      nostrdb: update for windows fix
      clndash: clippy fix

Changelog-Added: Add realtime note stats
2025-11-06 21:40:41 -08:00
William Casarin
2c1bdd91e0 clndash: clippy fix
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-06 21:36:06 -08:00
William Casarin
0a4eb469ab nostrdb: update for windows fix 2025-11-06 21:34:26 -08:00
William Casarin
6117c0af65 windows: fix time overflow crash
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-06 21:34:26 -08:00
William Casarin
a4e59be6dc ui/note: use rolling numbers for note stats
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-06 19:07:48 -08:00
William Casarin
ff77e7f543 ui: add rolling number function
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-06 19:07:35 -08:00
William Casarin
635d2164bb ui: move debug slider to ui crate
might use this outside of notebook

Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-06 19:07:08 -08:00
William Casarin
ca9e6c5aaf ui: rename actionbar function
this was surprisingly hard to find for some reason

Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-06 17:07:01 -08:00
William Casarin
cb7dadee44 ui: note metadata stats
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-04 14:54:47 -08:00
William Casarin
74f63f49ca add is_root_note helper
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-04 14:53:51 -08:00
William Casarin
9b7ee8d8c5 clippy fixes
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-04 14:53:10 -08:00
William Casarin
058df9d6f0 update nostrdb
Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-04 14:52:58 -08:00
William Casarin
267b854953 net: switch ping/pong messages to trace
they are annoying even on debug

Signed-off-by: William Casarin <jb55@jb55.com>
2025-11-04 14:42:59 -08:00
William Casarin
155278dd3f Merge perf updates and fixes from kerenl
from remote-tracking branches:
  * kernel/fix-soft-keyboard
  * kernel/composite-profiles-perf
  * kernel/fix-nav-flicker

kernelkind (8):
      Revert "fix: nav drawer shadow extends all the way vertically"
      chore(profiling): markup composite render path
      chore(tracy): repaint every frame
      feat(composite-cluster): do culling for pfps
      feat(mime-cache): upgrade UrlMimes
      feat(reactions): use ProfileKey when possible for performance
      fix(nav-drawer): shadow extends all the way vertically
      fix(thread): remove flicker on opening thread
2025-10-27 10:27:07 -07:00
William Casarin
25b19f7636 refactor: rename process to process_selection
grepping these are a pain

Signed-off-by: William Casarin <jb55@jb55.com>
2025-10-27 10:25:01 -07:00
kernelkind
3e39cf785b feat(mime-cache): upgrade UrlMimes
1. more performant. No more deserialization every frame
2. employs TTL (so cache doesn't grow unbounded)
3. exponential backoff to retry on error

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 13:12:24 -04:00
kernelkind
1244be4481 feat(composite-cluster): do culling for pfps
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 13:12:18 -04:00
kernelkind
fdde0244e2 feat(reactions): use ProfileKey when possible for performance
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 13:00:39 -04:00
kernelkind
892d77d4e3 chore(profiling): markup composite render path
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 11:42:03 -04:00
kernelkind
9ccbaf2db8 chore(tracy): repaint every frame
since we stop rendering when there is no user input, tracy sees
big hangs, and it's annoying to parse through which frames are
actual performance issues and which are due to no user input.

So just repaint every frame while using tracy.

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 11:42:03 -04:00
kernelkind
db9005e403 fix(nav-drawer): shadow extends all the way vertically
df5cf8a1fc caused a regression
making the soft keyboard auto close. This patch extends the shadow
all the way vertically without triggering the regression

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-22 16:40:54 -04:00
kernelkind
dbba2a5271 Revert "fix: nav drawer shadow extends all the way vertically"
This reverts commit df5cf8a1fc.
2025-10-22 16:36:18 -04:00
kernelkind
88e6415253 fix(thread): remove flicker on opening thread
fixed bug in `egui-nav`

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-20 15:42:13 -07:00
kernelkind
5e88cd328e fix(thread): remove flicker on opening thread
fixed bug in `egui-nav`

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-20 16:36:25 -04:00
William Casarin
57d2b712ab Merge macos build fix by fernando #1158
Fernando López Guevara (1):
      chore(macos): fix cargo-bundle
2025-10-20 12:29:36 -07:00
William Casarin
8bfe8916ea Merge send reactions by kernel #1170 2025-10-20 11:22:54 -07:00
William Casarin
2929bfaf0c Merge seen note perf improvements by kernel #1174
kernelkind (2):
      fix(notif-indicator): more performant impl
      refactor(NoteFreshness): remove now unnecessary `NoteFreshness`
2025-10-20 11:21:53 -07:00
William Casarin
adba4ece22 Merge sidebar fixes by kernel #1163
kernelkind (9):
      update egui-nav
      fix: nav drawer shadow extends all the way vertically
      drawer: only use drag on mobile
      new `egui`
      update egui_nav
      refactor: move `galley_centered_pos` to notedeck_ui
      refactor: rename assets
      assets: add accounts image
      chrome: ui polish
2025-10-20 11:18:52 -07:00
William Casarin
9000fc2c43 nix: android: move gradle to android deps 2025-10-20 11:00:33 -07:00
kernelkind
fc248ac389 refactor(NoteFreshness): remove now unnecessary NoteFreshness
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-19 19:51:03 -04:00
kernelkind
0344ea866f fix(notif-indicator): more performant impl
the previous unseen notification indicator only ran once a few
seconds, but when it did it often took > 5ms because of ndb::query,
which is unacceptable.

This commit removes the ndb::query entirely and relies on the
ndb::poll_for_notes which is already being used every time there is
a new event from a relay

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-19 19:50:53 -04:00
kernelkind
11611a11d8 feat(reaction): user can send reactions
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:39 -04:00
kernelkind
3f5264b4ab feat(action): add NoteAction::React
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:35 -04:00
kernelkind
83753ccc7d feat(ui): add like button
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:32 -04:00
kernelkind
c66c5725ce feat(event): add send_reaction_event
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:29 -04:00
kernelkind
041e333a5c feat(ui-state): add reaction_sent_id
will be used in the UI for whether to show the filled/unfilled
react icon in the actionbar. Temporary until ndb metadata lands

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:26 -04:00
kernelkind
48a52d3860 feat(action): add ReactAction
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:21 -04:00
kernelkind
e86db45111 feat(assets): add like icon
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:18 -04:00
kernelkind
d3326d2e33 refactor(assets): rename like icon -> filled version
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 15:35:15 -04:00
kernelkind
fdaec37212 chrome: ui polish
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:54 -04:00
kernelkind
5490c513db assets: add accounts image
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:51 -04:00
kernelkind
ba83976166 refactor: rename assets
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:48 -04:00
kernelkind
9b1f7680aa refactor: move galley_centered_pos to notedeck_ui
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:45 -04:00
kernelkind
54485843d0 update egui_nav
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:24 -04:00
kernelkind
6ae3177334 new egui
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-16 21:22:26 -04:00
kernelkind
2ce5fb007a drawer: only use drag on mobile
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-16 21:22:25 -04:00
kernelkind
df5cf8a1fc fix: nav drawer shadow extends all the way vertically
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-16 21:22:23 -04:00
kernelkind
7528df25b9 update egui-nav
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-16 21:22:18 -04:00
Fernando López Guevara
08231f8e43 chore(macos): fix cargo-bundle 2025-10-06 18:40:20 -03:00