NoteActionResponse for note preview pfp clicking

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-10-15 13:21:39 -04:00
parent 2d7da83872
commit eedb4e1297
3 changed files with 43 additions and 54 deletions

View File

@@ -1,15 +1,13 @@
use crate::actionbar::NoteActionResponse;
use crate::actionbar::{BarAction, NoteActionResponse};
use crate::timeline::TimelineTab;
use crate::{
actionbar::BarAction, column::Columns, imgcache::ImageCache, notecache::NoteCache,
timeline::TimelineId, ui,
column::Columns, imgcache::ImageCache, notecache::NoteCache, timeline::TimelineId, ui,
};
use egui::containers::scroll_area::ScrollBarVisibility;
use egui::{Direction, Layout};
use egui_tabs::TabColor;
use enostr::Pubkey;
use nostrdb::{Ndb, Transaction};
use tracing::{debug, error, info, warn};
use tracing::{error, warn};
pub struct TimelineView<'a> {
timeline_id: TimelineId,
@@ -277,20 +275,12 @@ impl<'a> TimelineTabView<'a> {
.options_button(true)
.show(ui);
if let Some(ba) = resp.action {
bar_action = Some(ba);
} else if resp.response.clicked() {
debug!("clicked note");
}
bar_action = bar_action.or(resp.action.bar_action);
open_profile = open_profile.or(resp.action.open_profile);
if let Some(context) = resp.context_selection {
context.process(ui, &note);
}
if resp.clicked_profile {
info!("clicked profile");
open_profile = Some(Pubkey::new(*note.pubkey()))
}
});
ui::hline(ui);