Exafunction / codeium-chrome

Free, ultrafast code autocomplete for Chrome
https://www.codeium.com/
MIT License
120 stars 19 forks source link

Preciser Status on each Website (Inactive/active) #49

Open li-xin-yi opened 9 months ago

li-xin-yi commented 9 months ago

Currently, the popup page and extension icon seem too primitive (another related complaint: https://github.com/Exafunction/codeium-chrome/issues/48). I feel a little painful when

  1. I want to temporarily turn on/off the completion on the current web page manually by one-click, instead of going to the option page to edit the whitelist.
  2. I desire to add the regex of current page to the whitelist by one-click
  3. The icon on the extension bar show if this extension is active in current page

My desired feature looks like wakatime, which also tracks the activities of the user and includes white/black list feature.

I'd like to work on this enhancement by this weekend, make the popup page more fancy as well (such as showing how many completions are accepted today, or the graph). Please let me know if the idea is acceptable or conflict with others.

fortenforge commented 9 months ago

I think items 1. 2. and 3. would be appreciated! I think stuff like adding the number of completions accepted we might want our own design team to first make a spec.

li-xin-yi commented 9 months ago

Thanks @fortenforge @pqn I finished 3 on my side. Considering how to implement 2, if the popup page is immutable, I can add the option on the contextMenu like this:

image

But I'm blocked by how to disable the functionality of Codeium completion after injection (as the page is already loaded). Two approaches:

  1. Write clean-up functions for every possible editor to unregister the completion provider. It's a little complicated and time-consuming, I may need help from you.
  2. Ignore the message (completion request) from specific tabs, it sounds like a hack, I don't like it and neither do I know how to do that...

What do you think about it? Do you need me to create a draft PR with current progress and have a discussion?

By the way, I found Colab supports their built-in completion now. It might not be a good way to overwrite the Monaco completion for it.

pqn commented 9 months ago

Can we write the same code twice, once in each implementations (CodeMirror and Monaco), to be able to read some state change caused by the context menu? Then if Codeium is disabled behave as a noop.

By the way, I found Colab supports their built-in completion now. It might not be a good way to overwrite the Monaco completion for it.

If this is true for everyone then we can disable it.

li-xin-yi commented 9 months ago

If this is true for everyone then we can disable it.

Not for every user, but only some eligible ones: https://blog.google/technology/developers/google-colab-ai-coding-features/

I'm just wondering how to handle this.

pqn commented 9 months ago

For Colab let's leave it on for now in that case. Not sure how Monaco will choose between them but as long as the user gets some completions it's probably okay either way.

li-xin-yi commented 9 months ago

Hi @pqn @fortenforge, Thanks for your help.

I tried to implement 1 and 3 in this draft https://github.com/Exafunction/codeium-chrome/pull/51 I'm not certain whether I understand your idea correctly so I created that PR early for tests and discussion. The code is dirty now, I will clean it up further if needed. Please let me know if I misunderstand anything.

And also, should I also push the implementation of 3 in the same PR, or is it more comfortable to review and handle the code so far? Either is fine to me.

pqn commented 8 months ago

Thanks! I think it's fine to keep 3 in the same PR, it's not unmanageably sized right now.