Commit Graph

82 Commits

Author SHA1 Message Date
Ken Sedgwick
21298b43f5 hitbox: cache note size instead of rect 2024-09-26 12:52:12 -07:00
Ken Sedgwick
c25fde4a06 hitbox: handle hits on quoted notes correctly 2024-09-26 12:51:33 -07:00
Ken Sedgwick
5b7c9c9234 hitbox: extend the hitbox to the full width of the container 2024-09-26 12:42:57 -07:00
Ken Sedgwick
1f64350197 hitbox: more naming cleanup 2024-09-26 12:42:35 -07:00
William Casarin
dbb164970c remove PostActionExecutor
Just use PostAction::execute

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 12:41:38 -07:00
William Casarin
d416044f47 context: set cursor icon on hover
So we know its clickable. I mean the animation signals that as well, but
still.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 12:31:23 -07:00
William Casarin
5120686679 context: fix hitbox, float on far right
This updates the context menu to "float" instead of using the layout
engine. This is so that we don't take up an unnecessary amount of space
when we increase the hitbox height.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 12:18:10 -07:00
William Casarin
2dba41186d context: move note context button to its own file
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 10:51:08 -07:00
William Casarin
0c3b2ae817 note: switch to muted menu_options_button color
Otherwise it stands out too much

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 09:40:53 -07:00
William Casarin
a9cb734ef6 refactor: make options_button a NoteOptions
No reason why this needs to be a standalone bool

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 09:32:21 -07:00
William Casarin
1a94c21d96 refactor: remove processs_note_selection
Moved this to NoteOptionSelection::process

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 09:22:05 -07:00
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
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
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
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
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
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
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
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
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
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
0b3d6f7e37 initial post reply view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 14:01:40 -07:00
William Casarin
ac0821db79 postbox: add focus shadow from figma
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 10:14:34 -07:00
William Casarin
b0c5d2a2c5 postbox: add focused state
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 09:01:14 -07:00
William Casarin
18d5d95ef9 fix postbox design
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-20 13:44:35 -07:00
William Casarin
bb6c68e05c clippy postbox cleanups
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-20 13:05:57 -07:00
William Casarin
1458498131 initial post box view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-17 16:21:46 -07:00
William Casarin
c4e0c710c9 actionbar: remove border on reply button, add expand animation
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-13 09:36:53 -07:00