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

@@ -16,7 +16,7 @@ use crate::{
column::NavTitle,
configure_deck::ConfigureDeckView,
edit_deck::{EditDeckResponse, EditDeckView},
note::{contents::NoteContext, PostAction, PostType},
note::{PostAction, PostType},
profile::EditProfileView,
support::SupportView,
RelayView, View,
@@ -243,22 +243,19 @@ fn render_nav_body(
col: usize,
inner_rect: egui::Rect,
) -> Option<RenderNavAction> {
let mut note_context = NoteContext {
ndb: ctx.ndb,
img_cache: ctx.img_cache,
note_cache: ctx.note_cache,
options: app.note_options,
};
match top {
Route::Timeline(kind) => render_timeline_route(
ctx.ndb,
ctx.img_cache,
ctx.unknown_ids,
ctx.note_cache,
&mut app.timeline_cache,
ctx.accounts,
kind,
col,
app.note_options,
depth,
ui,
&mut note_context,
),
Route::Accounts(amr) => {
let mut action = render_accounts_route(
@@ -305,9 +302,18 @@ fn render_nav_body(
let draft = app.drafts.reply_mut(note.id());
let response = egui::ScrollArea::vertical().show(ui, |ui| {
ui::PostReplyView::new(&mut note_context, poster, draft, &note, inner_rect)
.id_source(id)
.show(ui)
ui::PostReplyView::new(
ctx.ndb,
poster,
draft,
ctx.note_cache,
ctx.img_cache,
&note,
inner_rect,
app.note_options,
)
.id_source(id)
.show(ui)
});
response.inner.action
@@ -333,11 +339,14 @@ fn render_nav_body(
let response = egui::ScrollArea::vertical().show(ui, |ui| {
crate::ui::note::QuoteRepostView::new(
&mut note_context,
ctx.ndb,
poster,
ctx.note_cache,
ctx.img_cache,
draft,
&note,
inner_rect,
app.note_options,
)
.id_source(id)
.show(ui)
@@ -351,9 +360,17 @@ fn render_nav_body(
let draft = app.drafts.compose_mut();
let txn = Transaction::new(ctx.ndb).expect("txn");
let post_response =
ui::PostView::new(&mut note_context, draft, PostType::New, kp, inner_rect)
.ui(&txn, ui);
let post_response = ui::PostView::new(
ctx.ndb,
draft,
PostType::New,
ctx.img_cache,
ctx.note_cache,
kp,
inner_rect,
app.note_options,
)
.ui(&txn, ui);
post_response.action.map(Into::into)
}