notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit f0721baba363e71f2a8bab9d8d309f37339c6ae9
parent 015d502b981d93330d93f39c3f709b2a451ebcf8
Author: kernelkind <kernelkind@gmail.com>
Date:   Sat, 31 Jan 2026 18:24:20 -0500

fix(toolbar): always display toolbar at small scroll height

there was an issue where it was nearly impossible to activate the
toolbar if the scroll height was very small.

the "fix" was to disable auto hide if the scrollable distance is
less than the viewable content height. This is a pretty arbitrary
choice, but it sounds reasonable to me.

Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Mcrates/notedeck/src/note/action.rs | 2++
Mcrates/notedeck_columns/src/actionbar.rs | 7++++++-
Mcrates/notedeck_columns/src/ui/timeline.rs | 7++++++-
3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/crates/notedeck/src/note/action.rs b/crates/notedeck/src/note/action.rs @@ -7,6 +7,8 @@ use enostr::{NoteId, Pubkey}; pub struct ScrollInfo { pub velocity: Vec2, pub offset: Vec2, + pub full_content_size: Vec2, + pub viewable_content_rect: egui::Rect, } #[derive(Debug)] diff --git a/crates/notedeck_columns/src/actionbar.rs b/crates/notedeck_columns/src/actionbar.rs @@ -75,9 +75,14 @@ fn execute_note_action( let toolbar_visible_id = egui::Id::new("toolbar_visible"); let velocity_threshold = 50.0; // pixels per second + let viewable_content_height = scroll_info.viewable_content_rect.height(); + let scrollable_distance = scroll_info.full_content_size.y - viewable_content_height; + // velocity.y > 0 means scrolling up (content moving down) - show toolbar // velocity.y < 0 means scrolling down (content moving up) - hide toolbar - if scroll_info.velocity.y > velocity_threshold { + if scroll_info.velocity.y > velocity_threshold + || scrollable_distance < viewable_content_height + { ui.ctx() .data_mut(|d| d.insert_temp(toolbar_visible_id, true)); } else if scroll_info.velocity.y < -velocity_threshold { diff --git a/crates/notedeck_columns/src/ui/timeline.rs b/crates/notedeck_columns/src/ui/timeline.rs @@ -205,7 +205,12 @@ fn timeline_ui( let velocity = scroll_output.state.velocity(); let offset = scroll_output.state.offset; if velocity.length_sq() > 0.0 { - Some(NoteAction::Scroll(ScrollInfo { velocity, offset })) + Some(NoteAction::Scroll(ScrollInfo { + velocity, + offset, + full_content_size: scroll_output.content_size, + viewable_content_rect: scroll_output.inner_rect, + })) } else { None }