commit 8082b729c4148c1ed64013a35059afcb9c522302
parent 9a5d7a1d34922b0510255723e819479029201879
Author: William Casarin <jb55@jb55.com>
Date: Wed, 4 Feb 2026 11:49:13 -0800
Merge remote-tracking branch 'kernel/fix-auto-hide-toolbar'
Diffstat:
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
}