feat: improve React compatibility, text strategy fallbacks, and auto-connect#11
Open
gruckion wants to merge 1 commit intohypothesi:mainfrom
Open
Conversation
…connect - Fix text input for React apps by using native value setter and InputEvent instead of direct assignment, which React's synthetic event system ignores - Enhance "text" selector strategy with fallback to placeholder, aria-label, and title attributes when no text content match is found - Auto-connect to Tauri app when no active session exists instead of throwing - Update package name and repository URL for fork Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
yokuze
requested changes
Mar 20, 2026
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/hypothesi/mcp-server-tauri.git", | ||
| "url": "https://github.com/gruckion/mcp-server-tauri.git", |
Member
There was a problem hiding this comment.
Please revert this back to "hypothesi"
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "name": "@hypothesi/tauri-mcp-server", | |||
| "name": "@gruckion/tauri-mcp-server", | |||
Member
|
These are good improvements. If you could make the two tweaks in the comments I left, then rebase to fix the merge conflicts, I'll merge them in. Thanks! |
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
webview_interacttype action now uses the nativeHTMLInputElement.prototype.valuesetter and dispatchesInputEvent(instead of a genericEvent) to correctly trigger React's synthetic event system. Previously, directly setting.valuebypassed React's internal value tracker, causing controlled components to silently ignore typed input.placeholder,aria-label, andtitleattributes. This makes thetextstrategy much more useful for finding form inputs and interactive elements that don't have visible text content.driver_sessionexists,ensureReady()now automatically attempts to start a session. This removes a common friction point where every tool call required a manualdriver_sessionstart first, while still providing a clear error if auto-connect fails.Why these changes?
React is the most popular frontend framework used in Tauri apps. The previous text input implementation silently failed on React controlled inputs because React tracks value changes through its own internal mechanism. By using the native prototype setter and resetting React's
_valueTracker, we ensure the input works across vanilla JS, React, Vue, and other frameworks.Form inputs rarely have visible text content. The
textstrategy was limited to matchingtextContent, which excluded<input>and<textarea>elements. Falling back toplaceholder,aria-label, andtitleattributes makes it natural to say "find the element with text 'Search...'" and have it locate an input with that placeholder.Requiring manual
driver_sessionstart before every interaction was an unnecessary step when there's typically only one Tauri app running. Auto-connect eliminates this friction while still failing clearly if no app is available.Test plan
<input>componentstextstrategy finding elements by placeholder texttextstrategy finding elements byaria-label🤖 Generated with Claude Code