Commit Graph
100 Commits
Author SHA1 Message Date
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 5b7b47aaf5 style: less bubbly 2024-05-04 11:32:34 -05:00
William Casarin 029bbf0e77 nix: add openssl dep for reqwest 2024-05-02 19:31:20 +02:00
William Casarin 5396085d96 textmode: adjust name sizing so it doesn't bump the column 2024-05-02 18:51:05 +02: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 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 f4d496012b log relay subscriptions
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-29 14:06:20 -07:00
William Casarin 632e5b89d1 mobile: don't add hover on mobile
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-29 12:48:26 -07:00
William Casarin a173e38141 slightly larger pfpfs
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-29 12:47:29 -07:00
William Casarin ca58b831b6 queries: set reasonable initial query sizes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-29 11:01:28 -07:00
William Casarin 0a6a441041 simplify is_mobile check
Just base it on the current compile target

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-29 11:00:56 -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 afb0e5fe65 github: remove pages workflow
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-27 01:53:08 -07:00
William Casarin d0cfeee79f readme: make it clear that nix is optional for non-android dev
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-26 11:11:06 -07:00
William Casarin f12ccc69a4 add hover to profile map demo
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-24 12:49:06 -07:00
William Casarin 7ec31d0eae fun large profile grid preview
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-24 12:49:06 -07:00
William Casarin e8168b0004 ui: add profile picture hover animation
I wanted to practice doing animation in egui, so here is a simple
profile picture hover affect. When you mouse over a profile picture, it
get slightly bigger.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-24 12:49:06 -07:00
William Casarin 61deeb03e1 note: support nprofile mentions
realized we were missing this bit

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-24 12:49:06 -07:00
William Casarin 32923abfc2 perf: profiling note content rendering
Made some small speed improvements

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-22 08:58:30 -07:00
William Casarin c944cac810 style: realtime hover interactions
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 17:57:32 -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 24633b84bb ui: introduce profile picture widget
We are starting to use profile pics in different places, let's make it a
widget. We'll also probably need to have adjustable sizes and such soon.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 16:49:49 -07:00
William Casarin 863ccd866b render_pfp: only depend on imgcache
This will allow us to build previews a bit nicer

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 16:36:14 -07:00
William Casarin ee94f27987 profile: add about and username to profile previews
Also adjust colors to match design

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 16:28:12 -07: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 2edba9942c ui: add banners to profile previews
profile previews still need lots of work, but this was a challenge to
get an aspectRatio: fill mechanism for images which the banner takes
advantage of.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 15:03:05 -07:00
William Casarin 2f6f92e62c style: set 0 duration tooltip delay
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 15:03:05 -07:00
William Casarin 7f61d9aeb7 images: add aspect_fill
This is similar to SwiftUI's .aspectRatio(contentMode: .fill) so that
we can get a filling banner image

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 15:03:05 -07:00
William Casarin 55111b8b25 test: update test profile with a banner
I need this to test profile preview banners

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 15:03:05 -07:00
William Casarin a408c96d91 ui: remove some old note ui comments
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 15:03:05 -07:00
William Casarin 54bf2a0767 previews: remove central panel frame
This was adding padding we don't want

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-21 13:42:49 -07:00
William Casarin bf7775467d readme: document previews
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 22:16:54 -07:00
William Casarin 05fe164a49 ui: add initial Profile hover previews
The idea with these is that on notedeck you can just hover your cursor
over a profile link to see the profile. I just have a stub for now, but
full design coming soon after.

Also simplify the preview system even further with a macro. In the
future I imagine we can grep every preview in the codebase, and then
include this as a string inside this macro. This is some kind of
template metaprogramming insanity but in theory it could work.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 22:00:19 -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
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 9642b9243d a quick note about the View trait
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 17:38:47 -07:00
William Casarin 22e4b72729 check: remove duplicate and disable wasm checks
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 17:37:41 -07:00
William Casarin 73f54d1c4f ci: disable wasm builds for now
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:32:51 -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 ff5e5ed74a make notedeck front and center
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-17 14:37:11 -07:00
William Casarin 6e939a414f readme: show notedeck preview
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-17 14:33:19 -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 e348950e7a crates: add bitflags
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-14 16:23:36 -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
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 91c5d453c4 profiling: update puffin version
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-12 16:03:00 -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 3f26ba1af7 readme: add usage
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-11 15:03:30 -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 ef57ddd9ca readme: make it clear that its for desktop
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-11 14:47:41 -07:00
William Casarin 8cfb021dab add rustup just in case
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-11 14:35:02 -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 d0efb2ef55 we should just called this damus
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-11 11:41:28 -07:00
William Casarin 9e7111f8a7 Merge remote-tracking branch 'android/master' 2024-04-11 11:38:04 -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 813409c7bb queries: update hashtags query
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-09 18:49:24 -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
William Casarin 625eb3ea16 fix global query
Signed-off-by: William Casarin <jb55@jb55.com>
2024-03-26 09:20:10 +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 35a9fa3dd8 queries: add a few more test queries 2024-03-22 11:12:32 +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 d7a41115be test: add test timeline query
notedeck "$(cat queries/timeline.json)"

Closes: https://github.com/damus-io/notedeck/issues/5
2024-03-21 16:24:18 +01:00
William Casarin f364748005 ui: reduce vertical padding for more compact timelines 2024-03-21 15:54:08 +01:00
William Casarin 81162a3d6e nostrdb: bump to support timeline queries
This version of nostrdb supports timeline queries, so we can use
contact lists to query the timeline.
2024-03-21 14:31:38 +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 57308f108e gitignore: add perf files 2024-03-21 14:30:22 +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 f88b6d1dd4 Merge remote-tracking branch 'github/master' 2024-03-13 16:48:27 +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 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
William Casarin 08fad55773 weird actionbar experiment 2024-03-12 10:11:27 +00:00
William Casarin d4879aefe9 actionbar placeholder 2024-03-09 01:39:16 -08:00
William Casarin 4a5a9d4319 black background 2024-03-09 01:21:07 -08:00
William Casarin 088d012c93 fix typo 2024-02-27 15:02:52 -08: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 1c16ddf9af deps: update poll-promise, add hex
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-27 14:25:46 -08:00
William Casarin 4a802ac0f4 direnv: disable nix direnv on darwin
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-26 14:09:37 -08:00
William Casarin 40fd85da58 relay: don't query unknown authors if we have none to query
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-16 11:39:22 -08:00
William Casarin 3870bc9506 pfp: small fix in profile pic loading
I want to tweak the size of the profile pic, this is a small change
that I noticed toward that goal.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-16 11:39:22 -08:00
William Casarin 4ea82cd332 debug: fix annoying decode error message
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-16 11:39:22 -08:00
William Casarin 300dfc8a4e fonts: remove old font loading code
Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-16 11:39:22 -08:00
William Casarin 97aaa651d8 style: allow font style customization in the future
I had a work in progress commit that changed font styles that needed
this change, so doing it here for now.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-02-16 11:39:22 -08:00