Commit Graph

143 Commits

Author SHA1 Message Date
kernelkind
171889b3aa process 'more options' for previews
forgot to add this part

Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-25 13:15:12 -04:00
kernelkind
ad319b643f can left click note more options button
egui doesn't support custom buttons so
`stationary_arbitrary_menu_button` had to be hacked together

Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-19 19:04:28 -04:00
kernelkind
6f5f090fbe Add 'more options' to each note
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-19 19:04:28 -04:00
kernelkind
0a08ae92d9 minor cleanup
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-18 11:36:07 -04:00
kernelkind
eadef78543 make views pure
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-18 11:26:42 -04:00
kernelkind
6e77d20197 address PR comments
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-18 11:26:41 -04:00
kernelkind
06336a14ef add repost button
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-18 11:26:41 -04:00
kernelkind
33dcd8ba66 make PostActionExecutor for code reuse
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-18 11:26:41 -04:00
kernelkind
de9e0e4ca1 post quote reposts impl
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-18 11:26:40 -04:00
William Casarin
8e32f757f0 Merge 'Repost improvements #314'
This slightly improves the style of reposts. Icon color and size still
needs an update[2]

We also update nostrdb[1] to support instant kind6 ingestion, making
reposts render immediately

William Casarin (3):
      repost: update style
      nostrdb: update to support fast kind6 repost ingest

[1] cd9ba0ea7d
[2] https://github.com/user-attachments/assets/23feba47-9d63-443f-9968-eba93053fc24
2024-09-17 15:37:21 -07:00
William Casarin
27aa146300 repost: update style
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-17 15:28:01 -07:00
William Casarin
a8731c0210 remove thread button
now that we have note hitboxes

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-17 15:15:51 -07:00
William Casarin
e16eeb4d1b notes: rename "underbutt" to "hitbox"
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-17 15:12:20 -07:00
Ken Sedgwick
fea315cb99 add note underbutton to detect clicks and open thread 2024-09-17 11:49:51 -07:00
William Casarin
80c9cbe5b2 Merge 'display kind 6 repost impl #302'
Merge kernel's changes for displaying kind6 reposts. We still need to
update the timeline code to fetch and include these in the queries.

kernelkind (2):
      kind 6 repost impl
      add suggested changes
2024-09-17 09:29:55 -07:00
kernelkind
06aa595d54 add suggested changes
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-17 11:12:43 -04:00
kernelkind
f2993a61b7 kind 6 repost impl
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-09-17 11:04:05 -04:00
William Casarin
945ccde818 ui: hook up relay management view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 17:15:07 -07:00
William Casarin
fce82b2b6d nav: fix accounts nav animations
also make nav go backward when clicking the account switch button if we
already are navigating to accounts

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 16:54:29 -07:00
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