Skip to content

Conversation

@tiye
Copy link
Member

@tiye tiye commented Jan 15, 2026

No description provided.

@tiye tiye requested review from a team and Copilot January 15, 2026 13:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md and expanded CLI guidance in Agents.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 || ""));
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
insertTextAtCursor(String(msg.text || ""));
insertTextAtCursor(String(msg.text || ""));
return;

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +70
chrome.tabs.sendMessage(tab.id, {
action: "fill-text",
text: message.text || "",
});
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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
);
}
}
);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants