fix: memory files tab empty on Windows (#140)
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 3m39s
CI / Build Linux (push) Has been cancelled
CI / Build Windows (cross-compile) (push) Has been cancelled
CI / Lint & Test (push) Has been cancelled

## Summary

Fixes the memory files tab showing as empty on Windows production builds and the "forbidden path" error when trying to read memory files.

## Changes

### 1. List memory files from WSL home directory (commit 1)
- Split `list_memory_files()` into platform-specific implementations
- **Windows**: Use WSL command with `bash -l` to find memory files in WSL home (`~/.claude/projects/.../memory/`)
- **Linux/Mac**: Continue using native filesystem access
- Previously used `dirs::home_dir()` which returns Windows home (`C:\Users\...`), but Claude Code stores files in WSL home

### 2. Use backend command for reading files (commit 2)
- Changed frontend from Tauri's `readTextFile` plugin to `read_file_content` backend command
- Tauri plugin enforces scope restrictions and can't access WSL paths on Windows
- Our backend command already handles WSL paths correctly via `read_file_via_wsl()`
- Matches the pattern used throughout the app for other file operations

## Testing

-  All 426 backend tests pass
-  All frontend tests pass
-  Lint, format, and type checks pass
-  Follows existing WSL file operation patterns in codebase

## Related Issues

Fixes the memory files tab functionality on Windows whilst maintaining full compatibility with Linux/Mac.

 This PR was created by Hikari~ 🌸

Reviewed-on: #140
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #140.
This commit is contained in:
2026-02-08 13:51:09 -08:00
committed by Naomi Carrigan
parent 0ea7861047
commit 778e016bf5
2 changed files with 51 additions and 2 deletions
+2 -2
View File
@@ -1,7 +1,6 @@
<script lang="ts">
import { onMount } from "svelte";
import { invoke } from "@tauri-apps/api/core";
import { readTextFile } from "@tauri-apps/plugin-fs";
import Markdown from "./Markdown.svelte";
let memoryFiles: string[] = $state([]);
@@ -33,7 +32,8 @@
isLoading = true;
error = null;
try {
const content = await readTextFile(filePath);
// Use our backend command instead of Tauri plugin to handle WSL paths
const content = await invoke<string>("read_file_content", { path: filePath });
fileContent = content;
selectedFile = filePath;
} catch (e) {