feat: add shareText#2104
Conversation
Greptile SummaryThis PR implements a "Share" feature that allows users to share selected text (or the current line when nothing is selected) from the editor via Android's native share sheet. The feature adds a
Confidence Score: 4/5The core share flow is functionally correct, but two prior review findings remain unaddressed: a debug console.log passed as the success callback and an unrelated proot plugin bundled into package.json. The shareText intent is dispatched on the UI thread and the JS bridge is wired correctly. The open items from earlier rounds — the console.log success callback that prints shared content to the console on every invocation, and the proot plugin added to package.json — are still present and lower confidence that the PR is ready to land as-is. src/cm/commandRegistry.js (console.log callback) and package.json (unrelated proot dependency) Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant SelectionMenu
participant CommandRegistry
participant SystemPlugin_JS as system (window.system)
participant SystemPlugin_Java as System.java (Cordova)
participant Android as Android Share Sheet
User->>SelectionMenu: Tap share icon (text selected)
SelectionMenu->>CommandRegistry: exec("share")
CommandRegistry->>CommandRegistry: shareCommand(view) collect selected ranges
CommandRegistry->>SystemPlugin_JS: shareText(text, console.log, console.error)
SystemPlugin_JS->>SystemPlugin_Java: cordova.exec("shareText", [text])
SystemPlugin_Java->>SystemPlugin_Java: runOnUiThread
SystemPlugin_Java->>Android: startActivity(Intent.ACTION_SEND chooser)
SystemPlugin_Java-->>SystemPlugin_JS: callbackContext.success()
Note over Android: User picks target app (async)
Android-->>User: Text shared
Reviews (2): Last reviewed commit: "fix" | Re-trigger Greptile |
Closes #1936