Revert driller

This reverts commit cec49c83bd.

Revert "update NoteContentsDriller to NoteContext"

This reverts commit 65bd6a65f9.

Revert "introduce the driller"

This reverts commit 95d618e7fe.
This commit is contained in:
William Casarin
2025-03-07 12:53:04 -08:00
parent 50cf75b8bc
commit 4365839242
11 changed files with 495 additions and 352 deletions

View File

@@ -2,25 +2,29 @@ use crate::{
nav::RenderNavAction,
profile::ProfileAction,
timeline::{TimelineCache, TimelineKind},
ui::{self, note::contents::NoteContext, profile::ProfileView},
ui::{self, note::NoteOptions, profile::ProfileView},
};
use enostr::Pubkey;
use notedeck::{Accounts, MuteFun, UnknownIds};
use nostrdb::Ndb;
use notedeck::{Accounts, Images, MuteFun, NoteCache, UnknownIds};
#[allow(clippy::too_many_arguments)]
pub fn render_timeline_route(
ndb: &Ndb,
img_cache: &mut Images,
unknown_ids: &mut UnknownIds,
note_cache: &mut NoteCache,
timeline_cache: &mut TimelineCache,
accounts: &mut Accounts,
kind: &TimelineKind,
col: usize,
mut note_options: NoteOptions,
depth: usize,
ui: &mut egui::Ui,
note_context: &mut NoteContext,
) -> Option<RenderNavAction> {
if kind == &TimelineKind::Universe {
note_context.options.set_hide_media(true);
note_options.set_hide_media(true);
}
match kind {
@@ -30,9 +34,16 @@ pub fn render_timeline_route(
| TimelineKind::Universe
| TimelineKind::Hashtag(_)
| TimelineKind::Generic(_) => {
let note_action =
ui::TimelineView::new(kind, timeline_cache, &accounts.mutefun(), note_context)
.ui(ui);
let note_action = ui::TimelineView::new(
kind,
timeline_cache,
ndb,
note_cache,
img_cache,
note_options,
&accounts.mutefun(),
)
.ui(ui);
note_action.map(RenderNavAction::NoteAction)
}
@@ -42,18 +53,28 @@ pub fn render_timeline_route(
render_profile_route(
pubkey,
accounts,
ndb,
timeline_cache,
img_cache,
note_cache,
unknown_ids,
col,
ui,
&accounts.mutefun(),
note_context,
note_options,
)
} else {
// we render profiles like timelines if they are at the root
let note_action =
ui::TimelineView::new(kind, timeline_cache, &accounts.mutefun(), note_context)
.ui(ui);
let note_action = ui::TimelineView::new(
kind,
timeline_cache,
ndb,
note_cache,
img_cache,
note_options,
&accounts.mutefun(),
)
.ui(ui);
note_action.map(RenderNavAction::NoteAction)
}
@@ -61,10 +82,13 @@ pub fn render_timeline_route(
TimelineKind::Thread(id) => ui::ThreadView::new(
timeline_cache,
ndb,
note_cache,
unknown_ids,
img_cache,
id.selected_or_root(),
note_options,
&accounts.mutefun(),
note_context,
)
.id_source(egui::Id::new(("threadscroll", col)))
.ui(ui)
@@ -76,21 +100,27 @@ pub fn render_timeline_route(
pub fn render_profile_route(
pubkey: &Pubkey,
accounts: &Accounts,
ndb: &Ndb,
timeline_cache: &mut TimelineCache,
img_cache: &mut Images,
note_cache: &mut NoteCache,
unknown_ids: &mut UnknownIds,
col: usize,
ui: &mut egui::Ui,
is_muted: &MuteFun,
note_context: &mut NoteContext,
note_options: NoteOptions,
) -> Option<RenderNavAction> {
let action = ProfileView::new(
pubkey,
accounts,
col,
timeline_cache,
ndb,
note_cache,
img_cache,
unknown_ids,
is_muted,
note_context,
note_options,
)
.ui(ui);