Commit Graph

49 Commits

Author SHA1 Message Date
kernelkind
9fad35485a Add MacOS key storage
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-05-21 19:50:05 -04:00
kernelkind
e9c3596067 AccountManagementView
View used to add and remove accounts from the app

Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-05-13 10:50:42 -07:00
William Casarin
f9d6161500 move account_login_view to ui submodule
trying to keep all views and widgets in here
2024-05-04 11:32:34 -05:00
William Casarin
893fd582dc profiles: introduce DisplayNames
This is exactly the same as the DisplayName enum in Damus iOS. Due to
the various inconsistencies in `name` and `display_name` between
clients, we have to generalize DisplayName into two variants: one name
or two names.

If we have two names, we treat it in the standard way of display_name is
the real name, and `name` is the username.

If only one is set, then it is considered both the username and "real name".

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 15:55:47 -07:00
William Casarin
2d566cc637 ui: move RelayView into ui module
Trying to keep all UI stuff in there

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 21:53:47 -07:00
kernelkind
c4d9b5cd3c Extract the sample relay to test_data for reuse
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 17:39:21 -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
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
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
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
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
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
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
7a113825dd Add login key parsing 2024-03-26 10:04:59 +00: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
87f385b683 profile picture image cache
coding from a plane so this is helping alot with PFPs
2024-02-27 14:26:02 -08:00
William Casarin
2ce2d4cc70 notecache: add initial in-memory notecache
This is useful for things like relative time strings and other
transient note cache state

Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-15 13:07:01 -08:00
William Casarin
c246b9d92f time: add time_ago function from Damus iOS
Useful relative time formatting

Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-15 13:07:01 -08:00
William Casarin
2f54a05705 timecache: add timecache help for timed caches
Some things we definitely don't want to generate every frame, such as
relative-time formatted strings, as that would create a heap allocation
each frame.

Introduce TimeCached<T> which is responsible for updating some state
after some expiry.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-15 13:07:01 -08:00
William Casarin
5521779f42 android: fix args
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-15 13:07:01 -08: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
3925012ad9 android: pass in internal data path for db
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-10 13:57:46 -08:00
William Casarin
fd0a14eac2 initial fixes for android build
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-09 18:55:12 -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
William Casarin
0400b94769 add padding to top panel on mobile 2023-07-09 14:21:01 -07:00
William Casarin
a618da3ed7 show fps on top panel 2023-07-09 14:20:50 -07:00
William Casarin
2526f8001c make sure it's still working on android 2023-07-09 12:17:54 -07:00
William Casarin
6232a8429e timeline: add ui_abbrev_name
This is a simple and fast function for abbreviating usernames in the
timeline. If they are too large they make the timeline too wide. We'll
probably need to make this adjustable based on the timeline width, but
this is ok for now.

Changelog-Added: Abbreviate usernames in timelines
2023-07-09 11:13:01 -07:00
William Casarin
a0be5f0173 desktop -> notedeck 2023-07-06 19:42:51 -07:00
William Casarin
53c8ee0403 design: remove extra scrollbars, move toward design 2023-07-06 14:15:16 -07:00
William Casarin
898ccfb132 switch to shatter 2023-07-05 16:40:40 -07:00
William Casarin
a99056edf2 fonts: change font to onest 2023-07-05 14:53:44 -07:00
William Casarin
3033943e52 parser: add utf8 seeking functions
useful for peeking the previous utf8 char on a 0-copy utf8 buffer view
2023-07-01 11:27:47 -07:00
William Casarin
d591c694dd Add simple parser
Just getting warmed up. This will be used for note parsing.
2023-06-28 23:24:47 -04:00
William Casarin
0138dc8d3d default pfp
This will eventually be a local file. For now just load it remotely.
2022-12-12 14:51:57 -08:00
William Casarin
48af3dde9d many improvements 2022-12-12 14:33:37 -08:00
William Casarin
e6571d8847 initial nostr code 2022-12-11 15:46:18 -08:00
William Casarin
b6f5d8dc03 wgpu + egui 0.20.0
android broken but let's just fix it on the egui/winit side once that's
all updated
2022-12-10 16:57:46 -08:00
William Casarin
641c339682 get it working on all platforms again 2022-11-30 11:57:06 -08:00
William Casarin
adb2a4ecb4 some more misc updates 2022-11-30 11:16:26 -08:00
William Casarin
7e539c639b fix render resume on android 2022-11-30 11:12:01 -08:00
William Casarin
1fe860421b don't panic if we ever fail to lock here 2022-11-30 11:10:49 -08:00
William Casarin
ad1a1dd774 no idea why this is working now 2022-11-29 19:01:04 -08:00
William Casarin
28c5ddbc80 progress 2022-11-06 20:54:30 -08:00
William Casarin
ce21e10c90 initial egui damus app 2022-11-06 16:42:20 -08:00
William Casarin
696caa1f1c Initial commit 2022-11-05 22:12:17 -07:00