Skip to content

Conversation

@Leblayd
Copy link

@Leblayd Leblayd commented Nov 23, 2025

Implementing the missing option mentioned (by me) in #2158

@Leblayd
Copy link
Author

Leblayd commented Nov 23, 2025

I quickly tested it locally, and it seems to work as expected.

Technically it'd run into an error if the number of tabs were 0, but that seems impossible to me. Otherwise, it should work just like Gesturefy.

The localization stuff confuses me a little bit, though.
Should I add translations for languages I speak?
And should I add the key translated to English for all the other languages as well, or leave them out so it falls back to the translation key?

@Leblayd Leblayd marked this pull request as ready for review November 23, 2025 21:13
@surapunoyousei
Copy link
Member

Hi. @Leblayd Thank you for your contribution!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a new mouse gesture and keyboard shortcut action to switch to the previously selected tab based on access time. The feature adds the gecko-show-previously-selected-tab command that finds the most recently accessed tab (excluding the current one) and switches to it.

Key Changes:

  • Added gecko-show-previously-selected-tab command that iterates through tabs to find the one with the highest _lastAccessed timestamp (excluding tabs with Infinity)
  • Registered the new action in both the custom shortcut key system and mouse gesture system
  • Made the action available in the gesture settings UI

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
libs/shared/custom-shortcut-key/commands.ts Added the gecko-show-previously-selected-tab command with logic to find and select the previously accessed tab
browser-features/chrome/common/mouse-gesture/utils/actions.ts Registered the same action for mouse gestures with identical logic (but includes debug logging and a return statement)
browser-features/pages-settings/src/app/gesture/useAvailableActions.ts Added the new action to the list of available gesture actions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Leblayd and others added 2 commits November 24, 2025 14:20
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.

2 participants