columns/timeline: include column index in timeline view_id

might fix weird scroll issues on profiles

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-07-15 13:02:05 -07:00
parent 119456e2b3
commit 074472eec9
3 changed files with 12 additions and 5 deletions

View File

@@ -247,12 +247,12 @@ impl Timeline {
) )
} }
pub fn make_view_id(id: &TimelineKind, selected_view: usize) -> egui::Id { pub fn make_view_id(id: &TimelineKind, col: usize, selected_view: usize) -> egui::Id {
egui::Id::new((id, selected_view)) egui::Id::new((id, selected_view, col))
} }
pub fn view_id(&self) -> egui::Id { pub fn view_id(&self, col: usize) -> egui::Id {
Timeline::make_view_id(&self.kind, self.selected_view) Timeline::make_view_id(&self.kind, col, self.selected_view)
} }
pub fn new(kind: TimelineKind, filter_state: FilterState, views: Vec<TimelineTab>) -> Self { pub fn new(kind: TimelineKind, filter_state: FilterState, views: Vec<TimelineTab>) -> Self {

View File

@@ -37,6 +37,7 @@ pub fn render_timeline_route(
note_options, note_options,
&(&accounts.get_selected_account().key).into(), &(&accounts.get_selected_account().key).into(),
jobs, jobs,
col,
) )
.ui(ui); .ui(ui);
@@ -66,6 +67,7 @@ pub fn render_timeline_route(
note_options, note_options,
&(&accounts.get_selected_account().key).into(), &(&accounts.get_selected_account().key).into(),
jobs, jobs,
col,
) )
.ui(ui); .ui(ui);

View File

@@ -24,6 +24,7 @@ pub struct TimelineView<'a, 'd> {
note_context: &'a mut NoteContext<'d>, note_context: &'a mut NoteContext<'d>,
cur_acc: &'a KeypairUnowned<'a>, cur_acc: &'a KeypairUnowned<'a>,
jobs: &'a mut JobsCache, jobs: &'a mut JobsCache,
col: usize,
} }
impl<'a, 'd> TimelineView<'a, 'd> { impl<'a, 'd> TimelineView<'a, 'd> {
@@ -36,6 +37,7 @@ impl<'a, 'd> TimelineView<'a, 'd> {
note_options: NoteOptions, note_options: NoteOptions,
cur_acc: &'a KeypairUnowned<'a>, cur_acc: &'a KeypairUnowned<'a>,
jobs: &'a mut JobsCache, jobs: &'a mut JobsCache,
col: usize,
) -> Self { ) -> Self {
let reverse = false; let reverse = false;
TimelineView { TimelineView {
@@ -47,6 +49,7 @@ impl<'a, 'd> TimelineView<'a, 'd> {
note_context, note_context,
cur_acc, cur_acc,
jobs, jobs,
col,
} }
} }
@@ -61,6 +64,7 @@ impl<'a, 'd> TimelineView<'a, 'd> {
self.note_context, self.note_context,
self.cur_acc, self.cur_acc,
self.jobs, self.jobs,
self.col,
) )
} }
@@ -81,6 +85,7 @@ fn timeline_ui(
note_context: &mut NoteContext, note_context: &mut NoteContext,
cur_acc: &KeypairUnowned, cur_acc: &KeypairUnowned,
jobs: &mut JobsCache, jobs: &mut JobsCache,
col: usize,
) -> Option<NoteAction> { ) -> Option<NoteAction> {
//padding(4.0, ui, |ui| ui.heading("Notifications")); //padding(4.0, ui, |ui| ui.heading("Notifications"));
/* /*
@@ -104,7 +109,7 @@ fn timeline_ui(
// need this for some reason?? // need this for some reason??
ui.add_space(3.0); ui.add_space(3.0);
egui::Id::new(("tlscroll", timeline.view_id())) egui::Id::new(("tlscroll", timeline.view_id(col)))
}; };
let show_top_button_id = ui.id().with((scroll_id, "at_top")); let show_top_button_id = ui.id().with((scroll_id, "at_top"));