Repository navigation
Conversation
ce81b7b to
6ecef8b
Compare
|
Thanks for this. The branch now conflicts with main (recording.rs, hotkeys.rs, tauri.ts). Could you rebase, regenerate the tauri bindings, and re-trigger Greptile? We need Greptile at 5/5 on the latest commit and green CI before we review. |
e2ed377 to
91db79d
Compare
|
@greptileai review |
Comments Outside DiffThese findings could not be posted inline.
|
|
@greptileai review |
|
Hey, 5/5 now |
|
Thanks so much for this contribution, @x1xhlol! Cap's desktop app has now fully moved from Tauri to our new native GPUI app ( |
Summary
Adds a privacy-first "copy text from screen" feature: press Ctrl+Shift+T (Windows) / Cmd+Shift+T (macOS), drag over any screen region with the existing area selector, and the recognized text is copied straight to the clipboard. Nothing is written to disk by default.
Reuses Cap's existing native OCR engines (Apple Vision on macOS, Windows.Media.Ocr on Windows) — no new dependency, free, fast, on-device.
How it fits together:
HotkeyAction::OcrArea— new hotkey action, seeded with a default binding on startup viaseed_default_hotkeys(aseededlist inHotkeysStoreensures it's only auto-added once and never overrides a user's existing binding). Pressing it opens the target-select overlay in a newRecordingTargetMode::Ocr.target-select-overlay.tsx—"ocr"target mode reuses the area-selector UI (screenshot-style: 1×1 min size, no recording controls, toolbar hint "Draw an area to copy text"). On mouse-up it invokes the new command instead oftakeScreenshot; on error the overlay is restored with a toast.capture_ocr_text(recording.rs) — new Tauri command:take_screenshotwas split intocapture_screen_image+save_screenshot_projectso OCR shares the capture/persistence code without duplicating it.ocr_keep_screenshot(save the region as a normal screenshot project) andocr_show_notification(system notification with a preview of the copied text).Showcase
Pressing the shortcut opens the familiar area selector, in text-capture mode:
Drag over any text and it lands on the clipboard (nothing written to disk):
The capture is a background gesture — the app you were in keeps keyboard focus afterwards:
Settings — rebindable shortcut and the two default-off toggles:
Testing (Windows, end-to-end on a live dev build)
.capscreenshot project createdKnown minor limitation: a very thin selection (~30 px tall) can return "No text was found in the selected area" (Windows.Media.Ocr small-region behavior); handled gracefully with a toast, slightly larger selections work.
macOS path uses the same Vision-based OCR code Cap already ships for the screenshot editor; it compiles for both platforms but was runtime-tested on Windows only.
The PR appears safe to merge.
Summary
The PR adds global area-based OCR capture using the existing native OCR engines and copies recognized text directly to the clipboard.
Reviews (3) · Last reviewed commit: "Add global OCR text capture (Ctrl/Cmd+Sh..." · Reviewed by Greptile