Commit Graph

158 Commits

Author SHA1 Message Date
William Casarin
e7843bad2f Merge remote-tracking branch 'github/pr/1087' into notifications 2025-08-26 09:58:50 -07:00
kernelkind
8b5464641d render follow pack by index from virtual list
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-25 21:16:05 -04:00
kernelkind
529377a706 ui: reactions closer approximation of iOS design
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-25 20:15:40 -04:00
kernelkind
4f63629715 ui: add like icon
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-25 10:31:37 -04:00
William Casarin
77ac91e810 Implement soft keyboard visibility on Android
- Added `SoftKeyboardContext` enum and support for calculating keyboard
  insets from both virtual and platform sources

- Updated `AppContext` to provide `soft_keyboard_rect` for determining
  visible keyboard area

- Adjusted UI rendering to shift content when input boxes intersect with
  the soft keyboard, preventing overlap

- Modified `MainActivity` and Android manifest to use
  `windowSoftInputMode="adjustResize"` and updated window inset handling

- Introduced helper functions (`include_input`, `input_rect`,
  `clear_input_rect`) in `notedeck_ui` for tracking focused input boxes

- Fixed Android JNI keyboard height reporting to clamp negative values

Together, these changes allow the app to correctly detect and respond
to soft keyboard visibility on Android, ensuring input fields remain
accessible when typing.

Fixes: https://github.com/damus-io/notedeck/issues/946
Fixes: https://github.com/damus-io/notedeck/issues/1043
2025-08-19 11:29:45 -07:00
William Casarin
3aa4d00053 clippy: fix lint errors
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-19 09:45:36 -07:00
kernelkind
2a439b1f30 nip 51 set widget
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-17 15:07:04 -04:00
kernelkind
ac1bbeac1b add impl for ScaledTextureFlags::RESPECT_MAX_DIMS
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-17 15:06:57 -04:00
kernelkind
dc91b6ffae extract a pub render_media from image_carousel
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-17 15:06:55 -04:00
kernelkind
28bd13d110 add flags to ScaledTexture
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-17 15:06:48 -04:00
kernelkind
b750c0a927 use toolbar in columns rather than chrome
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-13 19:20:38 -04:00
kernelkind
1469f9a074 add toolbar icons to notedeck_ui
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-13 19:07:42 -04:00
William Casarin
53b4a8da5c notedeck app: add clndash
a core-lightning dashboard i'm working on

feature-gate it behind --clndash

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-08 13:19:39 -07:00
William Casarin
87cb5ed515 Merge thread scroll fix by kernel
kernelkind (5):
      TMP: use new egui-nav to fix scroll offset issues
      add `scroll_offset` to `NoteAction::Note`
      add `ThreadNote::set_scroll_offset`
      set scroll offset when routing to thread
      appease clippy
2025-08-04 15:08:32 -07:00
William Casarin
b94e715539 ui: add AnimationMode to control GIF rendering behavior
Introduces an `AnimationMode` enum with `Reactive`, `Continuous`, and
`NoAnimation` variants to allow fine-grained control over GIF playback
across the UI. This supports performance optimizations and accessibility
features, such as disabling animations when requested.

- Plumbs AnimationMode through image rendering paths
- Replaces hardcoded gif frame logic with reusable `process_gif_frame`
- Supports customizable FPS in Continuous mode
- Enables global animation opt-out via `NoteOptions::NoAnimations`
- Applies mode-specific logic in profile pictures, posts, media carousels, and viewer

Animation behavior by context
-----------------------------

- Profile pictures: Reactive (render only on interaction/activity)
- PostView: NoAnimation if disabled in NoteOptions, else Continuous (uncapped)
- Media carousels: NoAnimation or Continuous (capped at 24fps)
- Viewer/gallery: Always Continuous (full animation)

In the future, we can customize these by power settings.

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-04 13:41:24 -07:00
kernelkind
ea5c876da6 add scroll_offset to NoteAction::Note
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-04 16:12:38 -04:00
William Casarin
0dda26791a perf: a few micro optimizations
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 20:17:16 -07:00
William Casarin
7e73ed2760 ui/note: slightly more spacing between blocks
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 20:17:16 -07:00
William Casarin
27df33dc83 ui/note: fix reply description item spacing
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 16:30:37 -07:00
William Casarin
2edc19fbcc ui/note: fix extra padding in block renderer
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 16:26:26 -07:00
William Casarin
edf0e2498b note: small doc fix
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 16:18:00 -07:00
William Casarin
ad35547582 refactor: collapse client label settings; drop CLI/settings toggles
The "top vs bottom" client label setting was cluttering the UI and
codebase with toggles that added little value. This consolidates client
label handling into one option, removes unused CLI/settings knobs, and
makes NoteView’s API consistent and fluent. Result: fewer knobs, less
branching, and a clearer, more predictable UI.

Now client labels are only shown in one place: selected notes.

- Drop `--show-client` arg in notedeck and `--show-note-client=top|bottom`
  args in notedeck_columns

- Remove `NotedeckOptions::ShowClient` and related CLI parsing

- Delete `ShowSourceClientOption` enum, settings UI, and
  `SettingsAction::SetShowSourceClient`

- Collapse `NoteOptions::{ClientNameTop, ClientNameBottom}` into a single
  `NoteOptions::ClientName`

- Add `NoteOptions::{Framed, UnreadIndicator}`

- Move “framed” and unread indicator into flags (no more ad‑hoc bools)

- Add new NoteView builder methods: `.client_name()`, `.frame()`,
  `.unread_indicator()`, and `.selected_style()`

- CLI flags for showing client labels have been removed

- `ClientNameTop`/`ClientNameBottom` replaced with `ClientName`

- API using `framed` or `show_unread_indicator` booleans must now use
  the new flag setters

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 16:16:15 -07:00
William Casarin
24f70930eb note: turn off full date view for previews
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 14:53:14 -07:00
William Casarin
391abe817d columns: clean up flags, refactor content rendering
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 14:02:05 -07:00
William Casarin
249e166a95 remove explicit loop continue
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-03 10:44:07 -07:00
Fernando López Guevara
26ece3bc05 feat(note): show full created date format on selected notes 2025-08-01 08:42:58 -03:00
Fernando López Guevara
ab84304265 feat(settings): show note full date 2025-08-01 08:38:49 -03:00
William Casarin
6a08d4b1b2 ui/note: fix width instabilities because of spacing_mut
TODO: get rid of all spacing_mut in the codebase

Fixes: 9ff5753bca ("settings: use timed serializer, handle zoom properly...")
2025-07-31 17:54:53 -07:00
William Casarin
a8c6baeacb make clippy happy 2025-07-31 11:55:39 -07:00
Fernando López Guevara
9ff5753bca settings: use timed serializer, handle zoom properly, use custom text style for note body font size, added font size slider, added preview note 2025-07-29 21:43:26 -03:00
Fernando López Guevara
b9e2fe5dd1 fix(media): add spacing 2025-07-29 21:38:04 -03:00
Fernando López Guevara
d1a9e0020e fix(note-content): avoid empty text blocks
(cherry picked from commit baa7031c25d0f3d3e8952f49f6625252413559a3)
2025-07-29 21:34:28 -03:00
Fernando López Guevara
f2153f53dc feat(settings): allow sorting thread replies newest first 2025-07-29 21:30:35 -03:00
William Casarin
0fc8e70180 ui/note: fix indented actionbar in non-wide mode
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-29 13:58:17 -07:00
William Casarin
2de6851fbd mediaviewer: decrease transition anim from 500ms to 300ms
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-29 13:45:22 -07:00
William Casarin
f57d582307 ui: keep original design on non-narrow
Changed my mind

This reverts commit 6e81b98d2f.
This reverts commit 217f1e45da.
2025-07-29 13:25:19 -07:00
William Casarin
5280028a82 media/viewer: fix broken culling
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-29 11:03:42 -07:00
William Casarin
f4a6e8f9bb media: change is_narrow logic to is_scaled
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-29 10:59:27 -07:00
William Casarin
83fd6de076 Merge remote-tracking branch 'github/pr/1032' 2025-07-29 10:46:55 -07:00
William Casarin
6e81b98d2f note/options: made wide the default
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-29 10:24:38 -07:00
William Casarin
2a85ee562c ui/note: simplify weird hack and make note of it
Fixes: https://github.com/damus-io/notedeck/issues/842
Fixes: f2e01f0e40 ("fix(note_actionbar): add invisible label to stabilize section width ¯\_(ツ)_/¯")
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-29 10:13:43 -07:00
William Casarin
1fabd347ca Merge remote-tracking branch 'github/pr/1031' 2025-07-29 10:08:43 -07:00
William Casarin
0087fe7dff media/viewer: slower animation
so you can actually see whats going on

Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-28 16:37:53 -07:00
William Casarin
51f7744149 media/viewer: fullscreen transition animations
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-28 16:12:29 -07:00
William Casarin
6d393c9c37 media/viewer: provide image-click provenance
We will be using this for transitions

Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-28 14:19:03 -07:00
William Casarin
590ffa0680 media/viewer: click anywhere to close
this should help mobile ...

Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-28 12:10:00 -07:00
William Casarin
3d18db8fd2 Fullscreen MediaViewer refactor
- Moved media related logic into notedeck instead of the ui crate,
  since they pertain to Images/ImageCache based systems

- Made RenderableMedia owned to make it less of a nightmware
  to work with and the perf should be negligible

- Added a ImageMetadata cache to Images. This is referenced
  whenever we encounter an image so we don't have to
  redo the work all of the time

- Relpaced our ad-hoc, hand(vibe?)-coded panning and zoom logic
  with the Scene widget, which is explicitly designed for
  this use case

- Extracted and detangle fullscreen media rendering from inside of note
  rendering.  We instead let the application decide what action they
  want to perform when note media is clicked on.

- We add an on_view_media action to MediaAction for the application to
  handle. The Columns app uses this toggle a FullscreenMedia app
  option bits whenever we get a MediaAction::ViewMedis(urls).

Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-28 08:57:57 -07:00
Fernando López Guevara
661acb3a12 fix(media): use ScaledTexture 2025-07-25 16:35:22 -03:00
Fernando López Guevara
8306003f6f fix(media): edge-to-edge image display on narrow screen 2025-07-25 16:17:45 -03:00
William Casarin
96ab4ee681 ui/note: fix another reply_desc wrapping issue
Fixes: https://github.com/damus-io/notedeck/issues/892
Changelog-Fixed: Fix another wrapping issue
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-25 12:12:25 -07:00