various: markdown improvements

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I81fda8247814da19eed1e76dbe97bd5b6a6a6964
This commit is contained in:
raf 2026-02-05 15:39:05 +03:00
commit 80a8b5c7ca
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
23 changed files with 3458 additions and 30 deletions

View file

@ -1,5 +1,6 @@
use dioxus::prelude::*;
use super::backlinks_panel::{BacklinksPanel, OutgoingLinksPanel};
use super::image_viewer::ImageViewer;
use super::markdown_viewer::MarkdownViewer;
use super::media_player::{MediaPlayer, PlayQueue, QueueItem, QueuePanel};
@ -23,6 +24,7 @@ pub fn Detail(
on_set_custom_field: EventHandler<(String, String, String, String)>,
on_delete_custom_field: EventHandler<(String, String)>,
on_delete: EventHandler<String>,
#[props(default)] on_navigate_to_media: Option<EventHandler<String>>,
#[props(default)] on_queue_select: Option<EventHandler<usize>>,
#[props(default)] on_queue_remove: Option<EventHandler<usize>>,
#[props(default)] on_queue_clear: Option<EventHandler<()>>,
@ -751,6 +753,43 @@ pub fn Detail(
}
}
// Backlinks and outgoing links panels for markdown/text files
if category == "text" {
{
let client_for_backlinks = client.clone();
let client_for_outgoing = client.clone();
let media_id_for_backlinks = id.clone();
let media_id_for_outgoing = id.clone();
let nav_handler = on_navigate_to_media;
rsx! {
BacklinksPanel {
media_id: media_id_for_backlinks,
client: client_for_backlinks,
on_navigate: {
let handler = nav_handler;
move |target_id: String| {
if let Some(ref h) = handler {
h.call(target_id);
}
}
},
}
OutgoingLinksPanel {
media_id: media_id_for_outgoing,
client: client_for_outgoing,
on_navigate: {
let handler = nav_handler;
move |target_id: String| {
if let Some(ref h) = handler {
h.call(target_id);
}
}
},
}
}
}
}
// Image viewer overlay
if *show_image_viewer.read() {
ImageViewer {