Commit Graph

154 Commits

Author SHA1 Message Date
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
kernelkind
a5e1fbf328 Add preview for RelayView
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:13:11 -07:00
kernelkind
349e3baa99 Add relay view
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:13:11 -07:00
kernelkind
805e18261c Add warn color and highlight color
Use highlight color for 'connected' relay status. There doesn't seem to
be a better place to put it.

Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:13:11 -07:00
kernelkind
f6c46a1eb5 Add monospace text style
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:13:11 -07:00
kernelkind
bf23e778b3 Seperate mobile dark color theme into its own func
I believe this is less messy

Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:13:11 -07:00
kernelkind
c76f322a48 Apply cargo fmt
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:13:11 -07:00
William Casarin
d247382219 ui: add frame around note previews
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-14 18:23:33 -07:00
William Casarin
a8185d9a75 note: don't allow nested note previews
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-14 17:36:05 -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
402a1337f2 ui: switch to flags for note options
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-14 16:23:59 -07:00
William Casarin
72b9b0dab9 ui: only inline preview kind1 notes for now
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-14 16:23:01 -07:00
William Casarin
dcd53beea8 remove minimum window size
This is preventing me from doing a single column layout on desktop

Cc: kernelkind
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-14 12:11:30 -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
William Casarin
0a9e7698c1 theme: update to correct colors based on figma design
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 21:00:48 -07:00
William Casarin
483e8e85d6 fix until filters
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 20:30:28 -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
kernelkind
cf07427204 Refactor 'ui tests' conception to previews
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 19:52:34 -07:00
kernelkind
03e751011b Add MobileAccountLoginView
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 19:52:34 -07:00
kernelkind
217a7d1588 Apply app style to AccountLoginView
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 19:52:34 -07:00
kernelkind
e81cde5374 Add modular custom text styles
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 19:52:34 -07:00
kernelkind
c8b1c1cdda Add custom visual themes
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 19:52:34 -07:00
William Casarin
2b20f73974 initial inline note previews
still needs a border and options to remove actionbar

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 18:58:36 -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
4bd01682da Add ui_test_harness binary implementation
Adds ability to run UI components isolated from main app.

`cargo run --bin ui_test_harness -- AccountLoginView`

Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-04-01 10:15:50 -07:00
kernelkind
242053c6e0 Constrain app minimum size
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-04-01 10:15: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
kernelkind
a927c56870 Create account login panel
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-04-01 10:15:42 -07:00
kernelkind
343d3dc569 Add login manager
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-04-01 10:15:38 -07:00
kernelkind
83197bac78 Update egui 0.26.1 -> 0.27.1
Needed for shadows

Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-04-01 10:15:27 -07:00
kernelkind
7a113825dd Add login key parsing 2024-03-26 10:04:59 +00:00
William Casarin
89f7f838a7 load timelines from commandline
great way to test queries statelessly
2024-03-22 11:15:09 +01:00
William Casarin
2936012308 filters: fix hashtag filters
We might need to move to something a bit more generic that works
for all generic tag filters.
2024-03-22 10:23:41 +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
William Casarin
247feb9e26 filter: unify nostrdb and remote limits
Before we were setting filter limits in two different places. Let's
unify them so we don't have to sources of truth for filter limits.
2024-03-13 13:24:06 +00:00
William Casarin
50aa21b2f0 app: make ndb public
We will be using this in some submodules, so expose it for now
2024-03-13 13:23:13 +00:00