Commit Graph

138 Commits

Author SHA1 Message Date
kernelkind
11b3effa51 Add AccountManager to app
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-05-27 10:48:28 -07:00
kernelkind
748d9d2358 Integrate global popup into app
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-05-27 10:48:28 -07:00
William Casarin
194f41d39c integrate sidebar into main view
buttons don't do anything yet

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-27 10:48:28 -07:00
kernelkind
1dc832baea app: add accounts to Damus & mock
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-27 10:48:28 -07:00
William Casarin
9e5048d4f2 input: fix deadlock on resize
weird egui Context quirk

Fixes: https://github.com/damus-io/notedeck/issues/97
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:42:57 -07:00
William Casarin
2bef02106a mobile: use my timeline for testing again
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:21:37 -07:00
William Casarin
c5cc2f923c mobile: a tad more padding at the top
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:21:22 -07:00
William Casarin
739e9f87f2 nip10: fetch unknown replied-to notes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-24 13:20:33 -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
8663851e7e input: handle raw events 2024-05-23 15:27:37 -07:00
William Casarin
cf2a832a5e input: switch to scanning over raw input events
Calling key_pressed invokes a filter over the entire event list every
time, this is much more efficient, which is important when we are
handling many key events.
2024-05-23 11:16:50 -07:00
William Casarin
3a891a982c input: process input once
Instead of calling ctx.input multiple times, let's do it once. We are
going to do a lot more stuff in here, such as vim key bindings
2024-05-23 11:16:50 -07:00
William Casarin
93b7af1a4e perf: fix continuous repaint
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-23 11:16:50 -07:00
William Casarin
c30fc44df0 cleanup: remove old viewport code 2024-05-23 11:16:50 -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
0e0e5d0eaa fix clippy issues
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-15 20:53:17 -07:00
William Casarin
95c526f453 mobile: add lots of top padding on mobile
and remove top panel

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-15 18:01:28 -07:00
William Casarin
dbc56ac098 mobile: simplify is_mobile
we don't need context anymore

Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-15 18:01:04 -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
d9f1582ee7 since filter optimization
This is an optimization that allows us to modify our network filter to
include since-information based off of our local relay. The idea is to
look at the latest note in a given view, and add that to the since
filter for the remote query.

Fixes: https://github.com/damus-io/notedeck/issues/36
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-29 14:06:20 -07:00
William Casarin
28e2e7edd5 Merge remote-tracking branch 'github/virtual-list' 2024-04-28 17:55:29 -07: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
69054d71ca nip10: show initial reply information on notes
Using the newly merged nip10 code, we can show replies on notes!

This is not final, and it's actually different than how we do it in
Damus iOS. Not sure if I like it yet. We will likely have to put pubkey
information back in somewhere soon.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-27 01:58:35 -07:00
William Casarin
1d44b08f13 ui: make pixel sizes correct, use more of the figma
I noticed the pixel sizes were off which made it harder to match the
pixel dimensions of rob's figma designs. This restores the pixel size
and adjust the font sizes so that things look somewhat ok with the
default pixel settings.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 17:45:09 -07:00
William Casarin
51c25b88cc timeline: use strips instead of panels
panels grow when their childs a larger than its container. strips do not
do this, which is better for timelines

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 19:55:02 -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
a71e8206fb introduce View and Previews traits
In this commit we refactor the preview mechanism, and switch to
responsive views by default.

To create a preview, your view now has to implement the Preview trait.
This is very similar to SwiftUI's preview mechanism.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:13:11 -07:00
William Casarin
6f2aa56b9e ids: find more unknown ids from inline notes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-14 16:30:12 -07:00
William Casarin
3b9cd3f3c4 mobile: black panel bg color
for battery life

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 21:14:56 -07:00
kernelkind
f0d56da4f5 Use custom style in app
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 19:53:23 -07:00
William Casarin
d4ccf7435f get all missing ids from all timelines
before we were only fetching missing profiles from the first timeline,
update the logic to pull both missing authors and ids from all timelines

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 18:52:32 -07:00
William Casarin
5e45e4a2e5 ui: simplify note widget
pass just a note pointer to the note ui widget. We currently don't
support non-db notes but we can add support for that later.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 16:49:18 -07:00
William Casarin
4e7d168d22 refactor: rename widgets to ui
consolidate ui related things like widgets into our ui module

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 16:16:19 -07:00
William Casarin
9b7c63c800 refactor: move note into its own widget
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 16:03:16 -07:00
William Casarin
99b163da7e textmode: fix coloring of abbreviated names
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 15:09:07 -07:00
William Casarin
bfdd066654 fix warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-11 15:00:58 -07:00
William Casarin
116ba27f3f ircmode: tighten username
will probably have to change the design of this for mobile

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-11 13:36:29 -07:00
William Casarin
9d1e8ce666 irc mode
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-11 11:09:30 -07:00
William Casarin
7ecacc69a5 log: reduce spammy new note log
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-09 18:49:52 -07:00
William Casarin
4526434405 update to latest nostrdb, adding tag support
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-07 14:53:50 -07:00
William Casarin
6222a7db63 Fix all warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-01 10:19:47 -07:00
kernelkind
80b76c5381 Use app_creation for common app setup functions
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-04-01 10:15:45 -07:00
William Casarin
89f7f838a7 load timelines from commandline
great way to test queries statelessly
2024-03-22 11:15:09 +01:00
William Casarin
450709afa7 test: use my timeline query by default for testing 2024-03-21 18:23:33 +01:00
William Casarin
f364748005 ui: reduce vertical padding for more compact timelines 2024-03-21 15:54:08 +01:00
William Casarin
9ebbaf40e5 style: initial logic for mobile style
we definitely watch pure black for oled mobile screens, better battery
life.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-21 14:31:00 +01:00
William Casarin
ea952c4c58 actionbar: support both dark and light buttons
since there is no way to do icon masks, we simply use two different
textures for dark and light mode reply buttons.

I used this command to create the dark mode button:

convert reply.png -channel RGB -negate reply-dark.png

Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-21 14:28:49 +01:00
William Casarin
c0979d1707 widgets: begin organizing ui components into widgets
egui widgets are nice because there are many helper methods on the
egui::Ui struct for adding widgets to the screen in various ways. For
example, add_sized which designates an area to paint a widget. This is
useful in the note_contents case, as it allows us to reserve
available_space-20.0 pixels of the available area, saving 20.0 pixels
for a side-actionbar popout.

I'm not sure I'll use the side actionbar yet, but I've been
experimenting with that as an option to save vertical space in the
timeline.

I still need to make the side actionbar into a widget as well. It
currently uses the CollapsingHeader widget, which is designed for
expanding elements vertically. We may need to make our own widget for
animating an horizontal expansion if we want to achieve a similar effect
for the side actionbar.
2024-03-13 13:38:02 +00:00