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>
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>
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>
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>
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>
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>
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