Skip to content

feat: enhance MCP folder picker functionality#61

Merged
maximedogawa merged 1 commit into
mainfrom
60-bug-file-picker-cannot-be-opened-in-edit
Apr 18, 2026
Merged

feat: enhance MCP folder picker functionality#61
maximedogawa merged 1 commit into
mainfrom
60-bug-file-picker-cannot-be-opened-in-edit

Conversation

@maximedogawa
Copy link
Copy Markdown
Collaborator

@maximedogawa maximedogawa commented Apr 18, 2026

  • Introduced a new permission for the MCP folder picker in the Tauri application, allowing users to open the native folder picker for filesystem paths.
  • Updated error handling in the McpServerCard component to provide more specific error messages when folder selection fails.
  • Refactored the pick_mcp_filesystem_folder command to use a non-blocking callback API, preventing deadlocks in the async runtime on macOS.

Summary by CodeRabbit

Release Notes

  • Improvements

    • Enhanced folder picker functionality with improved async callback handling for better responsiveness and consistent error messages when selecting filesystem paths in MCP server configurations.
  • Documentation

    • Refined weather skill documentation with clearer formatting and improved table layout. Removed outdated location formatting instructions and enhanced guidance on weather data fallback handling.

- Introduced a new permission for the MCP folder picker in the Tauri application, allowing users to open the native folder picker for filesystem paths.
- Updated error handling in the `McpServerCard` component to provide more specific error messages when folder selection fails.
- Refactored the `pick_mcp_filesystem_folder` command to use a non-blocking callback API, preventing deadlocks in the async runtime on macOS.
@maximedogawa maximedogawa linked an issue Apr 18, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The changes implement a new MCP folder picker permission system and convert the folder picker functionality from blocking to async callback-based operations. Permission definitions are added to Tauri capabilities, the desktop command handler is updated to use async channels, error handling is consolidated with a helper function, and weather skill documentation is refined.

Changes

Cohort / File(s) Summary
Tauri Permission Configuration
src-tauri/capabilities/default.json, src-tauri/permissions/mcp-folder-picker.toml
Added new allow-mcp-folder-picker permission and registered it in the default capability's permissions array.
Async Folder Picker Implementation
src-tauri/src/modules/bot/commands.rs
Converted pick_mcp_filesystem_folder from blocking blocking_pick_folder() to async callback-based implementation using tokio::sync::oneshot channels for inter-component communication.
Error Handling Normalization
src/modules/mcp/components/McpServerCard.tsx
Extracted shared pickFolderErrorMessage() helper function to consolidate folder picker error message normalization across three error handlers.
Weather Skill Documentation
tools/skills/weather/SKILL.md, tools/skills/weather/mandatory.md
Refined table formatting and removed specific guidance about space-to-plus character replacement in wttr.in URLs.

Sequence Diagram

sequenceDiagram
    participant UI as Frontend UI
    participant Handler as Tauri Command Handler
    participant Picker as Folder Picker Callback
    participant Channel as Tokio Oneshot Channel

    UI->>Handler: invoke("pick_mcp_filesystem_folder")
    Handler->>Channel: create_oneshot_channel()
    Handler->>Picker: call async pick_folder(callback)
    Picker->>Picker: user selects folder (or cancels)
    Picker->>Callback: callback(path or error)
    Callback->>Channel: send through oneshot
    Handler->>Channel: await receiver
    Channel-->>Handler: result or closed error
    Handler->>UI: return Result<Option<String>>
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A rabbit hops through async lands so bright, 🐰
Where callbacks dance and channels flow just right,
The folder picker now runs swift and free,
With oneshot channels in harmony—
Error messages unified with glee! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'enhance MCP folder picker functionality' is partially related to the changeset. While the PR does improve the MCP folder picker, the main change is refactoring from blocking to async callback API to fix a deadlock bug (as indicated in the branch name and PR objectives), which is more specific than 'enhance'.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 60-bug-file-picker-cannot-be-opened-in-edit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@maximedogawa maximedogawa merged commit 6f4a7f7 into main Apr 18, 2026
1 check was pending
@maximedogawa maximedogawa deleted the 60-bug-file-picker-cannot-be-opened-in-edit branch April 18, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] File picker cannot be opened in edit

1 participant