ui: move note and profile rendering to notedeck_ui

We want to render notes in other apps like dave, so lets move
our note rendering to notedeck_ui. We rework NoteAction so it doesn't
have anything specific to notedeck_columns

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-04-17 11:01:45 -07:00
parent e4bae57619
commit 8af80d7d10
53 changed files with 1436 additions and 1607 deletions

View File

@@ -1,6 +1,5 @@
use crate::{
accounts::render_accounts_route,
actionbar::NoteAction,
app::{get_active_columns_mut, get_decks_mut},
column::ColumnsAction,
deck_state::DeckState,
@@ -16,19 +15,20 @@ use crate::{
column::NavTitle,
configure_deck::ConfigureDeckView,
edit_deck::{EditDeckResponse, EditDeckView},
note::{contents::NoteContext, NewPostAction, PostAction, PostType},
note::{NewPostAction, PostAction, PostType},
profile::EditProfileView,
search::{FocusState, SearchView},
support::SupportView,
wallet::{WalletAction, WalletView},
RelayView, View,
RelayView,
},
Damus,
};
use egui_nav::{Nav, NavAction, NavResponse, NavUiType};
use nostrdb::Transaction;
use notedeck::{AccountsAction, AppContext, WalletState};
use notedeck::{AccountsAction, AppContext, NoteAction, NoteContext, WalletState};
use notedeck_ui::View;
use tracing::error;
#[allow(clippy::enum_variant_names)]
@@ -184,7 +184,8 @@ impl RenderNavResponse {
RenderNavAction::NoteAction(note_action) => {
let txn = Transaction::new(ctx.ndb).expect("txn");
note_action.execute_and_process_result(
crate::actionbar::execute_and_process_note_action(
note_action,
ctx.ndb,
get_active_columns_mut(ctx.accounts, &mut app.decks_cache),
col,