Commit Graph

141 Commits

Author SHA1 Message Date
William Casarin
d3bae69465 Merge avoid duplicate crates by rex4539 #746 2025-02-28 15:26:22 -08:00
kernelkind
5791b0c5b1 use mime_guess
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
Dimitris Apostolou
cc5941e919 avoid duplicate crates 2025-02-24 22:06:37 +02: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
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
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
kernelkind
2bce115b21 import base64
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-01-24 15:43:48 -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
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
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
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
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
kernelkind
13a406b9cd deps: remove reqwest
This was preventing us from building on windows amd

Closes: https://github.com/damus-io/notedeck/pull/567
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-13 10:01:26 -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
Ken Sedgwick
e31ce5d879 android: Undo the workspace stuff because android builds don't like 2024-12-09 10:39:00 -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
575d469aa0 Release v0.2.0 - Notedeck Alpha
Thanks to kernel and ken for helping with our first
release of Notedeck!

name                                 added   removed  commits
-------------------------------------------------------------
William Casarin <jb55@jb55.com>      +38170  -20819   552
kernelkind <kernelkind@gmail.com>    +14206  -5593    140
Ken Sedgwick <ken@bonsai.com>        +473    -206     24
hellodword                           +30     -23      1
alltheseas                           +12     -2       4
0xb10c <b10c@b10c.me>                +6      -2       1
2024-11-30 11:10:47 -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
Ken Sedgwick
50f38b00a8 Merge pull request #480 from ksedgwic/2024-11-generate-rpm
Generate RPM package
2024-11-26 15:00:06 -06:00
Ken Sedgwick
ad52775822 Generate RPM package 2024-11-25 15:25:56 -08:00
kernelkind
f982c65862 macos packaging
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-11-25 16:42:20 -05: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
Ken Sedgwick
ae4b7750cc Restore RUST_LOG filtering, default to INFO if absent 2024-10-30 10:39:51 -07:00
kernelkind
503b7edeb5 use open instead of egui OpenUrl for mailto link
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-28 17:02:40 -04:00
kernelkind
309477dca4 support view
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-25 15:23:35 -04:00
kernelkind
03bfb34172 app window size persists on app close
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-25 15:23:35 -04:00
kernelkind
d3b4a9efc1 write log files to disk daily and on panic
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-25 15:23:35 -04:00
kernelkind
4f86e9604f file storage
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-25 15:23:35 -04:00
William Casarin
f7c6e2774e update to use upstream egui-nav branch
Signed-off-by: William Casarin <jb55@jb55.com>
2024-10-11 12:54:49 +02:00
kernelkind
b1549a52c7 tmp: kernelkind/egui-nav
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-08 21:43:31 -04:00
kernelkind
983640b85a tmp: kernelkind/egui-nav
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-08 21:37:16 -04:00
kernelkind
0a22210c89 tmp use kernelkind egui-nav
Signed-off-by: kernelkind <kernelkind@gmail.com>
2024-10-07 12:42:51 -04:00