add is_root_note helper

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-11-04 14:53:51 -08:00
parent 9b7ee8d8c5
commit 74f63f49ca

View File

@@ -844,6 +844,21 @@ fn zap_actionbar_button(
action
}
fn is_root_note(note: &Note) -> bool {
for tag in note.tags() {
if tag.count() < 2 {
continue;
}
// any reference to an e tag is a non-root note
if tag.get_str(0) == Some("e") {
return false;
}
}
true
}
#[profiling::function]
fn render_note_actionbar(
ui: &mut egui::Ui,