godbout / kindaVim.docs

Ultimate Vim Mode for macOS
https://kindavim.app
625 stars 4 forks source link

Sometimes Vim mode doesn't work for Arc browser #229

Open Celve opened 6 months ago

Celve commented 6 months ago

I've encountered a recurring issue with Vim mode functionality within the Arc browser. For example, when I want to use w to move the cursor to the beginning of the next word, it just moves the cursor right, just like what "l" does.

However, there is a temporary fix:

  1. Click on the kindaVim icon in the Arc browser's menu bar.
  2. Select "Check what the wizard says".
  3. Close the wizard window without making any changes.

Post-implementation of this workaround, Vim mode functions correctly for a duration. However, the issue re-emerges after continuous use.

godbout commented 6 months ago
  1. Click on the kindaVim icon in the Arc browser's menu bar.
  2. Select "Check what the wizard says".
  3. Close the wizard window without making any changes.

the temporary fix is just a coincidence. if you don't add Arc in any of kV's Family, then a check of how kV should behave is done at every keystroke. the issue with web browsers is that they're really not consistent. depends on the type of text input/fields etc. lemme have a quick look.

also would help if you let me know where exactly the issue happens. Arc own interface? web page? which web page. etc.

godbout commented 6 months ago

as you can see:

https://github.com/godbout/kindaVim.docs/assets/121373/1f8ee22a-0045-488a-9f2a-8cfe273e0f26

in Arc's UI, the tab thing, kV can use the full macOS AX and it works fine. now in browser pages it doesn't (you can see that in the first two characters in the google search there's a block cursor, that's because for those two characters the macOS AX data is correct. after that it's not and kV has to revert to using key remapping instead of the (wrong) AX data). to get the whole thing consistent, kV tells you to put Arc in the Key Mapping Family (coz i've investigated Arc maybe some months or years ago). then using kV in Arc will be more consistent. still, there may be webpages that override key mapping, like some code editors online etc. in that case yeah, their own overriding will take precedence, unfortunately. Vimming is hard ☹️

Celve commented 6 months ago

I have already put it in Key Mapping family, and the issue only happens in Google Docs and Google search box currently. I've prepared a video demonstration to illustrate the problem.

https://github.com/godbout/kindaVim.docs/assets/95223577/8ff15b09-3152-4cfd-ab12-ed7f0e3f8b02

godbout commented 6 months ago

for Google Docs have a look at this: https://github.com/godbout/kindaVim.docs/issues/34#issuecomment-1010174583 and the rest of the thread. may help for now. will check more.

godbout commented 6 months ago

after i've enabled the AX in Google Docs settings and refreshed the page, then the motions work correctly. can you try?

Celve commented 6 months ago

I tried, but still the same. Also it seems like all input field would have this issue.

https://github.com/godbout/kindaVim.docs/assets/95223577/b44e1d4e-d48e-49ef-9e6b-ad36edb598e6

godbout commented 6 months ago

have you restarted Arc?

works fine here in Google Docs after having specified that it should enable AX, and in all inputs. showing The Wizard is really not gonna help kV do anything. it's a refreshing issue from Arc, maybe:

https://github.com/godbout/kindaVim.docs/assets/121373/53e3abd1-4753-4ffe-bc89-5955c096b0a9

Celve commented 6 months ago

I find a way to reproduce it:

  1. Put cursor in any input box
  2. Wait for about 15 seconds
godbout commented 6 months ago

i can reproduce. it's because Arc disables the web pages accessibility elements automatically after a while. why? no fucking idea. it's very clear when i use my other app that highlights AX Elements. video incoming.

godbout commented 6 months ago

https://github.com/godbout/kindaVim.docs/assets/121373/db762555-6f6f-4d24-bc60-fe53ac71bd6c

godbout commented 6 months ago

so:

  1. after a moment of inactivity, Arc disables the webpage AX. hence kV can't get any information at all
  2. if you hide Arc and show it again, kV gets Arc to reactivate the AX in the webpage (every time an app becomes the frontmost app, kV checks which app it is and do the necessary to enable the AX)

currently there's two things you can do. one is point 2. when the issue happens, you hide and show Arc again. that's a short term trick coz that's shit in the long term for sure. another way to solve this for now is to add Arc in the 911 Family. in that case kV will not even care whether he can detect any AX at all and will enforce the key remapping everywhere like if everything was an input (coz the Key Mapping Family still uses the AX to determine if we're dealing with some sort of text element, or with any other input like menu, dropdown, etc. but as you see, Arc disable the AX so we can't even know with what kind of element we're dealing with).

for the rest i'll check through Arc's option, and i'll contact the devs.

Celve commented 6 months ago

Thank you so much for taking the time to explain this so thoroughly. It was very helpful.

godbout commented 6 months ago

my pleasure. thanks for using my babies!

i'll contact Arc's devs tomorrow and will update here.

godbout commented 6 months ago

pinged the dev. but not case follow up etc. will see what they say.

Screenshot 2024-03-28 at 16 29 39