Skip to content

fix(redirection): ignore repeated Shift keydown for next-version shortcut#2082

Merged
Skn0tt merged 3 commits into
mainfrom
copilot/fix-playwright-docs-navigation
Jul 1, 2026
Merged

fix(redirection): ignore repeated Shift keydown for next-version shortcut#2082
Skn0tt merged 3 commits into
mainfrom
copilot/fix-playwright-docs-navigation

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The hidden "press Shift five times to jump to the unreleased (/docs/next/) docs" shortcut fired unintentionally. Holding Shift while moving the mouse or scrolling horizontally emits auto-repeat keydown events (e.repeat === true), each counted as a press, so the count reached 5 and navigated away — reproducible on Windows and Mac in Chrome.

Changes

  • Guard on e.repeat in the keydown handler in static/js/redirection.js: auto-repeat events now reset the counter and return early, so only five distinct Shift presses trigger the shortcut.
document.addEventListener('keydown', (e) => {
  if (e.repeat) {
    keyPressState = 0;
    return;
  }
  if (kGoToNextToken[keyPressState] === e.key) {
    ...

Copilot AI changed the title [WIP] Fix bug with Playwright docs redirecting to unreleased version fix(redirection): ignore repeated Shift keydown for next-version shortcut Jul 1, 2026
Copilot finished work on behalf of Skn0tt July 1, 2026 13:02
Copilot AI requested a review from Skn0tt July 1, 2026 13:02
Comment thread static/js/redirection.js Outdated
let keyPressState = 0;
document.addEventListener('keydown', (e) => {
if (e.repeat) {
keyPressState = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot let's just rearly-return or include this in the condition below. no need to reset, this can actively harm 5-tap.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done — now just early-returns on e.repeat without touching keyPressState, in 6c2... (latest commit).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(correction on hash) addressed in 2257997.

@Skn0tt

Skn0tt commented Jul 1, 2026

Copy link
Copy Markdown
Member

@copilot address the feedback

@Skn0tt Skn0tt marked this pull request as ready for review July 1, 2026 13:08
@Skn0tt Skn0tt requested a review from dgozman July 1, 2026 13:08

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the feedback

Already addressed in 2257997 — the handler now early-returns on e.repeat without resetting keyPressState.

Copilot AI requested a review from Skn0tt July 1, 2026 13:09
Copilot finished work on behalf of Skn0tt July 1, 2026 13:09
@Skn0tt Skn0tt merged commit 25b9682 into main Jul 1, 2026
4 checks passed
@Skn0tt Skn0tt deleted the copilot/fix-playwright-docs-navigation branch July 1, 2026 13:28
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.

[Docs]: bug: playwright docs jump to unreleased version

3 participants