Flexible routing

Another massive refactor to change the way routing works. Now any
column can route anywhere.

Also things are generally just much better and more modular via the
new struct split borrowing technique.

I didn't even try to split this into smaller commits for my sanity.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin committed 2024-09-16 14:50:20 -07:00
1 parent b4a8cddc48
commit 36c0971fd9
27 files changed
+973 -963

No files matched your search

+6 -4
View File
@@ -17,6 +17,7 @@ use crate::{
ui::View,
};
use egui::{Label, RichText, Sense};
use enostr::NoteId;
use nostrdb::{Ndb, Note, NoteKey, NoteReply, Transaction};
pub struct NoteView<'a> {
@@ -393,7 +394,7 @@ impl<'a> NoteView<'a> {
));
if self.options().has_actionbar() {
note_action = render_note_actionbar(ui, note_key).inner;
note_action = render_note_actionbar(ui, self.note.id(), note_key).inner;
}
resp
@@ -430,7 +431,7 @@ impl<'a> NoteView<'a> {
));
if self.options().has_actionbar() {
note_action = render_note_actionbar(ui, note_key).inner;
note_action = render_note_actionbar(ui, self.note.id(), note_key).inner;
}
});
})
@@ -446,6 +447,7 @@ impl<'a> NoteView<'a> {
fn render_note_actionbar(
ui: &mut egui::Ui,
note_id: &[u8; 32],
note_key: NoteKey,
) -> egui::InnerResponse<Option<BarAction>> {
ui.horizontal(|ui| {
@@ -453,9 +455,9 @@ fn render_note_actionbar(
let thread_resp = thread_button(ui, note_key);
if reply_resp.clicked() {
Some(BarAction::Reply)
Some(BarAction::Reply(NoteId::new(*note_id)))
} else if thread_resp.clicked() {
Some(BarAction::OpenThread)
Some(BarAction::OpenThread(NoteId::new(*note_id)))
} else {
None
}