Commit Graph

499 Commits

Author SHA1 Message Date
William Casarin
579b47fc40 selectable text option
Add a selectable text option to various note views. We don't want
selection events to interfere with back drag, so this is the first step
toward ensure back drag works.

Vertical scrollviews also interfere with back drag, so we'll still need
a way to compose gestures. It's not clear if this is currently possibly
with egui (union of responses somehow maybe?)

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-12 14:21:29 -07:00
William Casarin
f769ddad09 fix threads
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-06 14:38:21 -07:00
William Casarin
51b4dfd3f3 temp fix crash due to race condition
we should fix the race condition though

Link: https://github.com/damus-io/nostrdb/issues/35
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:41:41 -07:00
William Casarin
be0efd57e5 bump ingester threads from 2 to 4
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:38:46 -07:00
William Casarin
3cbcd98dd4 arg: add dbpath argument
This is great for testing without using an existing DB

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:38:38 -07:00
William Casarin
0869cdde65 temp fix crash due to race condition
we should fix the race condition though

Link: https://github.com/damus-io/nostrdb/issues/35
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:37:44 -07:00
William Casarin
ce5142656e bump ingester threads from 2 to 4
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:33:40 -07:00
William Casarin
abd529e91b arg: add dbpath argument
This is great for testing without using an existing DB

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:32:56 -07:00
William Casarin
de5039fc65 fix bech32 bug bleh
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-01 14:10:19 -07:00
William Casarin
6e27c34267 update nostrdb to fix note corruption bug
Changelog-Fixed: fix note content corruption bug with damus.io links
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-01 13:44:28 -07:00
William Casarin
20f0aed2ed doc: add docs for get_unknown_note_ids
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 14:21:47 -07:00
William Casarin
38626520c1 thread: warn when we return 0 notes
This is a bug

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 14:01:41 -07:00
William Casarin
4b644bee32 restore unknown id fetching of root notes
still technically depends on the notebuf branch

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:55:22 -07:00
William Casarin
c3fc4e09e8 thread: fix ordering and duplication bugs
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:55:06 -07:00
William Casarin
d44c4c2f9c make local sub log more explicit
was hard to tell if this meant remote or local sub

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
dd9f41b04a threads: ensure we always handle bar results
We were not handling it in ThreadView, now we do.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
d43c46aaf4 nostr: fix parsing of OK events
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
593df9145b threads: check for new notes locally when thread is re-opened
We have a NoteRef cache for threads in memory, which is just a list of
NoteKeys and timestamps.

When reopening a thread, query the local DB to see if there are any new
notes that we might have missed because we weren't actively subscribed
to them.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
5be6b1ca68 ui: move timeline view to its own file
Also add some thread methods for fetching new notes

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
a28db5d330 local thread subscriptions
This adds local nostrdb thread subscriptions. When navigating to a
thread, we first check to see if we have any active nostrdb
subscriptions for that thread. If not, we create a new subscription. If
we do, we re-use that subscription.

This works by storing thread state in the Threads struct in the Damus
application state.

When we pop a route, we check to see if its a thread route. If it is,
then we try to unsubscribe, but only if that is the last remaining
subscriber for that thread, as there could be more than one.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
33e5b6886b threads: add initial thread support
This is a really dumb and broken version of threads, but it will be our
foundation for future changes.

All it currently does is load whatever notes we have locally for a
thread in chronological order. It currently does not open any
subscriptions. It is not clear what is replying to what, but hey, its a
start.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
1024affdbd actionbar: add thread button for testing
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
c007cbd4f2 preview: add scroll to profile pic demo
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-28 13:40:42 -05:00
William Casarin
b917d48015 log: reduce ping/pong verbosity
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-28 13:40:29 -05:00
William Casarin
1c8b68c334 switch to GPLv3, not sure why it was MIT
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-22 11:20:31 -07:00
William Casarin
06028ba66e deps: update deps for thread-needed changes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:45 -07:00
William Casarin
196535ce84 anim: add hover_expand_small
I though I would need this, but I didn't end up using it. Keep it here
anyways for now

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:45 -07:00
William Casarin
f1835d0119 timelineview: add customizable initial note capacity
We will be using this for threads, so we'll want a smaller
capacity there.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:45 -07:00
William Casarin
66c8973edf actionbar: move BarAction and add execute method
We will be executing baractions in multiple places, so factor this
out.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:32 -07:00
William Casarin
758de6b024 timeline: simplify tabs_ui
we don't really need to pass a timeline into it

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:52:22 -07:00
William Casarin
bf57e3b780 viewfilter: add default implementation
This will be used in future commits

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:52:22 -07:00
William Casarin
86f87fa0a5 noteref: move to note.rs
This doesn't need to be in timeline

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:51:30 -07:00
William Casarin
6b634646d5 fix nostrdb crash
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-15 12:39:42 -07:00
William Casarin
f2c5978ba5 allow relay pool customization via -r/--relay argument
This allows you to use specific relays instead of some random
bootstrap ones we are currently using

Fixes: https://github.com/damus-io/notedeck/issues/154
Changelog-Added: Add -r/--relay cli option for customized relay pool
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 11:25:21 -07:00
William Casarin
cc734e2a66 logs: add relay string to relay connection errors
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 16:00:38 -07:00
William Casarin
a36ce31fc7 pool: increase default reconnect time to 5 seconds
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 16:00:38 -07:00
William Casarin
af8d7d222c Add note wide mode for reposts
This adds a 'wide' note design for note previews. This is a mode
where the note contents does not have padding at the start. This makes
notes previews a bit nicer.

Screenshot: https://cdn.jb55.com/s/84271f386d564c34.png
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 10:56:15 -07:00
William Casarin
61bc9d9919 refactor: rename ui::Note to ui::NoteView
Easier to jump to when using tags.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 09:56:16 -07:00
William Casarin
f795fe6088 docs: make note about not needing nix on ubunutu
Reported-by: Derek Ross
Fixes: https://github.com/damus-io/notedeck/issues/144
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 09:54:07 -07:00
William Casarin
5805df266a don't use an actual keystorage in Damus test apps
Reported-by: kernelkind <kernelkind@gmail.com>
Fixes: https://github.com/damus-io/notedeck/issues/150
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-05 07:38:58 -07:00
William Casarin
d265d48c0b fix scroll area shrinking
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-04 10:17:09 -07:00
William Casarin
239a2cb701 Switch to egui master to fix wgpu issues
There are some wgpu issues that are fixed in egui-master, so
let's switch to that.

This fixes notedeck so that it runs on both my intel graphics laptop
and amdgpu desktop.

Fixes: https://github.com/damus-io/notedeck/issues/28
Fixes: https://github.com/damus-io/notedeck/issues/42
Fixes: https://github.com/damus-io/notedeck/issues/141
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-02 17:48:18 -07:00
William Casarin
9eea457bda switch to glow for now
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-02 16:12:04 -07:00
William Casarin
724042b700 allow missing profiles in account switcher
Fixes: https://github.com/damus-io/notedeck/issues/119
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-02 10:34:42 -07:00
kernelkind
a890c9e970 select first account
closes: https://github.com/damus-io/notedeck/issues/119

Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-07-02 13:12:20 -04:00
William Casarin
e9da25266a enable nip10 replies
you can now reply to notes

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 19:22:43 -07:00
William Casarin
b31bd2470b keys: actually use the keystore
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 11:13:22 -07:00
William Casarin
4c490e1436 Merge 'impl linux credential storage' #115
From PR description:

See the test_basic() test in linux_key_storage.rs. I ran it successfully
on my MacOS machine and a linux VM. The BasicFileStorage impl just
stores each Keypair as a SerializableKeypair json object with the file
name as the public key hex in ~/.notedeck_credentials. The
SerializableKeypair uses the nip49 EncryptedSecretKey, but we just use
an empty string as the password for now.

The BasicFileStorage impl works in MacOS, but it only conditionally
compiles to linux for simplicity.

pub enum KeyStorageResponse<R> {
    Waiting,
    ReceivedResult(Result<R, KeyStorageError>),
}

This is used as a response so that it's possible for the storage impl to
be async, since secret_service is async. It seems that secret_service
would allow for a more robust linux key storage impl so I went ahead and
made the API compatible with an async impl.

* kernelkind (1):
      impl linux credential storage
2024-07-01 10:49:15 -07:00
William Casarin
6f6d5f05af always have some default timeline
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 10:35:47 -07:00
William Casarin
69a8438f33 cleanup some dead code
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 07:31:43 -07:00