Commit Graph
100 Commits
Author SHA1 Message Date
William Casarin 8e32f757f0 Merge 'Repost improvements #314'
This slightly improves the style of reposts. Icon color and size still
needs an update[2]

We also update nostrdb[1] to support instant kind6 ingestion, making
reposts render immediately

William Casarin (3):
      repost: update style
      nostrdb: update to support fast kind6 repost ingest

[1] https://github.com/damus-io/nostrdb/commit/cd9ba0ea7dfd021f2a3e98aefef87990d161aab3
[2] https://github.com/user-attachments/assets/23feba47-9d63-443f-9968-eba93053fc24
2024-09-17 15:37:21 -07:00
William Casarin b3f065fd2e nostrdb: update to support fast kind6 repost ingest
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-17 15:28:01 -07:00
William Casarin 27aa146300 repost: update style
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-17 15:28:01 -07:00
William Casarin b1339c8a24 Merge branch 'thread-hitbox'
This adds a note hitbox for opening threads. It doesn't seem to work on
note previews so we'll need to work on that next.

Ken Sedgwick (1):
      add note underbutton to detect clicks and open thread

William Casarin (3):
      notes: rename "underbutt" to "hitbox"
      remove thread button

Changelog-Added: Added note hitboxes for opening threads
Changelog-Removed: Remove temporary thread open button
2024-09-17 15:18:02 -07:00
William Casarin a8731c0210 remove thread button
now that we have note hitboxes

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-17 15:15:51 -07:00
William Casarin e16eeb4d1b notes: rename "underbutt" to "hitbox"
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-17 15:12:20 -07:00
William Casarin 80c9cbe5b2 Merge 'display kind 6 repost impl #302'
Merge kernel's changes for displaying kind6 reposts. We still need to
update the timeline code to fetch and include these in the queries.

kernelkind (2):
      kind 6 repost impl
      add suggested changes
2024-09-17 09:29:55 -07:00
William Casarin d141bb0ab5 Merge 'Accounts and Relay nav #307'
Now that we've refactored everything, column routing is trivial. This
adds account management and relay nav to the sidebar.

https://cdn.jb55.com/s/notedeck-router.mp4

William Casarin (5):
      accounts: use column nav for account management
      cleanup: remove account switcher widget
      nav: fix accounts nav animations
      ui: hook up relay management view
2024-09-17 09:28:52 -07:00
William Casarin 945ccde818 ui: hook up relay management view
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 17:15:07 -07:00
William Casarin fce82b2b6d nav: fix accounts nav animations
also make nav go backward when clicking the account switch button if we
already are navigating to accounts

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 16:54:29 -07:00
William Casarin 79a447239a cleanup: remove account switcher widget
we don't need this anymore

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 16:37:04 -07:00
William Casarin 52a7ed53ec accounts: use column nav for account management
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 16:36:38 -07:00
William Casarin 3c79724a81 Merge 'Read android args from config file on device' #298
Ken Sedgwick (1):
      Read android args from config file on device
2024-09-16 15:24:24 -07:00
William Casarin 36c0971fd9 Flexible routing
Another massive refactor to change the way routing works. Now any
column can route anywhere.

Also things are generally just much better and more modular via the
new struct split borrowing technique.

I didn't even try to split this into smaller commits for my sanity.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-16 14:50:20 -07:00
William Casarin b4a8cddc48 fix crash in selected columns
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-11 16:24:50 -07:00
William Casarin 37fbde1566 fix some rebase issues
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-11 16:24:43 -07:00
William Casarin 00091c5088 Switch to Columns
Also refactor damus app usage to only pass in things that we need in views.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-11 15:49:34 -07:00
William Casarin 4379466d1d android: launch with initial options
Feel free to change to have a customized android build

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-09 16:10:33 -07:00
William Casarin 4a4fb06425 split is_mobile to is_narrow and is_oled
is_mobile doesn't really make sense for android tablets. We were
overloading this variable to mean "is_narrow". What we really want is
is_oled for mobile devices and is_narrow for if its phone-like.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-06 21:54:48 -07:00
William Casarin 772bfbad5f img: remove loading spinners
This adds blank space, but it will be nice if we can improve this
by either fading in or having some shimmer effect.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-06 21:06:12 -07:00
William Casarin 8602650278 args: add datapath argument
This will allow us to test cache resets

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-06 21:06:12 -07:00
William Casarin c879982260 args: add --textmode
An option to enable textmode on startup

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-06 08:59:49 -07:00
William Casarin 7fa18fa5f7 Merge 'Supply default timeline for mobile app if empty' (#285)
Ken Sedgwick (1):
      Supply default timeline for mobile app if empty
2024-09-03 11:49:21 -07:00
William Casarin 989f88c989 fonts: add thai support
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-03 11:45:59 -07:00
William Casarin 01b9704415 appease clippy
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-03 11:25:48 -07:00
William Casarin efadd6153b arg: add -c universe column
Add helper for adding universe columns

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-03 11:18:32 -07:00
William Casarin ddba62df47 env: add some test npubs
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-03 11:12:50 -07:00
William Casarin c34227b5f7 arg: add -c profile{,:pubkey} arg column
This allows you to add profile columns

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-03 11:12:02 -07:00
William Casarin 4fdbad0df8 fix bug where it was subscribing too many times
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-03 11:11:38 -07:00
William Casarin 043ccf2146 debug: add subid debugging
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-03 11:10:59 -07:00
William Casarin 2603d08d1a tidy: fix formatting
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 18:31:53 -07:00
William Casarin ad9c8f959c columns: add --notifications{,:pubkey} argcolumn
This allows you to add notification columns pretty easily:

$ notedeck --sec $SEC -c contacts -c notifications -c notifications:$CORP_ACCT

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 18:29:21 -07:00
William Casarin ca09dc1675 filters: add limits to follow filters
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 18:16:22 -07:00
William Casarin 4c61c337bd fix transaction crash regression when opening thread
small oversight

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 18:12:12 -07:00
William Casarin 6a989e388b Merge images support
Thanks to Ken Sedgwick for getting this over the line by generalizing
our images cache!

Ken Sedgwick (2):
      build: updated num_enum to get around build problem
      Extend ImageCache to handle content images

William Casarin (4):
      update image to 0.25
      initial image support
      use slightly better carousel id

Fixes: https://github.com/damus-io/notedeck/issues/249
Fixes: https://github.com/damus-io/notedeck/issues/148
2024-09-02 17:56:32 -07:00
William Casarin b00dc735e1 use slightly better carousel id
still need to include timeline...

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 17:54:49 -07:00
William Casarin 0e4aad4184 initial image support
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 17:54:49 -07:00
William Casarin 036c257379 update image to 0.25
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 17:54:49 -07:00
William Casarin 21c00a41e0 Merge contact list fetching
William Casarin (15):
      cli: add --pub support for watchonly accounts
      column: extract into_timeline logic into ColumnKind
      contacts: fix hashtags in filter_from_tags
      docs: fix comment in the wrong spot
      fetch contact lists
      filter: create filter from contact list
      nostrdb: bump version
      perf: coordinate unknown id lookups
      refactor: move args to its own file
      tidy: move ColumnKind to its own file
      tidy: move parse_args to Args::parse
      tidy: organize bools
      tidy: remove some crate:: namespaces
      timeline: initial contact queries

Fixes: https://github.com/damus-io/notedeck/issues/236
Fixes: https://github.com/damus-io/notedeck/issues/6
2024-09-02 17:47:57 -07:00
William Casarin bc8a8d4a74 perf: coordinate unknown id lookups
This is a huge improvement over what it was before. Now all unknown id
lookups are debounced and happen through a central coordinator. This
ensures there is no duplication between timelines.

Fixes: https://github.com/damus-io/notedeck/issues/279
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 17:38:18 -07:00
William Casarin ad244d48c0 fetch contact lists
If we don't have a contact list, make sure to fetch one

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-02 16:22:29 -07:00
William Casarin 92e9e34e19 column: extract into_timeline logic into ColumnKind
I thought I needed this but maybe I don't. Anyways, it's a bit cleaner
this way.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-31 08:15:09 -07:00
William Casarin db49cf3c4b tidy: move ColumnKind to its own file
timeline file is starting to get messy

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-31 08:08:17 -07:00
William Casarin 9a9342ad35 tidy: remove some crate:: namespaces
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-31 07:17:45 -07:00
William Casarin 5de78cef21 docs: fix comment in the wrong spot
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-31 05:43:43 -07:00
William Casarin a051760fd9 contacts: fix hashtags in filter_from_tags
split hashtag follows into a separate Filter, combining authors and
hashtags doesn't work, because this is considered an AND filter, where
we want an OR.

We may want an option to split hashtags follows into a separate column.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-31 05:43:43 -07:00
William Casarin 2ea6473ae2 refactor: move args to its own file
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-31 05:43:43 -07:00
William Casarin 71259a8dd5 timeline: initial contact queries
This implements initial local contact queries. For testing you can
create contact list columns via:

Examples
--------

Make a contacts column from a specific npub:

	$ notedeck --column contacts:npub...

Use the current user's contacts:

	$ notedeck --column contacts --pub npub...

We also introduce a new ColumnKind enum which is used to describe the
column type.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-30 08:59:48 -07:00
William Casarin 11ede2086f cli: add --pub support for watchonly accounts
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-30 08:59:37 -07:00
William Casarin dd60d03407 filter: create filter from contact list
This adds a method for creating filters from contact lists. We will be
using this for creating follow timelines.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-30 08:49:29 -07:00
William Casarin ea547a3497 tidy: move parse_args to Args::parse
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-30 08:49:29 -07:00
William Casarin ae6c05ab42 tidy: organize bools
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-30 07:17:56 -07:00
William Casarin 21fd57f2c5 nostrdb: bump version
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-30 07:17:56 -07:00
William Casarin bf34175560 time: add future timestamp formatting
+10s for 10 seconds in the future, etc

This can happen sometimes

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-27 14:09:14 +03:00
William Casarin ad37602e0e Merge 'Fix global.json' 2024-08-27 14:08:45 +03:00
William Casarin 54526a8f55 log: track virtual list splices
These are caused when timeline note insertions are not at the top.
egui-virtual-list only has optimizations for that scenario.

Link: https://github.com/damus-io/notedeck/issues/94
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-27 13:50:38 +03:00
William Casarin 4ff30304e1 fix android build
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-21 07:48:56 +03:00
William Casarin cf14c6dfd2 flag to disable since optimization
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-21 07:48:45 +03:00
William Casarin 9b4093cd41 update to latest nostrdb version
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-21 06:59:27 +03:00
William Casarin 1f149aec3b fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-19 21:26:20 -07:00
William Casarin 973a7c780f thread: remote subscriptions working
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-19 21:22:58 -07:00
William Casarin 9328ef2dff remove duplicate filter types
only use nostrdb::Filter

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-19 21:12:32 -07:00
William Casarin 8c458f8f78 Merge initial threads 2024-08-16 11:51:42 -07:00
William Casarin 579b47fc40 selectable text option
Add a selectable text option to various note views. We don't want
selection events to interfere with back drag, so this is the first step
toward ensure back drag works.

Vertical scrollviews also interfere with back drag, so we'll still need
a way to compose gestures. It's not clear if this is currently possibly
with egui (union of responses somehow maybe?)

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-12 14:21:29 -07:00
William Casarin f769ddad09 fix threads
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-06 14:38:21 -07:00
William Casarin 51b4dfd3f3 temp fix crash due to race condition
we should fix the race condition though

Link: https://github.com/damus-io/nostrdb/issues/35
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:41:41 -07:00
William Casarin be0efd57e5 bump ingester threads from 2 to 4
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:38:46 -07:00
William Casarin 3cbcd98dd4 arg: add dbpath argument
This is great for testing without using an existing DB

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:38:38 -07:00
William Casarin 0869cdde65 temp fix crash due to race condition
we should fix the race condition though

Link: https://github.com/damus-io/nostrdb/issues/35
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:37:44 -07:00
William Casarin ce5142656e bump ingester threads from 2 to 4
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:33:40 -07:00
William Casarin abd529e91b arg: add dbpath argument
This is great for testing without using an existing DB

Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-03 11:32:56 -07:00
William Casarin de5039fc65 fix bech32 bug bleh
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-01 14:10:19 -07:00
William Casarin 6e27c34267 update nostrdb to fix note corruption bug
Changelog-Fixed: fix note content corruption bug with damus.io links
Signed-off-by: William Casarin <jb55@jb55.com>
2024-08-01 13:44:28 -07:00
William Casarin 20f0aed2ed doc: add docs for get_unknown_note_ids
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 14:21:47 -07:00
William Casarin 38626520c1 thread: warn when we return 0 notes
This is a bug

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 14:01:41 -07:00
William Casarin 4b644bee32 restore unknown id fetching of root notes
still technically depends on the notebuf branch

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:55:22 -07:00
William Casarin c3fc4e09e8 thread: fix ordering and duplication bugs
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:55:06 -07:00
William Casarin d44c4c2f9c make local sub log more explicit
was hard to tell if this meant remote or local sub

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin dd9f41b04a threads: ensure we always handle bar results
We were not handling it in ThreadView, now we do.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin d43c46aaf4 nostr: fix parsing of OK events
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin 593df9145b threads: check for new notes locally when thread is re-opened
We have a NoteRef cache for threads in memory, which is just a list of
NoteKeys and timestamps.

When reopening a thread, query the local DB to see if there are any new
notes that we might have missed because we weren't actively subscribed
to them.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin 5be6b1ca68 ui: move timeline view to its own file
Also add some thread methods for fetching new notes

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin a28db5d330 local thread subscriptions
This adds local nostrdb thread subscriptions. When navigating to a
thread, we first check to see if we have any active nostrdb
subscriptions for that thread. If not, we create a new subscription. If
we do, we re-use that subscription.

This works by storing thread state in the Threads struct in the Damus
application state.

When we pop a route, we check to see if its a thread route. If it is,
then we try to unsubscribe, but only if that is the last remaining
subscriber for that thread, as there could be more than one.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
William Casarin 33e5b6886b threads: add initial thread support
This is a really dumb and broken version of threads, but it will be our
foundation for future changes.

All it currently does is load whatever notes we have locally for a
thread in chronological order. It currently does not open any
subscriptions. It is not clear what is replying to what, but hey, its a
start.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 13:51:24 -07:00
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 c007cbd4f2 preview: add scroll to profile pic demo
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-28 13:40:42 -05:00
William Casarin b917d48015 log: reduce ping/pong verbosity
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-28 13:40:29 -05:00
William Casarin 1c8b68c334 switch to GPLv3, not sure why it was MIT
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-22 11:20:31 -07:00
William Casarin 06028ba66e deps: update deps for thread-needed changes
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:45 -07:00
William Casarin 196535ce84 anim: add hover_expand_small
I though I would need this, but I didn't end up using it. Keep it here
anyways for now

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:45 -07:00
William Casarin f1835d0119 timelineview: add customizable initial note capacity
We will be using this for threads, so we'll want a smaller
capacity there.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:54:45 -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 758de6b024 timeline: simplify tabs_ui
we don't really need to pass a timeline into it

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:52:22 -07:00
William Casarin bf57e3b780 viewfilter: add default implementation
This will be used in future commits

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:52:22 -07:00
William Casarin 86f87fa0a5 noteref: move to note.rs
This doesn't need to be in timeline

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-16 12:51:30 -07:00
William Casarin 6b634646d5 fix nostrdb crash
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-15 12:39:42 -07:00
William Casarin f2c5978ba5 allow relay pool customization via -r/--relay argument
This allows you to use specific relays instead of some random
bootstrap ones we are currently using

Fixes: https://github.com/damus-io/notedeck/issues/154
Changelog-Added: Add -r/--relay cli option for customized relay pool
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-11 11:25:21 -07:00
William Casarin cc734e2a66 logs: add relay string to relay connection errors
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 16:00:38 -07:00
William Casarin a36ce31fc7 pool: increase default reconnect time to 5 seconds
Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-10 16:00:38 -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