feat(desktop): grid nativo e recorte magnetico de captura - #12
Merged
Conversation
Substitui a dependencia exclusiva do picker do WebView2 por enumeracao nativa (xcap) e overlay com UI Automation, mantendo getDisplayMedia como fallback para testes e ambientes sem invoke. Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_94f189f6-94ed-443c-af02-e2842e3cffdd) |
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
xcap: grid de janelas/monitores com thumbnail, titulo real e exclusao das janelas do proprio LinvoElementFromPoint), com recorte livre por arraste e fallbackgetDisplayMediaTest plan
cargo checknosrc-tauritsc --noEmitno desktopRelacionado
Note
Medium Risk
Screen-capture and overlay behavior are platform-sensitive (permissions, multi-monitor sizing, large base64 payloads), and magnetic snapping depends on Windows COM/UIA with non-Windows degradation;
xcapadds a sizable native dependency surface.Overview
Native visual context capture replaces the composer’s direct “capture window / full screen” actions with three paths: a thumbnail grid of windows and monitors (via
xcap), magnetic crop on a frozen multi-monitor snapshot, and the existinggetDisplayMediasystem picker.The Tauri side adds a
capturemodule with commands to list sources (with thumbnails, titles, and Linvo self-window exclusion), capture PNG bytes/metadata, open/close a dedicatedcapture-overlaywebview spanning the virtual desktop, and on Windows resolve element bounds under the cursor via UI Automation (ElementFromPoint) with HWND fallback. Capabilities andcapture.tomlpermissions wire these invokes;Cargo.tomlpulls inxcap,image,base64, and Windows accessibility crates.The React layer adds
CaptureSourcePicker,CaptureOverlayApp(drag selection, debounced magnet highlight, Enter/Esc), and extendsuseDisplaySnapshotwith picker state, native source capture into the existing preview/crop draft flow, and overlay result/cancel listeners.ChatInputmenu and tests are updated accordingly; window chrome treatscapture-overlayclose as hiding the overlay.Reviewed by Cursor Bugbot for commit 77f9287. Configure here.