Commit Graph

124 Commits

Author SHA1 Message Date
William Casarin
79a447239a cleanup: remove account switcher widget
we don't need this anymore

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 16:37:04 -07:00
William Casarin
52a7ed53ec accounts: use column nav for account management
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 16:36:38 -07:00
William Casarin
36c0971fd9 Flexible routing
Another massive refactor to change the way routing works. Now any
column can route anywhere.

Also things are generally just much better and more modular via the
new struct split borrowing technique.

I didn't even try to split this into smaller commits for my sanity.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 14:50:20 -07:00
William Casarin
37fbde1566 fix some rebase issues
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-11 16:24:43 -07:00
kernelkind
aa82cb9fda fix flickering on account switch
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-11 16:14:32 -07:00
kernelkind
950a47119e implement stateful account management view
`./preview StatefulAccountManagementView`

Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-11 16:14:31 -07:00
kernelkind
3a9c7607f3 make AccountManagementView stateless
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-11 16:13:58 -07:00
kernelkind
dda7256f51 add LoginState to app
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-11 16:13:16 -07:00
kernelkind
df4e331d33 narrowize account login view
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-11 16:12:08 -07:00
kernelkind
206112849d narrowize account management view
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-11 16:12:07 -07:00
kernelkind
52604e65c6 remove global popup conception
can be added later if we need it again

Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-11 16:11:10 -07:00
William Casarin
00091c5088 Switch to Columns
Also refactor damus app usage to only pass in things that we need in views.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-11 15:49:34 -07:00
William Casarin
4a4fb06425 split is_mobile to is_narrow and is_oled
is_mobile doesn't really make sense for android tablets. We were
overloading this variable to mean "is_narrow". What we really want is
is_oled for mobile devices and is_narrow for if its phone-like.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-06 21:54:48 -07:00
William Casarin
772bfbad5f img: remove loading spinners
This adds blank space, but it will be nice if we can improve this
by either fading in or having some shimmer effect.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-06 21:06:12 -07:00
William Casarin
2603d08d1a tidy: fix formatting
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 18:31:53 -07:00
William Casarin
4c61c337bd fix transaction crash regression when opening thread
small oversight

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 18:12:12 -07:00
Ken Sedgwick
fe7580f5be Extend ImageCache to handle content images 2024-09-02 17:54:49 -07:00
William Casarin
b00dc735e1 use slightly better carousel id
still need to include timeline...

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 17:54:49 -07:00
William Casarin
0e4aad4184 initial image support
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 17:54:49 -07:00
William Casarin
bc8a8d4a74 perf: coordinate unknown id lookups
This is a huge improvement over what it was before. Now all unknown id
lookups are debounced and happen through a central coordinator. This
ensures there is no duplication between timelines.

Fixes: https://github.com/damus-io/notedeck/issues/279
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 17:38:18 -07:00
William Casarin
ad244d48c0 fetch contact lists
If we don't have a contact list, make sure to fetch one

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 16:22:29 -07:00
William Casarin
1f149aec3b fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-19 21:26:20 -07:00
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
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
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
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
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
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
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
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
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
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
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
3fc73bb601 post: full available width
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 07:31:29 -07:00
William Casarin
a04df88ff6 initial note posting
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 06:49:12 -07:00
William Casarin
26c4d90be3 initial postbox for testing
not sure if we want to put this here yet, but it matches the design
and will be useful for testing

Fixes: https://github.com/damus-io/notedeck/issues/110
Suggested-by: Rob
2024-06-25 14:08:56 -05:00
William Casarin
a6856867a9 Merge remote-tracking branch 'pr/107' 2024-06-25 13:20:56 -05:00
William Casarin
8ef6534981 fixed_window: fix clippy warning
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-24 17:12:24 -07:00
William Casarin
1228f83e50 refactor: move fixed_window to ui
This is a ui module

Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-24 17:11:01 -07:00
William Casarin
b14a2bf254 popup: simplify borrow
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-24 17:09:07 -07:00
William Casarin
a66b467cb4 hide navigation title on global nav
Fixes: https://github.com/damus-io/notedeck/issues/109
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-24 16:47:35 -07:00
William Casarin
a9a07b3805 refactor: use map instead of explicit if let
We also use last instead of first, because the last route should be the
active one.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-24 14:55:43 -07:00
William Casarin
677c217ecd popup: increase fixed window margin
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-24 14:55:22 -07:00
kernelkind
6afb618089 reintroduce account management
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-06-23 20:04:00 -04:00