diff --git a/crates/notedeck/src/note/action.rs b/crates/notedeck/src/note/action.rs index 026ebb47..67d907f9 100644 --- a/crates/notedeck/src/note/action.rs +++ b/crates/notedeck/src/note/action.rs @@ -24,7 +24,11 @@ pub enum NoteAction { Profile(Pubkey), /// User has clicked a note link - Note { note_id: NoteId, preview: bool }, + Note { + note_id: NoteId, + preview: bool, + scroll_offset: f32, + }, /// User has selected some context option Context(ContextSelection), @@ -44,6 +48,7 @@ impl NoteAction { NoteAction::Note { note_id: id, preview: false, + scroll_offset: 0.0, } } } diff --git a/crates/notedeck_columns/src/actionbar.rs b/crates/notedeck_columns/src/actionbar.rs index b156cada..53ff3723 100644 --- a/crates/notedeck_columns/src/actionbar.rs +++ b/crates/notedeck_columns/src/actionbar.rs @@ -81,7 +81,11 @@ fn execute_note_action( .open(ndb, note_cache, txn, pool, &kind) .map(NotesOpenResult::Timeline); } - NoteAction::Note { note_id, preview } => 'ex: { + NoteAction::Note { + note_id, + preview, + scroll_offset, + } => 'ex: { let Ok(thread_selection) = ThreadSelection::from_note_id(ndb, note_cache, txn, note_id) else { tracing::error!("No thread selection for {}?", hex::encode(note_id.bytes())); diff --git a/crates/notedeck_columns/src/ui/thread.rs b/crates/notedeck_columns/src/ui/thread.rs index faa8131b..349df7ce 100644 --- a/crates/notedeck_columns/src/ui/thread.rs +++ b/crates/notedeck_columns/src/ui/thread.rs @@ -195,6 +195,7 @@ fn strip_note_action(action: NoteAction) -> Option { NoteAction::Note { note_id: _, preview: false, + scroll_offset: _, } ) { return None; diff --git a/crates/notedeck_ui/src/note/contents.rs b/crates/notedeck_ui/src/note/contents.rs index db7f5b9b..547aed2c 100644 --- a/crates/notedeck_ui/src/note/contents.rs +++ b/crates/notedeck_ui/src/note/contents.rs @@ -363,6 +363,7 @@ fn render_undecorated_note_contents<'a>( NoteAction::Note { note_id, .. } => NoteAction::Note { note_id, preview: true, + scroll_offset: 0.0, }, other => other, })