Commit Graph

47 Commits

Author SHA1 Message Date
William Casarin
1024affdbd actionbar: add thread button for testing
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin
66c8973edf actionbar: move BarAction and add execute method
We will be executing baractions in multiple places, so factor this
out.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:32 -07:00
William Casarin
af8d7d222c Add note wide mode for reposts
This adds a 'wide' note design for note previews. This is a mode
where the note contents does not have padding at the start. This makes
notes previews a bit nicer.

Screenshot: https://cdn.jb55.com/s/84271f386d564c34.png
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 10:56:15 -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
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
3fc73bb601 post: full available width
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-01 07:31:29 -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
26c4d90be3 initial postbox for testing
not sure if we want to put this here yet, but it matches the design
and will be useful for testing

Fixes: https://github.com/damus-io/notedeck/issues/110
Suggested-by: Rob
2024-06-25 14:08:56 -05:00
William Casarin
0b3d6f7e37 initial post reply view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 14:01:40 -07:00
William Casarin
ac0821db79 postbox: add focus shadow from figma
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 10:14:34 -07:00
William Casarin
b0c5d2a2c5 postbox: add focused state
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-21 09:01:14 -07:00
William Casarin
18d5d95ef9 fix postbox design
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-20 13:44:35 -07:00
William Casarin
bb6c68e05c clippy postbox cleanups
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-20 13:05:57 -07:00
William Casarin
1458498131 initial post box view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-17 16:21:46 -07:00
William Casarin
c4e0c710c9 actionbar: remove border on reply button, add expand animation
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-13 09:36:53 -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
5100070b24 fix colors again
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-11 18:44:40 -07:00
William Casarin
24d400d5aa small inline preview pfps
Signed-off-by: William Casarin <jb55@jb55.com>
2024-06-11 17:50:15 -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
2305f1e50a mobile: make mobile flag runtime-configurable
we need to pass a few more things around but it's not that bad. This
will allow you to launch damus with --mobile for mobile testing without
recompilation.
2024-05-31 01:05:53 -05: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
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
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
5396085d96 textmode: adjust name sizing so it doesn't bump the column 2024-05-02 18:51:05 +02: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
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
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
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
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
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
99ac578ebd fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-04-19 14:30:08 -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
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
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
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