Commit Graph

144 Commits

Author SHA1 Message Date
kernelkind
5791b0c5b1 use mime_guess
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-02-25 16:49:00 -05:00
kernelkind
4cd80c10b1 introduce UrlMimes
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-02-25 16:49:00 -05:00
kernelkind
fa9e318e41 update ehttp to 0.5.0
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-02-25 16:49:00 -05:00
kernelkind
9466c10875 use bincode
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-02-25 16:49:00 -05:00
William Casarin
a95bc6ad5e egui: replace with damus-io repo
Signed-off-by: William Casarin <jb55@jb55.com>
2025-02-10 15:57:50 -08:00
kernelkind
07c6b27493 use updated TextEdit::layouter in egui
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-02-07 15:58:57 -05:00
kernelkind
48933c2488 use dev dep pretty assertions
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-02-07 15:58:57 -05:00
Ken Sedgwick
482313f883 add relay hints to Mention::{Profile,Event} and UnknownIds 2025-02-06 10:08:01 -08:00
William Casarin
fd030f5b5c Merge rewrite deck serialization, timeline cache, add algo timelines #712
William Casarin (19):
      algos: introduce last_n_per_pubkey_from_tags
      wip algo timelines
      Initial token parser combinator
      token_parser: unify parsing and serialization
      token_serializer: introduce TokenWriter
      token_parser: simplify AddColumnRoute serialization
      tokens: add a more advanced tokens parser
      tokens: add AccountsRoute token serializer
      tokens: add PubkeySource and ListKinds token serializer
      tokens: add TimelineRoute token serializer
      tokens: initial Route token serializer
      add tokenator crate
      note_id: add hex helpers for root notes
      tokens: add token serialization for AlgoTimeline
      tokens: add token serialization for TimelineKind
      tokens: switch over to using token serialization
      Switch to unified timeline cache via TimelineKinds
      hashtags: click hashtags to open them
2025-02-05 18:46:16 -08:00
William Casarin
0cc1d8a600 Switch to unified timeline cache via TimelineKinds
This is a fairly large rewrite which unifies our threads, timelines and
profiles. Now all timelines have a MultiSubscriber, and can be added
and removed to columns just like Threads and Profiles.

Signed-off-by: William Casarin <jb55@jb55.com>
2025-02-05 18:30:45 -08:00
William Casarin
ae85f2dd34 version: bump to 0.3.1
Just a binary fix for ubuntu

Signed-off-by: William Casarin <jb55@jb55.com>
2025-02-04 11:51:16 -08:00
William Casarin
ed455f7ea4 add tokenator crate
also remove a lot of the "advanced" token parsing style
which was a bit too verbose for my tastes

Signed-off-by: William Casarin <jb55@jb55.com>
2025-02-04 08:08:08 -08:00
William Casarin
69b7581a53 Notedeck Alpha 2 Release - v0.3
Thanks again to kernel and ken, as well as some new contributors:
kieran, daniel saxton for our alpha 2 release!

Added
=====

- Clicking a mention now opens profile page (William Casarin)
- Note previews when hovering reply descriptions (William Casarin)
- Media uploads (kernelkind)
- Profile editing (kernelkind)
- Add hashtags to posts (Daniel Saxton)
- Enhanced command-line interface for user interactions (Ken Sedgwick)
- Various Android updates and compatibility improvements (Ken Sedgwick, William Casarin)
- Debug features for user relay-list and mute list synchronization (Ken Sedgwick)

Changed
=======

- Add confirmation when deleting columns (kernelkind)
- Enhance Android build and performance (Ken Sedgwick)
- Image cache handling using sha256 hash (kieran)
- Introduction of decks_cache and improvements (kernelkind)
- Migrated to egui v0.29.1 (William Casarin)
- Only show column delete button when not navigating (William Casarin)
- Show profile pictures in column headers (William Casarin)
- Show usernames in user columns (William Casarin)
- Switch to only notes & replies on some tabs (William Casarin)
- Tombstone muted notes (Ken)
- Pointer interactions enhancements in UI (William Casarin)
- Persistent theme setup across sessions (kernelkind)
- Increased ping intervals for network performance (William Casarin)
- Nostrdb update for async support (Ken Sedgwick)

Fixed
=====

- Fix GIT_COMMIT_HASH compilation issue (William Casarin)
- Fix avatar alignment in profile previews (William Casarin)
- Fix broken quote repost hitbox (William Casarin)
- Fix crash when navigating in debug mode (William Casarin)
- Fix long delays when reconnecting (William Casarin)
- Fix repost button size (William Casarin)
- Fixed since kind filters (kernelkind)
- Clippy warnings resolved (Dimitris Apostolou)

Refactoring & Improvements
==========================

- Numerous internal structural improvements and modularization (William Casarin, Ken Sedgwick)

Signed-off-by: William Casarin <jb55@jb55.com>
2025-01-31 10:31:07 -08:00
kernelkind
5aa1c982cd use rfd for desktop file selection
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-01-24 15:43:48 -05:00
kernelkind
b5a782a06e notedeck_columns: use sha2 & base64
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-01-24 15:43:48 -05:00
kieran
86e68b1c29 move Notedeck to notedeck crate 2025-01-20 23:25:31 +00:00
kernelkind
a24a089e87 extract timing from AppSizeHandler to TimedSerializer
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-01-13 18:46:16 -05:00
kieran
06417ff69e image-cache: use sha256 hash of url for key 2025-01-07 12:00:46 +00:00
William Casarin
c7d3aae856 nav: slow down nav animation a bit
you care barely see it
2025-01-04 16:01:24 -08:00
William Casarin
212c296da5 Merge tombstone muted notes #606
Changelog-Changed: Tombstone muted notes
2025-01-04 14:16:16 -08:00
William Casarin
5f21d32d96 android: fix android logging 2025-01-04 13:14:05 -08:00
William Casarin
fe6206c546 Note multicasting
This is an initial implementation of note multicast, which sends posted
notes to other notedecks on the same network.

This came about after I nerd sniped myself thinking about p2p nostr on
local networks[1]

You can test this exclusively without joining any other relays by
passing -r multicast on the command line.

[1] https://damus.io/note1j50pseqwma38g3aqrsnhvld0m0ysdgppw6fjnvvcj0haeulgswgq80lpca

Signed-off-by: William Casarin <jb55@jb55.com>
2025-01-04 10:37:11 -08:00
Ken Sedgwick
2d7de8fdc0 Add debug-widget-callstack and debug-interactive-widgets features
- they need to be separate, both on at once is too much

    --features debug-widget-callstack
      Show callstack for the current widget on hover if all modifier keys
      are pressed down

    --features debug-interactive-widgets
      Show an overlay on all interactive widgets

    Notes:
    - debug-widget-callstack asserts `egui:callstack` feature when enabled
    - Only works in debug builds, compile error w/ release builds
2025-01-02 14:14:29 -08:00
William Casarin
eeab1666e7 query: fix since filter on kind queries
Before kind queries with since filters wasn't working. Now it does.

Changelog-Fixed: Fixed since kind filters
2024-12-30 11:41:30 -08:00
William Casarin
6d1d28c84b lockfile: update
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-20 15:40:19 -08:00
William Casarin
11274ac4df nav: make back nav faster
Changed the egui-nav spring function so its now so slow near the
end of the aniation.

Fixes: https://github.com/damus-io/notedeck/issues/595
2024-12-18 13:04:09 -08:00
William Casarin
47e0b0ed52 nostrdb: update to fix sub memleak 2024-12-17 09:19:35 -08:00
Ken Sedgwick
e1a55c6532 update nostrdb-rs for async stream support
Closes: https://github.com/damus-io/notedeck/pull/584
2024-12-17 08:56:48 -08:00
Ken Sedgwick
7da98b3c5c fix android build with cargo update num_enum@0.7.3
Compiling num_enum v0.7.3
error[E0463]: can't find crate for `num_enum_derive`

Closes: https://github.com/damus-io/notedeck/pull/584
2024-12-17 08:56:45 -08:00
William Casarin
e5ab8d5b9c nostrdb: update to fix profile queries
before profile queries were not working at the database level,
because there was no note_pubkey or note_pubkey_kind index. Now there
is! So profiles should be much faster to query now, and will actually
return results.

There still appears to be an issue with the profile NotesHolder which
is preventing it from updating, via the logic in poll_notes_into_view.
The original Timeline version of this function works fine, but it looks
like the NotesHolder one is broken.

Going to work on refactoring the notes holder next to fix.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-13 23:35:08 -08:00
William Casarin
ab829b45fc enostr: update ewebsock
This was using an ancient version of rustls, which in turn included
an old version of ring, which was the real reason of the windows
compile issues (i think)

Cc: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-13 11:01:09 -08:00
William Casarin
08a5ed1076 lockfile: update
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-13 10:01:53 -08:00
William Casarin
c3bbc6b977 android: fix issues due to rearchitecture 2024-12-13 09:36:10 -08:00
William Casarin
ec755493d9 Introducing Damus Notedeck: a nostr browser
This splits notedeck into:

- notedeck
- notedeck_chrome
- notedeck_columns

The `notedeck` crate is the library that `notedeck_chrome` and
`notedeck_columns`, use. It contains common functionality related to
notedeck apps such as the NoteCache, ImageCache, etc.

The `notedeck_chrome` crate is the binary and ui chrome. It is
responsible for managing themes, user accounts, signing, data paths,
nostrdb, image caches etc. It will eventually have its own ui which has
yet to be determined.  For now it just manages the browser data, which
is passed to apps via a new struct called `AppContext`.

`notedeck_columns` is our columns app, with less responsibility now that
more things are handled by `notedeck_chrome`

There is still much work left to do before this is a proper browser:

- process isolation
- sandboxing
- etc

This is the beginning of a new era! We're just getting started.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-12 20:08:55 -08:00
William Casarin
74c5f0c748 split notedeck into crates
This splits notedeck into crates, separating the browser chrome and
individual apps:

* notedeck: binary file, browser chrome
* notedeck_columns: our columns app
* enostr: same as before

We still need to do more work to cleanly separate the chrome apis
from the app apis. Soon I will create notedeck-notebook to see what
makes sense to be shared between the apps.

Some obvious ones that come to mind:

1. ImageCache

We will likely want to move this to the notedeck crate, as most apps
will want some kind of image cache. In web browsers, web pages do not
need to worry about this, so we will likely have to do something similar

2. Ndb

Since NdbRef is threadsafe and Ndb is an Arc<NdbRef>, it can be safely
copied to each app. This will simplify things. In the future we might
want to create an abstraction over this? Maybe each app shouldn't have
access to the same database... we assume the data in DBs are all public
anyways, but if we have unwrapped giftwraps that could be a problem.

3. RelayPool / Subscription Manager

The browser should probably maintain these. Then apps can use ken's
high level subscription manager api and not have to worry about
connection pool details

4. Accounts

Accounts and key management should be handled by the chrome. Apps should
only have a simple signer interface.

That's all for now, just something to think about!

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-11 11:24:29 -08:00
Ken Sedgwick
35138cd951 android: update to winit 0.30.5 2024-12-09 10:40:04 -08:00
William Casarin
1b31557b03 prevent users from running as debug
We give a friendly message now. If you need to run as debug,
use `cargo run -- --debug` or `./target/debug/notedeck --debug`

We also remove the callstack feature because it doesn't seem
like you need it for widget callstacks.

Fixes: aafddf5acb ("debug: add crate features which enable egui DebugOptions")
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-07 20:56:14 -08:00
William Casarin
720230ca55 fix profiler
I updated puffin to egui v0.29.1 and now it works

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-07 19:53:32 -08:00
William Casarin
323d1bcd2c Migrate to egui v0.29.1
Not too many breaking changes. I updated egui-nav and egui-tabs as well.

Fixes: https://github.com/damus-io/notedeck/issues/315
Changelog-Fixed: Fixed crash when navigating in debug mode
Changelog-Changed: Migrated to egui v0.29.1
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-07 16:40:43 -08:00
William Casarin
be3edc02a4 nav: refactor title rendering for flexibility
Updated navigation to use a custom title renderer for more flexible
rendering of navigation titles. This change decouples the rendering
logic from predefined formats, enabling dynamic title compositions
based on application context and data.

This includes:
- Refactoring `NavResponse` to introduce `NotedeckNavResponse` for
  handling unified navigation response data.
- Adding `NavTitle` in `ui/column/header.rs` to handle rendering
  of navigation titles and profile images dynamically.
- Updating route and timeline logic to support new rendering pipeline.
- Replacing hardcoded title rendering with data-driven approaches.

Benefits:
- Simplifies navigation handling by consolidating title and action
  management.
- Improves scalability for new navigation features without modifying
  core logic.
- Enhances visual customization capabilities.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-05 10:58:59 -08:00
William Casarin
78210e8208 ui: fix quote repost hitbox
The response from the wide rendered note was incorrect, leading to and
incorrectly sized hitbox. This fixes that.

Additionally, we include note options and note parent into the hitbox
key, as this may influence the size of the note.

Before: https://cdn.jb55.com/s/b2464c22a65adb12.png
After: https://cdn.jb55.com/s/52545564d98d278e.png

Fixes: https://github.com/damus-io/notedeck/issues/519
Closes: https://github.com/damus-io/notedeck/pull/537
Changelog-Fixed: Fix broken quote repost hitbox
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-03 17:53:29 -08:00
Ken Sedgwick
aafddf5acb debug: add crate features which enable egui DebugOptions
--features debug-widget-callstack
  Show callstack for the current widget on hover if all modifier keys
  are pressed down

--features debug-interactive-widgets
  Show an overlay on all interactive widgets

Notes:
- debug-widget-callstack asserts `egui:callstack` feature when enabled
- Only works in debug builds, compile error w/ release builds
2024-12-03 09:09:02 -08:00
Ken Sedgwick
f00a67ab2c Update user relay-list via polling 2024-12-02 13:14:50 -08:00
William Casarin
8d59260935 windows: handle large mapsizes gracefully
Update nostrdb to gracefully handle mapsizes that
are too large and fail to create nostrdb files.

We now keep shrinking the mapsize until database creation
succeeds. We still use the default mapsize of 32GiB on
windows, which is a bit annoying until we have nostrdb
resizing like monero.

Fixes: https://github.com/damus-io/notedeck/issues/491
2024-11-28 16:52:00 -08:00
William Casarin
a1d8adfff3 deps: switch to windows nostrdb-rs
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 14:34:00 -08:00
William Casarin
3fb78ae01e nav: use id_source instead of show argument
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 16:14:56 -08:00
William Casarin
702f8ffca3 Merge a few relay fixes from ken
Pick a few fixes from #380

Link: https://github.com/damus-io/notedeck/pull/380

Ken Sedgwick (5):
      build: Cargo.lock updates to mitigate num_enum_derive problem
      add .rustfmt.toml to specify edition
      Fix parsing of subscription id for RelayMessage::Event
      Skip adding relays that are already in the pool
      canonicalize relay urls to avoid false duplicates
2024-11-11 11:19:56 -08:00
Ken Sedgwick
ae4b7750cc Restore RUST_LOG filtering, default to INFO if absent 2024-10-30 10:39:51 -07:00
Ken Sedgwick
570d64c3cd canonicalize relay urls to avoid false duplicates 2024-10-29 13:42:29 -07:00
Ken Sedgwick
2baf9dfed0 build: Cargo.lock updates to mitigate num_enum_derive problem 2024-10-29 13:42:26 -07:00