notedeck

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

commit a7f5319fdeab57b8cc95e34b1b3bb827187de324
parent 397bfce8173caa7226551ad80988a26da896ec8d
Author: kernelkind <kernelkind@gmail.com>
Date:   Mon, 14 Jul 2025 21:00:06 -0400

remove `MuteFun` prop

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

Diffstat:
Mcrates/notedeck_columns/src/nav.rs | 1-
Mcrates/notedeck_columns/src/timeline/route.rs | 30+++++++-----------------------
Mcrates/notedeck_columns/src/ui/profile/mod.rs | 8++------
Mcrates/notedeck_columns/src/ui/search/mod.rs | 6+-----
Mcrates/notedeck_columns/src/ui/thread.rs | 9+++------
Mcrates/notedeck_columns/src/ui/timeline.rs | 13++-----------
6 files changed, 15 insertions(+), 52 deletions(-)

diff --git a/crates/notedeck_columns/src/nav.rs b/crates/notedeck_columns/src/nav.rs @@ -598,7 +598,6 @@ fn render_nav_body( SearchView::new( &txn, - &ctx.accounts.mutefun(), app.note_options, search_buffer, &mut note_context, diff --git a/crates/notedeck_columns/src/timeline/route.rs b/crates/notedeck_columns/src/timeline/route.rs @@ -6,7 +6,7 @@ use crate::{ }; use enostr::Pubkey; -use notedeck::{MuteFun, NoteContext}; +use notedeck::NoteContext; use notedeck_ui::{jobs::JobsCache, NoteOptions}; #[allow(clippy::too_many_arguments)] @@ -28,15 +28,9 @@ pub fn render_timeline_route( | TimelineKind::Universe | TimelineKind::Hashtag(_) | TimelineKind::Generic(_) => { - let note_action = ui::TimelineView::new( - kind, - timeline_cache, - &note_context.accounts.mutefun(), - note_context, - note_options, - jobs, - ) - .ui(ui); + let note_action = + ui::TimelineView::new(kind, timeline_cache, note_context, note_options, jobs) + .ui(ui); note_action.map(RenderNavAction::NoteAction) } @@ -48,22 +42,15 @@ pub fn render_timeline_route( timeline_cache, col, ui, - &note_context.accounts.mutefun(), note_options, note_context, jobs, ) } else { // we render profiles like timelines if they are at the root - let note_action = ui::TimelineView::new( - kind, - timeline_cache, - &note_context.accounts.mutefun(), - note_context, - note_options, - jobs, - ) - .ui(ui); + let note_action = + ui::TimelineView::new(kind, timeline_cache, note_context, note_options, jobs) + .ui(ui); note_action.map(RenderNavAction::NoteAction) } @@ -89,7 +76,6 @@ pub fn render_thread_route( threads, selection.selected_or_root(), note_options, - &note_context.accounts.mutefun(), note_context, jobs, ) @@ -104,7 +90,6 @@ pub fn render_profile_route( timeline_cache: &mut TimelineCache, col: usize, ui: &mut egui::Ui, - is_muted: &MuteFun, note_options: NoteOptions, note_context: &mut NoteContext, jobs: &mut JobsCache, @@ -114,7 +99,6 @@ pub fn render_profile_route( col, timeline_cache, note_options, - is_muted, note_context, jobs, ) diff --git a/crates/notedeck_columns/src/ui/profile/mod.rs b/crates/notedeck_columns/src/ui/profile/mod.rs @@ -12,8 +12,8 @@ use crate::{ ui::timeline::{tabs_ui, TimelineTabView}, }; use notedeck::{ - name::get_display_name, profile::get_profile_url, IsFollowing, MuteFun, NoteAction, - NoteContext, NotedeckTextStyle, + name::get_display_name, profile::get_profile_url, IsFollowing, NoteAction, NoteContext, + NotedeckTextStyle, }; use notedeck_ui::{ app_images, @@ -27,7 +27,6 @@ pub struct ProfileView<'a, 'd> { col_id: usize, timeline_cache: &'a mut TimelineCache, note_options: NoteOptions, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, } @@ -46,7 +45,6 @@ impl<'a, 'd> ProfileView<'a, 'd> { col_id: usize, timeline_cache: &'a mut TimelineCache, note_options: NoteOptions, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, ) -> Self { @@ -55,7 +53,6 @@ impl<'a, 'd> ProfileView<'a, 'd> { col_id, timeline_cache, note_options, - is_muted, note_context, jobs, } @@ -113,7 +110,6 @@ impl<'a, 'd> ProfileView<'a, 'd> { reversed, self.note_options, &txn, - self.is_muted, self.note_context, self.jobs, ) diff --git a/crates/notedeck_columns/src/ui/search/mod.rs b/crates/notedeck_columns/src/ui/search/mod.rs @@ -5,7 +5,7 @@ use state::TypingType; use crate::{timeline::TimelineTab, ui::timeline::TimelineTabView}; use egui_winit::clipboard::Clipboard; use nostrdb::{Filter, Ndb, Transaction}; -use notedeck::{MuteFun, NoteAction, NoteContext, NoteRef}; +use notedeck::{NoteAction, NoteContext, NoteRef}; use notedeck_ui::{ context_menu::{input_context, PasteBehavior}, icons::search_icon, @@ -25,7 +25,6 @@ pub struct SearchView<'a, 'd> { query: &'a mut SearchQueryState, note_options: NoteOptions, txn: &'a Transaction, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, } @@ -33,7 +32,6 @@ pub struct SearchView<'a, 'd> { impl<'a, 'd> SearchView<'a, 'd> { pub fn new( txn: &'a Transaction, - is_muted: &'a MuteFun, note_options: NoteOptions, query: &'a mut SearchQueryState, note_context: &'a mut NoteContext<'d>, @@ -41,7 +39,6 @@ impl<'a, 'd> SearchView<'a, 'd> { ) -> Self { Self { txn, - is_muted, query, note_options, note_context, @@ -152,7 +149,6 @@ impl<'a, 'd> SearchView<'a, 'd> { reversed, self.note_options, self.txn, - self.is_muted, self.note_context, self.jobs, ) diff --git a/crates/notedeck_columns/src/ui/thread.rs b/crates/notedeck_columns/src/ui/thread.rs @@ -2,7 +2,7 @@ use egui::InnerResponse; use egui_virtual_list::VirtualList; use nostrdb::{Note, Transaction}; use notedeck::note::root_note_id_from_selected_id; -use notedeck::{MuteFun, NoteAction, NoteContext}; +use notedeck::{NoteAction, NoteContext}; use notedeck_ui::jobs::JobsCache; use notedeck_ui::note::NoteResponse; use notedeck_ui::{NoteOptions, NoteView}; @@ -15,7 +15,6 @@ pub struct ThreadView<'a, 'd> { note_options: NoteOptions, col: usize, id_source: egui::Id, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, } @@ -26,7 +25,6 @@ impl<'a, 'd> ThreadView<'a, 'd> { threads: &'a mut Threads, selected_note_id: &'a [u8; 32], note_options: NoteOptions, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, ) -> Self { @@ -36,7 +34,6 @@ impl<'a, 'd> ThreadView<'a, 'd> { selected_note_id, note_options, id_source, - is_muted, note_context, jobs, col: 0, @@ -138,7 +135,6 @@ impl<'a, 'd> ThreadView<'a, 'd> { self.note_options, self.jobs, txn, - self.is_muted, ) } } @@ -152,7 +148,6 @@ fn show_notes( flags: NoteOptions, jobs: &mut JobsCache, txn: &Transaction, - is_muted: &MuteFun, ) -> Option<NoteAction> { let mut action = None; @@ -162,6 +157,8 @@ fn show_notes( let selected_note_index = thread_notes.selected_index; let notes = &thread_notes.notes; + let is_muted = note_context.accounts.mutefun(); + list.ui_custom_layout(ui, notes.len(), |ui, cur_index| { let note = &notes[cur_index]; diff --git a/crates/notedeck_columns/src/ui/timeline.rs b/crates/notedeck_columns/src/ui/timeline.rs @@ -8,7 +8,7 @@ use std::f32::consts::PI; use tracing::{error, warn}; use crate::timeline::{TimelineCache, TimelineKind, TimelineTab, ViewFilter}; -use notedeck::{note::root_note_id_from_selected_id, MuteFun, NoteAction, NoteContext, ScrollInfo}; +use notedeck::{note::root_note_id_from_selected_id, NoteAction, NoteContext, ScrollInfo}; use notedeck_ui::{ anim::{AnimationHelper, ICON_EXPANSION_MULTIPLE}, show_pointer, NoteOptions, NoteView, @@ -19,7 +19,6 @@ pub struct TimelineView<'a, 'd> { timeline_cache: &'a mut TimelineCache, note_options: NoteOptions, reverse: bool, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, } @@ -29,7 +28,6 @@ impl<'a, 'd> TimelineView<'a, 'd> { pub fn new( timeline_id: &'a TimelineKind, timeline_cache: &'a mut TimelineCache, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, note_options: NoteOptions, jobs: &'a mut JobsCache, @@ -40,7 +38,6 @@ impl<'a, 'd> TimelineView<'a, 'd> { timeline_cache, note_options, reverse, - is_muted, note_context, jobs, } @@ -53,7 +50,6 @@ impl<'a, 'd> TimelineView<'a, 'd> { self.timeline_cache, self.reverse, self.note_options, - self.is_muted, self.note_context, self.jobs, ) @@ -72,7 +68,6 @@ fn timeline_ui( timeline_cache: &mut TimelineCache, reversed: bool, note_options: NoteOptions, - is_muted: &MuteFun, note_context: &mut NoteContext, jobs: &mut JobsCache, ) -> Option<NoteAction> { @@ -161,7 +156,6 @@ fn timeline_ui( reversed, note_options, &txn, - is_muted, note_context, jobs, ) @@ -345,7 +339,6 @@ pub struct TimelineTabView<'a, 'd> { reversed: bool, note_options: NoteOptions, txn: &'a Transaction, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, } @@ -357,7 +350,6 @@ impl<'a, 'd> TimelineTabView<'a, 'd> { reversed: bool, note_options: NoteOptions, txn: &'a Transaction, - is_muted: &'a MuteFun, note_context: &'a mut NoteContext<'d>, jobs: &'a mut JobsCache, ) -> Self { @@ -366,7 +358,6 @@ impl<'a, 'd> TimelineTabView<'a, 'd> { reversed, note_options, txn, - is_muted, note_context, jobs, } @@ -376,7 +367,7 @@ impl<'a, 'd> TimelineTabView<'a, 'd> { let mut action: Option<NoteAction> = None; let len = self.tab.notes.len(); - let is_muted = self.is_muted; + let is_muted = self.note_context.accounts.mutefun(); self.tab .list