dave: bubble note actions to chrome

This allows chrome to pass note actions to other apps
This commit is contained in:
William Casarin
2025-04-22 18:42:12 -07:00
parent 4cedea9fdb
commit e8a1233174
15 changed files with 227 additions and 59 deletions

View File

@@ -3,7 +3,8 @@ use crate::wallet::GlobalWallet;
use crate::zaps::Zaps;
use crate::{
frame_history::FrameHistory, AccountStorage, Accounts, AppContext, Args, DataPath,
DataPathType, Directory, Images, NoteCache, RelayDebugView, ThemeHandler, UnknownIds,
DataPathType, Directory, Images, NoteAction, NoteCache, RelayDebugView, ThemeHandler,
UnknownIds,
};
use egui::ThemePreference;
use egui_winit::clipboard::Clipboard;
@@ -15,8 +16,12 @@ use std::path::Path;
use std::rc::Rc;
use tracing::{error, info};
pub enum AppAction {
Note(NoteAction),
}
pub trait App {
fn update(&mut self, ctx: &mut AppContext<'_>, ui: &mut egui::Ui);
fn update(&mut self, ctx: &mut AppContext<'_>, ui: &mut egui::Ui) -> Option<AppAction>;
}
/// Main notedeck app framework

View File

@@ -33,7 +33,7 @@ mod wallet;
mod zaps;
pub use accounts::{AccountData, Accounts, AccountsAction, AddAccountAction, SwitchAccountAction};
pub use app::{App, Notedeck};
pub use app::{App, AppAction, Notedeck};
pub use args::Args;
pub use context::AppContext;
pub use error::{Error, FilterError, ZapError};