AI-native design editor. Open-source Figma alternative.
fix(desktop): let the app read and write its own cache on Linux (#1661)
Valery Komarov0f07bb776435
diff --git a/changes/1661/fixed.md b/changes/1661/fixed.mdnew file mode 100644index 000000000..be1f5829d--- /dev/null+++ b/changes/1661/fixed.md@@ -0,0 +1 @@+- On Linux, the desktop app caches recent file previews and downloaded fonts again, so they no longer load anew each time.diff --git a/desktop/AGENTS.md b/desktop/AGENTS.mdindex 8ecd75341..0d1504612 100644--- a/desktop/AGENTS.md+++ b/desktop/AGENTS.md@@ -6,7 +6,7 @@ Check `desktop/Cargo.toml`, `desktop/capabilities/**`, and `desktop/tauri.conf.j- Dev tools: add or use a menu item to toggle them; do not rely on keyboard shortcuts.- `desktop/src/credentials.rs` stores secrets in the native system credential store; failures must surface, never fall back to browser or plaintext storage (`src/AGENTS.md`, Settings).- ACP and harness process changes require checking `desktop/capabilities/**`.-- The fs scope allows documents anywhere but denies, in the global `fs:scope`, every place where a written file would run, and `requireLiteralLeadingDot` keeps hidden files out of `**` on every platform; a new write path must not reopen either (`tests/e2e/native/fs-scope.spec.ts`).+- The fs scope allows documents anywhere but denies, in the global `fs:scope`, every place where a written file would run, and `requireLiteralLeadingDot` keeps hidden files out of `**` on every platform; a new write path must not reopen either (`tests/e2e/native/fs-scope.spec.ts`). The app's own cache in `$APPLOCALDATA` is allowed by name, as on Linux it lives under `~/.local/share`, which `**` does not reach.- A `shell:allow-spawn` entry pins the whole command line: no `"args": true`, and a Windows `.cmd` shim runs through its own `cmd-<name>` entry with fixed `/c <name> …` arguments, which `resolvePlatformCommand` selects (`tests/engine/tauri/command.test.ts`).- The Software Update window is a second webview labelled `updater` that loads `updater.html` (`src/updater.ts`), never the editor's `index.html`; its own capability, `desktop/capabilities/updater.json`, grants only checking, installing, restarting, closing, and opening links. It owns no documents, so before a restart or a Windows install it asks the editor window over `updater:restart-request` to run the Quit approval (`src/app/shell/updater/approvals.ts`, `tests/app/shell/updater/session.test.ts`).- Never click Install in a `tauri dev` build: the updater unpacks the release next to the running binary, which there is `desktop/target/debug`.diff --git a/desktop/capabilities/default.json b/desktop/capabilities/default.jsonindex 5ba942c95..09240e74b 100644--- a/desktop/capabilities/default.json+++ b/desktop/capabilities/default.json@@ -57,7 +57,7 @@},{"identifier": "fs:allow-read-file",- "allow": [{ "path": "**" }]+ "allow": [{ "path": "**" }, { "path": "$APPLOCALDATA/**" }]},{"identifier": "fs:allow-stat",@@ -92,7 +92,7 @@},{"identifier": "fs:allow-write-file",- "allow": [{ "path": "**" }],+ "allow": [{ "path": "**" }, { "path": "$APPLOCALDATA/**" }],"deny": [{ "path": "$HOME/Library/Application Support/OpenPencil/mcp.json" },{ "path": "$LOCALDATA/OpenPencil/mcp.json" },@@ -112,11 +112,11 @@},{"identifier": "fs:allow-mkdir",- "allow": [{ "path": "**" }]+ "allow": [{ "path": "**" }, { "path": "$APPLOCALDATA/**" }]},{"identifier": "fs:allow-remove",- "allow": [{ "path": "**" }],+ "allow": [{ "path": "**" }, { "path": "$APPLOCALDATA/**" }],"deny": [{ "path": "$HOME/Library/Application Support/OpenPencil/mcp.json" },{ "path": "$LOCALDATA/OpenPencil/mcp.json" },diff --git a/src/app/recent-files/workspace.ts b/src/app/recent-files/workspace.tsindex 09869cd65..88d500bad 100644--- a/src/app/recent-files/workspace.ts+++ b/src/app/recent-files/workspace.ts@@ -34,7 +34,10 @@ export function useRecentFilesWorkspace() {},refreshOnFocus: false,refreshOnReconnect: false,- previewConcurrency: 2+ previewConcurrency: 2,+ // A card without a preview says nothing of why, so the reason goes to the console.+ onPreviewError: (documentId, error) =>+ console.warn(`[Recent files] No preview for ${documentId}:`, error)})watch(recentFiles, () => void workspace.invalidate())return workspace