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

@ -6,7 +6,7 @@ use futures::future::join_all;
use crate::client::*;
use crate::components::{
audit, collections, database, detail, duplicates, import, library,
audit, collections, database, detail, duplicates, graph_view, import, library,
media_player::PlayQueue,
search, settings, statistics, tags, tasks,
};
@ -29,6 +29,7 @@ enum View {
Tasks,
Settings,
Database,
Graph,
}
impl View {
@ -46,6 +47,7 @@ impl View {
Self::Tasks => "Tasks",
Self::Settings => "Settings",
Self::Database => "Database",
Self::Graph => "Note Graph",
}
}
}
@ -564,6 +566,14 @@ pub fn App() -> Element {
span { class: "nav-icon", "\u{1f4ca}" }
span { class: "nav-item-text", "Statistics" }
}
button {
class: if *current_view.read() == View::Graph { "nav-item active" } else { "nav-item" },
onclick: move |_| {
current_view.set(View::Graph);
},
span { class: "nav-icon", "\u{1f578}" }
span { class: "nav-item-text", "Graph" }
}
button {
class: if *current_view.read() == View::Tasks { "nav-item active" } else { "nav-item" },
onclick: {
@ -1310,6 +1320,25 @@ pub fn App() -> Element {
show_toast("Added to queue".into(), false);
}
},
on_navigate_to_media: {
let client = client.read().clone();
move |media_id: String| {
let client = client.clone();
spawn(async move {
match client.get_media(&media_id).await {
Ok(media) => {
// Load tags for the new media
if let Ok(mtags) = client.get_media_tags(&media_id).await {
media_tags.set(mtags);
}
selected_media.set(Some(media));
auto_play_media.set(false);
}
Err(e) => show_toast(format!("Failed to load linked note: {e}"), true),
}
});
}
},
}
},
None => rsx! {
@ -2305,6 +2334,33 @@ pub fn App() -> Element {
},
}
}
View::Graph => {
rsx! {
graph_view::GraphView {
client: client.read().clone(),
center_id: None,
on_navigate: {
let client = client.read().clone();
move |media_id: String| {
let client = client.clone();
spawn(async move {
match client.get_media(&media_id).await {
Ok(media) => {
// Load tags for the media
if let Ok(mtags) = client.get_media_tags(&media_id).await {
media_tags.set(mtags);
}
selected_media.set(Some(media));
current_view.set(View::Detail);
}
Err(e) => show_toast(format!("Failed to load: {e}"), true),
}
});
}
},
}
}
}
}
}
}