Commit Graph

166 Commits

Author SHA1 Message Date
William Casarin
155278dd3f Merge perf updates and fixes from kerenl
from remote-tracking branches:
  * kernel/fix-soft-keyboard
  * kernel/composite-profiles-perf
  * kernel/fix-nav-flicker

kernelkind (8):
      Revert "fix: nav drawer shadow extends all the way vertically"
      chore(profiling): markup composite render path
      chore(tracy): repaint every frame
      feat(composite-cluster): do culling for pfps
      feat(mime-cache): upgrade UrlMimes
      feat(reactions): use ProfileKey when possible for performance
      fix(nav-drawer): shadow extends all the way vertically
      fix(thread): remove flicker on opening thread
2025-10-27 10:27:07 -07:00
kernelkind
9ccbaf2db8 chore(tracy): repaint every frame
since we stop rendering when there is no user input, tracy sees
big hangs, and it's annoying to parse through which frames are
actual performance issues and which are due to no user input.

So just repaint every frame while using tracy.

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-24 11:42:03 -04:00
kernelkind
db9005e403 fix(nav-drawer): shadow extends all the way vertically
df5cf8a1fc caused a regression
making the soft keyboard auto close. This patch extends the shadow
all the way vertically without triggering the regression

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-22 16:40:54 -04:00
kernelkind
dbba2a5271 Revert "fix: nav drawer shadow extends all the way vertically"
This reverts commit df5cf8a1fc.
2025-10-22 16:36:18 -04:00
kernelkind
fdaec37212 chrome: ui polish
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:54 -04:00
kernelkind
ba83976166 refactor: rename assets
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-17 01:04:48 -04:00
kernelkind
2ce5fb007a drawer: only use drag on mobile
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-16 21:22:25 -04:00
kernelkind
df5cf8a1fc fix: nav drawer shadow extends all the way vertically
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-16 21:22:23 -04:00
kernelkind
810b4c1990 profiling: add more profile markup
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-02 16:19:04 -04:00
William Casarin
3a8d06cb82 Merge tracy profiling by kernel
kernelkind (1):
      add tracy support
2025-10-02 12:33:36 -07:00
kernelkind
f59ec017c9 chrome: readd click to toggle nav drawer
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-01 21:47:47 -04:00
kernelkind
9ff12cc11a render chrome nav drawer
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-01 21:47:45 -04:00
kernelkind
65b7cfec94 cargo: expose egui-nav to chrome
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-01 21:47:42 -04:00
kernelkind
3540290f0a make update return AppResponse instead of Option<AppAction>
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-10-01 21:47:31 -04:00
kernelkind
0717353717 add tracy support
android: `make android-tracy`
desktop: `cargo run --release --features tracy`

connect via `127.0.0.1:8086`
if using android then want to use desktop, unset the adb port
forwarding:
`adb forward --remove tcp:8086`

Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-09-30 19:54:19 -04:00
Fernando López Guevara
6ee2b28e70 media: handle upload on android 2025-08-26 17:10:38 -07:00
William Casarin
f243adc855 chrome: remove dev log
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-26 14:40:14 -07:00
William Casarin
c2f012ff75 debug: fix memory debug builds
Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-26 09:53:37 -07:00
kernelkind
2973a0c6c5 appease clippy
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-25 10:31:42 -04:00
William Casarin
ccc188c0ae chrome: greatly improve soft-keyboard visibility & layout handling
This reworks how we detect and respond to the on-screen keyboard so inputs
don’t get buried and the UI doesn’t “jump”.

- Add SoftKeyboardAnim + AnimState FSM for smooth IME open/close animation
- Centralize logic in keyboard_visibility() with clear edge states
- Animate keyboard height via animate_value_with_time instead of layer
  transforms
- Add ChromeOptions::KeyboardVisibility flag when focused input would be
  occluded
- Add SidebarOptions::Compact to collapse sidebar while typing
- Hide mobile toolbar when keyboard is open (columns app)
- Use .stick_to_bottom(true) in reply + profile editors; remove old spacer hack
- Virtual keyboard toggle moved to F1 in Debug builds
- Introduce SoftKeyboardContext::platform(ctx) helper
- Cleanup dead/commented code and wire up soft_kb_anim_state in Chrome

Result: inputs stay visible, open/close is smooth, and UI adjusts gracefully
when typing.

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-20 15:28:28 -07: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
kernelkind
b750c0a927 use toolbar in columns rather than chrome
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-08-13 19:20:38 -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
cb72592f4b android: fix dark/light mode and folding screen crash
We have to tell android not to restart the activity when a dark/light
mode is switched or when the phone is folded/unfolded. Otherwise
it will crash.

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-07 16:27:29 -07:00
William Casarin
c60e1af3eb chrome: add virtual keyboard ui 2025-08-06 19:00:30 -07:00
William Casarin
9cbba37507 debug: add repaint causes debug tool
enable with --debug, click on fps/frame time counter

Signed-off-by: William Casarin <jb55@jb55.com>
2025-08-04 15:04:38 -07: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
d6d7e4c35e android: fix build
Fixes: dac786e60f ("chrome: remove duplication in app setup")
2025-07-31 17:29:06 -07:00
William Casarin
c3499729f2 Merge notification dot by kernel
kernelkind (6):
      extract notifications filter to own method
      add `NotesFreshness` to `TimelineTab`
      set fresh from `TimelineCache`
      chrome: method to find whether there are unseen notifications
      paint unseen indicator
      use unseen notification indicator

Changelog-Added: Add notification dot on toolbar
2025-07-31 17:18:20 -07:00
William Casarin
dac786e60f chrome: remove duplication in app setup
Also move debug warning to chrome so that headless
notedeck apps don't hit that.
2025-07-31 17:07:51 -07:00
kernelkind
41aa2db3c7 use unseen notification indicator
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-07-31 19:08:08 -04:00
kernelkind
10225158e5 paint unseen indicator
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-07-31 19:07:36 -04:00
kernelkind
557608db9b chrome: method to find whether there are unseen notifications
Signed-off-by: kernelkind <kernelkind@gmail.com>
2025-07-31 19:07:35 -04:00
William Casarin
b1a5dd6cab add NotedeckOptions and feature flags, add notebook feature
This switches from bools to flags in our Args struct. We also add
notebook as an optional feature flag (--notebook) since its not ready.
2025-07-31 16:03:13 -07:00
William Casarin
1ab4eeb48c init notebook
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-31 15:07:50 -07:00
William Casarin
a896a6ecfa Merge remote-tracking branch 'fernando/feat/persist_settings' 2025-07-31 11:48:57 -07:00
Fernando López Guevara
f282363748 feat(notedeck): add cross-platform URI opener 2025-07-30 16:27:51 -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
be720c0f76 fix(settings): use localization 2025-07-29 21:21:06 -03:00
Fernando López Guevara
b8207106d7 feat(settings): persist settings to storage 2025-07-29 11:41:06 -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
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
William Casarin
1a3112d8ef Merge remote-tracking branch 'github/pr/1027' 2025-07-24 12:29:11 -07:00
William Casarin
db6103d448 router: fix router selection
Many times we get the router selection wrong. This fixes that

Changelog-Fixed: Fix some routing issues when routing from the Chrome
Fixes: https://github.com/damus-io/notedeck/issues/1024
Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-24 12:11:19 -07:00
Jakub Gladysz
bd9a78b305 Do not crash on unknown arg
Signed-off-by: Jakub Gladysz <jakub.gladysz@protonmail.com>
2025-07-24 11:02:43 +03:00
William Casarin
fe30704496 Merge remote-tracking branch 'fernando/feat/settings-view' 2025-07-23 12:00:29 -07:00
Fernando López Guevara
da6ede5f69 feat(settings): add settings view 2025-07-23 15:33:17 -03:00
William Casarin
f722a58d66 Merge new Accounts button to chrome sidebar by kernel #994
kernelkind (3):
      use saturating sub
      add new Accounts button to chrome sidebar
      add ChromePanelAction::Profile & use for pfp
2025-07-23 09:13:49 -07:00
William Casarin
3d4db820b4 i18n: make localization context non-global
- Simplify Localization{Context,Manager} to just Localization
- Fixed a bunch of lifetime issueo
- Removed all Arcs and Locks
- Removed globals
  * widgets now need access to &mut Localization for i18n

Signed-off-by: William Casarin <jb55@jb55.com>
2025-07-22 09:49:32 -07:00
Terry Yiu
3f5036bd32 Internationalize user-facing strings and export them for translations
Changelog-Added: Internationalized user-facing strings and exported them for translations
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-07-21 12:45:29 -07:00