Phase 3.1 + directory picker fix#71
Merged
baochipham942-eng merged 7 commits intomainfrom Apr 23, 2026
Merged
Conversation
Dedup-by-path tab open: if a tab with the same rootPath already exists, activate it instead of creating a duplicate. Enables syncing the File Explorer with session workingDirectory changes without churning tabs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the one-shot initRef mount effect with a continuous subscription to appStore.workingDirectory. Whenever the active session's working directory changes, open a tab for it or activate an existing one with the same path. Other manually opened tabs are preserved. Switch TabBar's Plus button and the empty-state "打开项目目录" fallback to openOrFocusTab too, so manual opens also dedup by path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The legacy channel 'workspace:select-directory' is declared in IPC_CHANNELS but has no registered handler in main — only the domain dispatcher workspace.ipc.ts 'case selectDirectory' is wired. Three callsites were still invoking the dead legacy channel and the errors were swallowed by try/catch, so users saw "clicking does nothing": - TitleBar workspace chip - TaskPanel WorkingFolder picker - Lab RealModePanel project directory picker All three now go through ipcService.invokeDomain(IPC_DOMAINS.WORKSPACE, 'selectDirectory'), matching FileExplorerPanel's TabBar path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Registers tauri-plugin-dialog in the Rust builder, grants dialog:allow-open capability, and installs @tauri-apps/plugin-dialog on the JS side. The previous Electron→Tauri port left dialog.showOpenDialog as a no-op stub in miscCompat.ts, so every "select directory" surface was silently cancelled. The plugin provides the native directory picker the renderer will invoke directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The main-process handleSelectDirectory calls dialog.showOpenDialog, but under Tauri that symbol resolves to the miscCompat stub that always returns canceled. Short-circuit in the renderer instead: when running in a Tauri webview, lazy-import @tauri-apps/plugin-dialog and invoke its native directory picker directly, then plumb the path into the existing stores. Web mode keeps the window.prompt fallback. Fixes the three dead callsites: TitleBar workspace chip, TaskPanel WorkingFolder picker, Lab RealModePanel project directory picker. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The webview loads from http://localhost:8180, which Tauri treats as a
remote URL. Capabilities default to local-only, so dialog:allow-open
was denied at runtime even though the plugin was registered and the
JS call site was correct ("Command plugin:dialog|open not allowed by
ACL"). Adding http://localhost:8180/* to the capability's remote.urls
whitelist lets the dialog plugin accept invokes from the webview.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openOrFocusTabstore action dedups by path; covered by 4 unit tests.tauri-plugin-dialog, routing renderer callsites through@tauri-apps/plugin-dialog, and whitelisting the http://localhost:8180 webview origin in capability ACL.Why the ACL step was load-bearing
The app loads its webview from http://localhost:8180 (Node-served renderer). Tauri treats that as a remote origin, and capabilities default to local-only. Plugin call failed with "Command plugin:dialog|open not allowed by ACL" until `remote.urls` was added to `src-tauri/capabilities/default.json`.
Test plan
Out of scope (noted for follow-up)
🤖 Generated with Claude Code