From 4be371247fb69a358ae6d8a7b24df9c2db285110 Mon Sep 17 00:00:00 2001 From: gdilla Date: Sat, 14 Mar 2026 21:09:19 -0700 Subject: [PATCH 1/3] fix: show image files (PNG, JPG, etc.) in sidebar file browser The read_dir_recursive function had a hardcoded allowlist of file extensions that excluded image formats. Added all supported image extensions so PNG/JPG/GIF/etc. files appear in the file tree. Co-Authored-By: Claude Opus 4.6 (1M context) --- src-tauri/src/commands/fs.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/commands/fs.rs b/src-tauri/src/commands/fs.rs index 846795d..f4bc476 100644 --- a/src-tauri/src/commands/fs.rs +++ b/src-tauri/src/commands/fs.rs @@ -155,7 +155,7 @@ fn read_dir_recursive(dir_path: &Path, max_depth: u32) -> Result, } else if metadata.is_file() { let ext = path.extension().map(|e| e.to_string_lossy().to_lowercase()); - // Include markdown files and common text files + // Include markdown files, common text files, and images let include = matches!( ext.as_deref(), Some("md") @@ -178,6 +178,16 @@ fn read_dir_recursive(dir_path: &Path, max_depth: u32) -> Result, | Some("ts") | Some("xml") | Some("csv") + | Some("png") + | Some("jpg") + | Some("jpeg") + | Some("gif") + | Some("bmp") + | Some("svg") + | Some("webp") + | Some("ico") + | Some("tiff") + | Some("tif") ); if include { From 4ed368e3f461d57b156a7eba2977026eaea86c52 Mon Sep 17 00:00:00 2001 From: gdilla Date: Sat, 14 Mar 2026 21:14:51 -0700 Subject: [PATCH 2/3] feat: open image files with system viewer when clicked in sidebar Clicking PNG/JPG/etc. in the file tree now opens them with the OS default viewer (Preview.app on macOS) instead of trying to read them as text into a markdown tab. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/sidebar/Sidebar.vue | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/components/sidebar/Sidebar.vue b/src/components/sidebar/Sidebar.vue index 6887abe..0cc0231 100644 --- a/src/components/sidebar/Sidebar.vue +++ b/src/components/sidebar/Sidebar.vue @@ -1,5 +1,6 @@ + + diff --git a/src/components/sidebar/Sidebar.vue b/src/components/sidebar/Sidebar.vue index 0cc0231..e78bf4a 100644 --- a/src/components/sidebar/Sidebar.vue +++ b/src/components/sidebar/Sidebar.vue @@ -1,6 +1,5 @@