Commit Graph

34 Commits

Author SHA1 Message Date
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
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
d265d48c0b fix scroll area shrinking
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-04 10:17:09 -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
b7366351b6 drafts: clear post after posting
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 06:49:12 -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
b7188bac25 fix some clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 14:12:07 -07:00
William Casarin
395ff57edf add vertical separators between timelines
Fixes: https://github.com/damus-io/notedeck/issues/52
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-20 13:02:18 -07:00
William Casarin
d17b5e0703 Add forward navigation animation
Also fix a few nav clipping bugs

From egui-nav:

William Casarin (5):
      add forward nav support
      fix body overlapping header
      fix transition clipping when in a smaller container
      fix forward nav clipping in small containers
      fix background layer having the wrong UI id

Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-13 11:59:08 -07:00
William Casarin
db1642bc31 remove useless struct
we can just use tuples for compound ids

Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-13 09:10:31 -07:00
William Casarin
0dd33c90e7 initial navigation 2024-06-11 17:50:09 -07:00
William Casarin
bff0f3f628 fix inline note preview colors
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-11 16:10:18 -07:00
William Casarin
d576082297 reset virtual list if notes are spliced into timeline
Calling egui_virtual_list's `items_inserted_at_start` is incorrect if we
insert notes inbetween other notes in the timeline. To prevent our list
getting confused, let's handle this case explicitly by calling 'reset'
when we splice notes in.

Ideally we would update egui_virtual_list to handle spliced-in items,
but we will leave that to a future update.
2024-06-09 08:53:10 -07:00
William Casarin
e6efad025f timeline: don't hide on resize
It doesn't seem to flicker so why not

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-31 09:24:52 +02:00
William Casarin
5630f93b71 debug: add some debug logs for keyboard note selection
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:43:31 -07:00
William Casarin
135a5c99ae Revert "deps: using tracing instead of log"
This reverts commit af92e326f6.
2024-05-23 16:10:07 -07:00
William Casarin
83100d7f50 tabs: select notes & replies by default
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-23 15:50:06 -07:00
William Casarin
6fc5eb27fc working notes + notes&replies
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-23 15:31:24 -07:00
William Casarin
232ba0e3aa list: switch from arc mutext to rc refcell
we don't have any multithreaded stuff yet

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-23 15:27:37 -07:00
William Casarin
a8693a2bd3 timeline: refactor tabs into TimelineView
TimelineView is a filtered view of a timeline. We will use this for
future tab rendering. We also introduce a new "selection" concept for
selecting notes on different timeline views. This is in preparation for
vim keybindings.
2024-05-23 15:27:37 -07:00
William Casarin
af92e326f6 deps: using tracing instead of log
also update some other deps

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-23 11:16:43 -07:00
William Casarin
4fc6e225ca don't bump timeline when adding notes
This is quite different than Damus iOS. The timeline will continually
add new items without bumping scroll position, thanks to
egui-virtual-list's `items_inserted_at_start` function.

Closes: https://github.com/damus-io/notedeck/issues/38
Fixes: https://github.com/damus-io/notedeck/issues/59
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-16 10:26:36 -07:00
William Casarin
0d240c16a5 simplify tab underline calculation
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-15 18:01:48 -07:00
William Casarin
12a6c64778 move add_space to its correct location
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-15 17:39:42 -07:00
William Casarin
9e8f7a2e5c ui: integrate egui-tabs for notes & replies selector
demo: https://cdn.jb55.com/s/notedeck-tabs.mp4

Fixes: https://github.com/damus-io/notedeck/issues/47
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-15 17:28:01 -07:00
William Casarin
029896627c ui: add feathering-resistant hline separator fn
"pixel-aligned" Separators get feathered into a blurry mess. This seems
to help.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-15 15:26:19 -07:00
William Casarin
f3f8d4ecb4 textmode: no previews in textmore for now
Ideally these would just be angle bracket quotes or something. would be
cool.
2024-05-02 18:50:25 +02:00
William Casarin
26128c3456 use egui_virtual_list for rendering
absolutely insane performance increase

Fixes: https://github.com/damus-io/notedeck/issues/32
Suggested-by: @lucasmerlin
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-28 11:03:47 -07:00
William Casarin
99ac578ebd fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:30:08 -07:00
William Casarin
3e96f815b1 apply cargo warning suggested fixes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-10 16:19:31 -08:00
William Casarin
f323fe7379 LOCAL RELAY MODEL IS WORKING
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-09 16:59:49 -08:00
William Casarin
74ce87049d local nostrdb subscriptions working
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-07 15:18:23 -08:00