Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feat: show tab-specific icon status and turn on/off completion on each page manually #51

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

li-xin-yi
Copy link
Contributor

@li-xin-yi li-xin-yi commented Feb 17, 2024

Add a contextMenu option to control the behavior on the current tab:
image

Three status:

  1. image idle: The extension is enabled, but the URL is not in white list or no editor can be injected
  2. image off: the extension is disabled by the user
  3. image active: the completion is working on this page.

Implementation issues:

contentScript.ts and the injected script.ts are running independently, so we have to construct so many messages to communicate between different environments. Temporarily, the "disabled" feature is hacked by passing the global variable codeium_disabled and let the completion provider in Monaco/CodeMirror be dummy when observing codeium_disabled become false, instead of implementing a real clean up script to unregister all completion handlers. It may be problematic, for example, Colab supports inline completion for some eligible users. If we turn off the Codeium extension, the built-in colab completion is also disabled.

For issue #49 (for now, only 1 and 3 are done)

@CLAassistant
Copy link

CLAassistant commented Feb 17, 2024

CLA assistant check
All committers have signed the CLA.

@pqn
Copy link
Contributor

pqn commented Feb 20, 2024

Adding @kevinzlu to take a look if he has time, since I am OOO right now.

@kevinzlu
Copy link

@li-xin-yi is this PR still a WIP or is it ready for review? I was not able to get the contextMenu item when I tested it + failed to get completions in Colab.

@li-xin-yi
Copy link
Contributor Author

Hi @kevinzlu , Thanks for testing.

  1. When creating this PR, I just waited for the review to make sure if I understand @pqn 's suggestion correctly. This PR is not finished, I'll implement the popup window to finish the feature 2 in Preciser Status on each Website (Inactive/active) #49
  2. Can you provide more details about the failure? If on Colab, I think the colab itself overwrote the contextmenu on cell areas, but the default contextmenu does show up when clicking on other regions, such as the header.
image

@li-xin-yi
Copy link
Contributor Author

image Update: generate a regex to match the current primary domain.

This PR is still in process, I just posted it to know if it understand the requirement correctly.

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.

None yet

4 participants