Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds interoperability features between the browser extension components, enabling the extension to fill text into web page input fields and refactoring the context menu structure.
Changes:
- Enhanced browser extension with hierarchical context menu (Summary, Translate, Custom) and text-filling capability
- Updated dependencies:
@calcit/procs(0.10.4→0.10.8),@google/genai(1.34.0→1.36.0),openai(6.15.0→6.16.0), and various Respo packages - Added comprehensive documentation for Respo component listeners and event interop in
llms/Respo.mdand expanded CLI guidance inAgents.md
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/service-worker.js | Added hierarchical context menu structure with Summary/Translate/Custom options, implemented text-filling message relay to content scripts |
| extension/content.js | Implemented insertTextAtCursor function to handle text insertion into INPUT/TEXTAREA elements and contentEditable fields |
| compact.cirru | Added comp-fill component, on-fill listener, style-fill styles, refactored extension message handling to use send-to-component! pattern, added :about warning field |
| package.json | Bumped dependency versions for @calcit/procs, @google/genai, and openai |
| yarn.lock | Updated lockfile with new package versions and added protobufjs dependencies for @google/genai |
| deps.cirru | Updated calcit-version and Respo package versions to match package.json updates |
| llms/Respo.md | Added documentation for component-level event listeners, send-to-component! API, style testing examples, and removed duplicate Chinese content |
| Agents.md | Expanded documentation with Cirru syntax guide, type annotations, incremental updates workflow, and common pitfalls section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return; | ||
| } | ||
| if (msg.action === "fill-text") { | ||
| insertTextAtCursor(String(msg.text || "")); |
There was a problem hiding this comment.
Missing return statement after handling the 'fill-text' action. While JavaScript will implicitly return undefined, this is inconsistent with the explicit return statement at line 9 for the 'selected' action. For consistency and clarity, add an explicit return statement after calling insertTextAtCursor.
| insertTextAtCursor(String(msg.text || "")); | |
| insertTextAtCursor(String(msg.text || "")); | |
| return; |
| chrome.tabs.sendMessage(tab.id, { | ||
| action: "fill-text", | ||
| text: message.text || "", | ||
| }); |
There was a problem hiding this comment.
Missing error handling for chrome.tabs.sendMessage. If the message fails to send (e.g., content script not loaded on the page), this will fail silently. Consider adding error handling or checking chrome.runtime.lastError in a callback to provide feedback when text filling fails.
| chrome.tabs.sendMessage(tab.id, { | |
| action: "fill-text", | |
| text: message.text || "", | |
| }); | |
| chrome.tabs.sendMessage( | |
| tab.id, | |
| { | |
| action: "fill-text", | |
| text: message.text || "", | |
| }, | |
| (response) => { | |
| if (chrome.runtime.lastError) { | |
| console.error( | |
| "Failed to send 'fill-text' message to tab", | |
| tab.id, | |
| chrome.runtime.lastError.message | |
| ); | |
| } | |
| } | |
| ); |
No description provided.