Commit Graph
100 Commits
Author SHA1 Message Date
William Casarin 093cf8c720 column: switch to simplified strings for column headers
This uses less allocations, and once we switch to profile pictures in
the header the old way won't be needed

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-05 10:59:00 -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 cf773a90fd anim: smoothly animate delete button from 0 size
This is a much cleaner animation

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-05 10:57:21 -08:00
William Casarin 900d13ad4d ui: fix duplicate hitbox widget ids
Fixes: 78210e8208 ("ui: fix quote repost hitbox")
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-03 20:46:41 -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
William Casarin 229694466a ui: use proper response in wide-rendered note
This was causing hitbox issues

Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-03 17:52:52 -08:00
William Casarin 5dcab460e5 fix linux packages again 2024-12-02 15:43:04 -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 678c82b388 ci: fix linux packages 2024-11-30 11:05:55 -08:00
William Casarin 9055d07844 build: cross compile binary packages (rpm/deb/dmg)
Windows build still has issues on aarch64 so we postpone that for now
2024-11-30 09:42:50 -08:00
William Casarin 2969db7e30 img: include jpeg when detecting images
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 12:19:47 -08:00
William Casarin 6ab8eb078e ui: add top spacing for sidepanel on macos
also slightly increase width

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 12:08:33 -08:00
William Casarin 65537b28fd ui: remove top panel
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 11:59:36 -08:00
William Casarin 800fb920a2 ui: make notedeck alpha text gray instead of purple
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 11:38:20 -08:00
William Casarin c07276e5d0 support: just use version instead of notedeck
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 11:38:20 -08:00
William Casarin 4a1985d728 text: make tiny text smaller
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 11:38:20 -08:00
William Casarin 42c0f02072 onboarding: add introductions hashtag column
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 10:35:15 -08:00
William Casarin f8d6fbf153 refactor: simplify demo timeline if statement
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 10:34:56 -08:00
William Casarin c8d95aca2a timeline: add simple hashtag timeline constructor
Useful for adding hashtag timelines manually without the
into_timeline thing

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 10:34:18 -08:00
William Casarin 37ab6f33fb accounts: remove pink selected frame
Opinionated design call I am making

Fixes: 36b8afd1750d ("Update account management UI to design")
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 10:21:49 -08:00
William Casarin 409e8c2e3a icon: fix app icon
Updated to roberto's fixed icon, I also added some padding so that it
looks right int the app switcher.

Closes: https://github.com/damus-io/notedeck/pull/503
Closes: https://github.com/damus-io/notedeck/pull/496
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 10:08:00 -08:00
William Casarin 2e9a00ee57 demo: ensure we have a base column
This allows you to set your first column as your own home timeline
without having to re-arrange anything

Fixes: 62a85d921c1f ("use demo config when no accs")
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 10:04:57 -08:00
William Casarin e3ed744a5c posts: add client tag when posting and replying
This should help us a bit with seeing notedeck usage.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-29 09:55:33 -08:00
William Casarin 236d1684e7 try to fix linux packages yet again
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 18:39:18 -08:00
William Casarin 355151e1d4 Revert "ci: build before test"
to figure out this packaging issue...

This reverts commit 24db85f1d0.
2024-11-28 17:45:31 -08:00
William Casarin 24db85f1d0 ci: build before test
just because
2024-11-28 16:56:31 -08:00
William Casarin 69eaccdd8f windows: cap dbsize to 16GiB for now
because windows is horrible
2024-11-28 16:52:00 -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 dea2873d9a build: only build packages on merge to master
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 12:01:47 -08:00
William Casarin 0171e6c970 clippy: fix clippy warnings
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 12:01:47 -08:00
William Casarin 708be85709 readme: add ci badge
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 11:51:24 -08:00
William Casarin 05f36c81b3 github: run ci on pushes to master as well
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 11:50:24 -08:00
William Casarin 45c104786b readme: use proper link
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 11:14:32 -08:00
William Casarin 7fcb7b5ab0 readme: update with newer image
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-28 11:13:56 -08:00
William Casarin 762fd263bb github: remove deprecated actions
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 17:15:19 -08:00
William Casarin 7f278fb630 github: update to checkout v4 in actions
may solve deprecation warnings

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 16:46:40 -08:00
William Casarin 5cea7ae5d4 github: split matrix into individual build steps per OS
So we don't have to wait for the whole matrix to start building
individual packages per OS

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 16:27:37 -08:00
William Casarin 79e0228790 github: automatically build and sign macOS dmg
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 16:19:40 -08:00
William Casarin 921c0f1118 macos: remove macos_build_secrets.sh as build requirement
Users can source this themselves, or use something like direnv to
automatically load them when you `cd` into the project.

In the case of github actions, these will be set in the environment.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 16:19:26 -08:00
William Casarin 987e43d0ca envrc: source macos secrets
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 15:45:14 -08:00
William Casarin d57a3ebc62 github: add windows build matrix and installer package
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 15:45:11 -08:00
William Casarin e812be476d win: add installer script
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 14:39:48 -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 38fc39e275 clippy: fix clippy issues
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 14:34:00 -08:00
William Casarin de802cd363 Revert "ui: simply hide post button if buffer is empty"
This reverts commit 4133570c2e.
2024-11-27 09:30:07 -08:00
William Casarin 536f7579a9 Merge: user can upgrade their npub -> nsec #485
William Casarin (2):
      refactor: make LoginAction a bit safer

kernelkind (1):
      user can upgrade their npub -> nsec
2024-11-27 09:29:41 -08:00
William Casarin e69a7f83ae refactor: make LoginAction a bit safer
We make LoginAction a simple wrapper around processing the unknown
action to expose too much internal logic. This allows us to have a
must_use on our LoginAction type, otherwise the SingleUnkIdAction's
must_use will be lost when returned in the login action.

Fixes: a5cdddbb2b ("user can upgrade their npub -> nsec")
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-27 09:28:29 -08:00
William Casarin 12743b4469 Merge Add debian packaging #483
Fixes: https://github.com/damus-io/notedeck/issues/463

Ken Sedgwick (2):
      Add debian packaging
      update to github v4 artifact actions
2024-11-27 09:08:57 -08:00
William Casarin 18eba128f6 set app icon to damus logo
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-26 13:25:30 -08:00
William Casarin cea144b5b7 NoteDeck -> Notedeck
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-26 10:48:25 -08:00
William Casarin 9f447e2155 Merge macos build script #479'
kernelkind (2):
      macos packaging
      macos build script
2024-11-26 10:43:01 -08:00
William Casarin 4a9267fed1 Merge disable compose button if selected not nsec #470
kernelkind (2):
      don't try to use other accounts to post
      disable compose button if selected not nsec
2024-11-26 10:12:32 -08:00
William Casarin a147aa0961 fix fmt
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-22 13:31:43 -08:00
William Casarin 9cfae313aa Merge include commit hash in SupportView #471
kernelkind (1):
      include commit hash in SupportView
2024-11-22 13:03:34 -08:00
William Casarin c9d1b48706 Merge disable post button if draft buffer empty #469
William Casarin (2):
      ui: simply hide post button if buffer is empty

kernelkind (1):
      disable post button if draft buffer empty
2024-11-22 13:01:03 -08:00
William Casarin 4133570c2e ui: simply hide post button if buffer is empty
Fixes: 8464a1d22c ("disable post button if draft buffer empty")
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-22 12:59:38 -08:00
William Casarin e2a2db8ac2 refactor: move save_cols closer
why you so far away little guy?

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-22 11:28:33 -08:00
William Casarin 679a5afdeb nav: only save columns once
Before we would save columns for each rendered nav. Now we only do it
once.
2024-11-19 18:52:42 -08:00
William Casarin 7f234935cc refactor: unify note, post and nav actions
There was a bunch of redundant responses. Let's unify them under
the RenderNavAction enum. We unify all action processing under this
type.

This also centralizes all of our side effects into a single function
instead of scattering them everywhere
2024-11-19 18:43:09 -08:00
William Casarin d97c957e67 Merge remote-tracking branch 'pr/455' into login-first-open 2024-11-18 18:27:46 -08:00
William Casarin 63d0a622f1 onboarding: show account login route on first open
Instead of only new columns, show login route on first open.

We will also add a demo column.

Changelog-Changed: Show login column on first open
Fixes: https://github.com/damus-io/notedeck/issues/440
2024-11-18 18:22:08 -08:00
William Casarin 22e67c95cc refactor: rename AccountsManager to Accounts
plz stop with the managers
2024-11-18 18:03:57 -08:00
William Casarin 6545e1ddee thread: ensure thread unknowns are handled 2024-11-18 17:28:55 -08:00
William Casarin 19933c84f1 onboarding: lookup profile after accounts are added
To reduce the side effects of this change, we introduce a new UnknownId
action type:

  - SingleUnkIdAction

This can be returned from functions to signal that we need to do some
work to look for things. We add a `must_use` directive to this type
to ensure callers handle it.

Changelog-Fixed: Fix missing profiles when new accounts are added
Fixes: https://github.com/damus-io/notedeck/issues/356
2024-11-18 17:11:58 -08:00
William Casarin 3b3b8246c8 startup: remove panic hook
doesn't seem to be working anyways
2024-11-18 17:10:25 -08:00
William Casarin bdea3da5f0 enostr: add Deref trait for Pubkey 2024-11-18 17:10:25 -08:00
William Casarin de8029d60f fix crash when removing non-last columns
Fixes: https://github.com/damus-io/notedeck/issues/445
2024-11-17 17:12:59 -08:00
William Casarin a678e647a4 hide media on universe view
Also fixes textmode

Fixes: https://github.com/damus-io/notedeck/issues/443
2024-11-17 16:45:28 -08:00
William Casarin 33b2fa263e fix issue where columns fail to load on first failure
This fixes an issue where if one of the columns fail to load, all other
columns fail to load. This is because we are too aggressive with the
early exit on failure.

To reproduce:

$ notedeck --dbpath what

With existing columns in an existing data path.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-15 12:30:45 -08:00
William Casarin 8043d86bf2 arg: fix broken dbpath argument, add test
I broke dbpath, lets fix that and add a test so it doesn't happen again

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-15 12:30:45 -08:00
William Casarin ebfa9e4450 fix log message for relay states
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-15 10:11:04 -08:00
William Casarin 4d124c05fa remove unnecessary crash
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-15 10:11:00 -08:00
William Casarin 01bedac710 Fix filter states when adding columns
This fixes various issues with filter states when adding columns. We now
maintain multiple states per relay so that we don't lose track of
anything.

Fixes: https://github.com/damus-io/notedeck/issues/431
Fixes: https://github.com/damus-io/notedeck/issues/359
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-14 15:25:08 -08:00
William Casarin acadc4a9d9 enostr: add PoolEventBuf
to simplify lifetimes in some situations

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-14 11:43:35 -08:00
William Casarin 845f745dca remove NewTimelineSub
New timelines should be handled in the standard timeline codepaths

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-14 10:36:16 -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 4c458727a9 fix: save columns on removal
Fixes: https://github.com/damus-io/notedeck/issues/432
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 15:51:46 -08:00
William Casarin 91016facc7 Merge Persist Columns #390
Fixed a few merge conflicts

kernelkind (2):
      initial column storage
      tmp remove DeckAuthor columns
2024-11-13 13:13:55 -08:00
William Casarin 94b97d247d Merge Add External Notifications Column setting #395
kernelkind (2):
      init external notifs column
      use AcquireKeyState for AddColumn
2024-11-13 13:06:18 -08:00
William Casarin 29da910534 android: fix build
Fixes: 2f20e8253e ("app: simplify Damus::new constructor")
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 12:10:02 -08:00
William Casarin 804a7f0bf9 test: add args column test
Adding a testcase for a bug I noticed on another branch

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 10:55:14 -08:00
William Casarin 19d790fce0 timeline: add TimelineKind equality
we will be using these for tests

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 10:55:14 -08:00
William Casarin 9801a20429 storage: simplify imports
Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 10:55:14 -08:00
William Casarin d1059d9480 bin: extract logging setup into its own function
a little bit less messy

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 10:55:14 -08:00
William Casarin 2f20e8253e app: simplify Damus::new constructor
Just take an egui::Context instead of an eframe::CreationContext.
This should make it easier to test the app via egui::Context::default();

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 10:53:29 -08:00
William Casarin fab1257f6e paths: remove hardcoded basepath
Before we were hardcoding the basepath with dirs, which isn't that
useful for testing, previews, or for android. Let's fix that.

This also moves the db and cache directories into our root DataPaths.
This is a breaking change, we don't have a migration step. sorry.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 09:55:56 -08:00
William Casarin 6c9693dbf0 github: disable --all-features for now
Since some things are broken

Signed-off-by: William Casarin <jb55@jb55.com>
2024-11-13 09:55: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
William Casarin 1476be48cc Merge 'Support view, key storage'
kernelkind (5):
      file storage
      write log files to disk daily and on panic
      app window size persists on app close
      support view
      fix cmd line args bug
2024-10-28 13:30:16 -07:00
William Casarin d729823f33 Merge 'Update account_login_view.rs' #366
alltheseas (1):
      Update account_login_view.rs
2024-10-22 10:35:57 -07:00
William Casarin a2a8a9f66d cargo fmt
Signed-off-by: William Casarin <jb55@jb55.com>
2024-10-16 08:52:43 -07:00
William Casarin b803693449 Merge Profile View
Noticing a small delay when clicking on macos with large nostrdb, still
need to investigate

kernelkind (14):
      init profile routing
      add profile preview and implement scrolling
      profile unsub
      click on thread pfp
      consolidate timelineTab ui to TimelineTabView
      generify Threads
      profile struct
      integrate profile view caching
      proper timelineTabs
      revert timeline no_scroll stuff
      fix unnecessary copy every frame
      reword comments and logs thread -> NotesHolder
      rename TimelineResponse -> ColumnNoteResponse
      NoteActionResponse for note preview pfp clicking
2024-10-16 08:42:18 -07:00
William Casarin 1a490eb069 use stable toolchain
this was overriding rustup to use nightly

Signed-off-by: William Casarin <jb55@jb55.com>
2024-10-16 08:41:31 -07:00
William Casarin 54dcbd724b Merge 'column titlebar #345'
William Casarin (2):
      update to use upstream egui-nav branch

kernelkind (13):
      basic add column impl
      remote sub new timeline
      add more add column options
      animate add column options
      push column picker immediately to new column
      move get first router to Columns
      tmp use kernelkind egui-nav
      title bar
      unsubscribe timeline on deletion
      fix deck author bug & rename titles
      tmp: kernelkind/egui-nav
      updated back arrow
      tmp: kernelkind/egui-nav
2024-10-11 12:56:15 +02: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
William Casarin 6c94987a7a Merge multi-subscriber #287
kernelkind (2):
      multi subscriber impl
      implement multi_subscriber for Thread
2024-09-26 14:04:25 -07:00
William Casarin 5ddeb0e383 remove dead code in side panel
Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 13:49:51 -07:00
William Casarin 56af979c21 panel: rasterize damus logo
Image is set to double the pixel size to reduce artifacts.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-09-26 13:43:53 -07:00
William Casarin 7fe3d5e99f Merge side panel update #327
A few merge conflicts resolved, and changes the image to svg

kernelkind (7):
      initial compose note view
      change side panel width to 64.0
      Add AnimationHelper
      update sidebar to match new design
      remove app from sidebar
      remove profile_preview_controller
      add logo to side panel

Closes: https://github.com/damus-io/notedeck/pull/327
2024-09-26 13:21:11 -07:00
William Casarin 7e4bddcacb Merge hitbox improvements #319
Ken Sedgwick (6):
      debug: implemented fmt::Debug for Pubkey
      debug: implemented fmt::Debug for NoteId
      hitbox: more naming cleanup
      hitbox: extend the hitbox to the full width of the container
      hitbox: handle hits on quoted notes correctly
      hitbox: cache note size instead of rect

Closes: https://github.com/damus-io/notedeck/pull/319
2024-09-26 12:54:09 -07:00