Page MenuHomePhabricator Dev

Test
AcceptedPublic

Authored by dkl-testuser1 on Jun 13 2025, 6:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 11, 10:03 AM
Unknown Object (File)
Thu, Sep 24, 5:27 AM
Unknown Object (File)
Aug 8 2026, 12:59 PM
Unknown Object (File)
Jul 29 2026, 7:14 AM
Unknown Object (File)
Jul 22 2026, 7:45 PM
Unknown Object (File)
Jul 22 2026, 5:51 AM
Unknown Object (File)
Jun 17 2026, 5:42 AM
Unknown Object (File)
Jun 10 2026, 6:11 AM
Subscribers

Details

Reviewers
dkl-testuser3
Bugzilla Bug ID
1853323
Summary

Test

Test Plan

Test

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.
This revision is now accepted and ready to land.Jun 13 2025, 7:00 PM
suhaib2 changed the visibility from "Public (No Login Required)" to "Administrators".Mar 25 2026, 9:36 PM
suhaib2 changed the visibility from "Administrators" to "Public (No Login Required)".

Summary

Intent

The change replaces the browser-native accesskey="s" attribute on the quick search input field with a custom JavaScript keyboard shortcut handler. The native accesskey attribute behaves inconsistently across browsers and platforms (e.g., Alt+S on some browsers, Alt+Shift+S on others), so the goal is to provide a consistent, controlled keyboard shortcut (Alt+S / Opt+S on macOS) to focus the quick search field.

Solution

The solution has two parts:

  1. Removal of the accesskey attribute: The accesskey="s" attribute is removed from the quick search input element in the header template, eliminating the browser-native shortcut behavior.
  1. Addition of a custom keydown listener: A new keydown event listener is added in the global JavaScript file that listens for the Alt+S key combination. When detected, it prevents the default browser action and programmatically focuses the #quicksearch_top input element. This provides a unified shortcut experience (Alt+S on Windows/Linux, Opt+S on macOS) regardless of browser-specific accesskey modifier differences.

Please use / reactions on inline comments to provide feedback. This will have a significant impact on the quality of future reviews.
js/global.js
268

event.which is deprecated and removed from web standards. Replace String.fromCharCode(event.which) === 'S' with event.code === 'KeyS'. Using event.code is also more reliable for keyboard shortcuts since it references the physical key position and won't be affected by Alt/Opt producing alternate characters on certain keyboard layouts (e.g., on macOS, Opt+S produces 'ß' in some layouts, which would cause event.key to not match 's').