tridactyl / tridactyl

A Vim-like interface for Firefox, inspired by Vimperator/Pentadactyl.
https://tridactyl.xyz
Other
5.18k stars 398 forks source link

Hints do not work in gerrit code review dialogs #5046

Open stagnation opened 3 weeks ago

stagnation commented 3 weeks ago

The gerrit code review main UI does not work with hints :hints. Though other keyboard navigation keys work.

Try to open hints here: https://gerrit-review.googlesource.com/q/status:open+-is:wip Or a permanent link: https://gerrit-review.googlesource.com/c/gitiles/+/246495 The latter has a larger viewport so I can scroll that, the former is small and have little interaction opportunities.

This UI does work: https://gerrit.googlesource.com/aws-gerrit

set logging.hinting debug

Reporting(2024-09-09T08:09:28.614Z): Focus changed: {"isVisible":true,"hasFocus":true} gr-app.js:33041:321
Reporting(2024-09-09T08:09:30.059Z): user-active: {"events":["mousemove","pointerdown","keydown"]} gr-app.js:33041:321
Reporting(2024-09-09T08:09:30.532Z): Focus changed: {"isVisible":true,"hasFocus":false} gr-app.js:33041:321
Reporting(2024-09-09T08:09:36.618Z): Focus changed: {"isVisible":true,"hasFocus":true} gr-app.js:33041:321
Reporting(2024-09-09T08:09:40.191Z): user-active: {"events":["keydown","pointerdown","mousemove"]} gr-app.js:33041:321
Reporting(2024-09-09T08:09:45.648Z): Focus changed: {"isVisible":true,"hasFocus":false} gr-app.js:33041:321
Reporting(2024-09-09T08:09:45.985Z): Visibility changed to hidden: {"hiddenDurationMs":391276,"isVisible":false,"hasFocus":false} gr-app.js:33041:321
Reporting(2024-09-09T08:09:50.500Z): user-active: {"events":["mousemove"]} gr-app.js:33041:321
Reporting(2024-09-09T08:09:51.586Z): Focus changed: {"isVisible":false,"hasFocus":true} gr-app.js:33041:321
Reporting(2024-09-09T08:09:51.587Z): Visibility changed to visible: {"hiddenDurationMs":396877,"isVisible":true,"hasFocus":true} gr-app.js:33041:321
Reporting(2024-09-09T08:09:53.958Z): Focus changed: {"isVisible":true,"hasFocus":false} gr-app.js:33041:321
Reporting(2024-09-09T08:09:56.633Z): Focus changed: {"isVisible":true,"hasFocus":true} gr-app.js:33041:321
Reporting(2024-09-09T08:10:00.500Z): user-active: {"events":["mousemove","pointerdown","keydown"]} gr-app.js:33041:321
Reporting(2024-09-09T08:10:05.440Z): Focus changed: {"isVisible":true,"hasFocus":false}

Almost nothing. Pressed both f and called :hint.

set hintchars hklasdfgyuopwertnmzxcvb

set editorcmd alacritty --class FloatingTerminal -e vim
# set editorcmd urxvt -name FloatingTerminal -e vim -c ':color lakris256 | :set nonumber laststatus=0'

# Open in new-tab (replaces some view-source toggle I don't use)
bind gf hint -t

bind yd tabduplicate
bind \ss source /home/spill/.config/tridactyl/tridactylrc

# Yank the window title
bind yt composite js document.title + '\n' + document.location.href | yank

bind yf hint -y

# Yank anchor URL `;#`
bind ya hint -#

# Yank paragraph
bind yp composite hint -pipe * textContent | yank

## find mode
bind / fillcmdline find
bind n findnext 1
bind N findnext -1
bind ,<Space> nohlsearch

set followpagepatterns.next ^(next|newer)\\b|»|>>|more|→
set followpagepatterns.prev ^(prev(ious)?|older)\\b|«|<<|←

# split tab to a new window (d) and duplicate (D)
bind gd tabdetach
bind gD composite tabduplicate; tabdetach

set smoothscroll true

# # slack
# Actions for messages
# NB: Yoinked from github issues. Seem to be helpful, but not entirely correct.
# I supposed that slack has changed how they do things since these were written.
bindurl .*.slack.com ;m composite hint -Jc div[class=c-message_kit__gutter]; hint -Jc button[data-qa=more_message_actions]; hint -Jc button[data-focus-key=message_actions],[role=menuitem]
# Edit message
bindurl .*.slack.com ;e composite hint -Jc div[class=c-message_kit__gutter]; hint -Jc button[data-qa=more_message_actions]; hint -Jc button[data-qa=edit_message]
# copy message
bindurl .*.slack.com --mode=normal v composite hint -pipe div[data-qa=message-text] | js -p navigator.clipboard.writeText(JS_ARG.innerText)
# fewer anchors for f
bindurl .*.slack.com --mode=normal f hint -Jc div[data-sidebar-link-id]:not([data-sidebar-link-id=""]),div[data-section-channel-index]:not([data-section-channel-index=""]),button,a
bovine3dom commented 2 weeks ago

By coincidence this was partially fixed in 79c3e8942b562a9f3effe799886ebd0821cc88df just before you filed this issue, you just need to make sure focus is on the page (with e.g. ctrl+,) before hinting once I release that code into the betas (that bug fixed in ed0e7efd)

image

Closing as duplicate of #5039

bovine3dom commented 1 week ago

Tridactyl: Beta 1.24.1pre7038-ed0e7efd released which contains this fix :)

stagnation commented 1 week ago

Thank you very much :)

stagnation commented 5 days ago

Thanks again, though now that I start to ramp up my keyboard usage again (used the mouse for half a year on gerrit before reporting the issue :cry: ). I realize that the dialogs too have another kind of funny links that do not work with hints. Without requiring an account I hope this dialog is representative of all dialogs:

https://gerrit-review.googlesource.com/c/gerrit/+/436418

Open the dialog through the upper-right corner ... menu image Here is the view without signing in. Hinting still works on the main page, but this is a javascript-thingie popup. image

here is the most important voting panel dialog where one can vote +2 (disposition merge) or less-positive numbers for requested changes.

image

bovine3dom commented 5 days ago

The patches are just normal hrefs so I suspect there's some bug to do with the shadow root preventing our CSS from getting used