fix(notebooks): normalize icon paths across platforms

This commit is contained in:
Yuri Karamian
2026-08-15 01:40:14 +02:00
parent 27609fb4f3
commit 87c879bcac
4 changed files with 70 additions and 25 deletions
+6 -4
View File
@@ -555,15 +555,17 @@ pub fn move_notebook(
// Update notebook icon mappings
if let Ok(icons) = operations::load_notebook_icons(vault_path) {
let old_prefix = format!("{}/", old_relative);
let old_icon_key = operations::normalize_notebook_icon_key(&old_relative);
let new_icon_key = operations::normalize_notebook_icon_key(&new_relative);
let old_prefix = format!("{}/", old_icon_key);
let mut new_icons = std::collections::HashMap::new();
let mut changed = false;
for (key, value) in &icons {
if *key == old_relative {
new_icons.insert(new_relative.clone(), value.clone());
if *key == old_icon_key {
new_icons.insert(new_icon_key.clone(), value.clone());
changed = true;
} else if key.starts_with(&old_prefix) {
let new_key = format!("{}/{}", new_relative, &key[old_prefix.len()..]);
let new_key = format!("{}/{}", new_icon_key, &key[old_prefix.len()..]);
new_icons.insert(new_key, value.clone());
changed = true;
} else {