mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5683] [MERGED] feat(desktop): url focus and mru tab shortcuts #5311
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5311
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5683
Author: @CuriousCorrelation
Created: 12/10/2025
Status: ✅ Merged
Merged: 12/16/2025
Merged by: @jamesgeorge007
Base:
next← Head:feat-desktop-focus-and-mru-keyboard-shortcuts📝 Commits (3)
27866a3feat(desktop): url focus and mru tab shortcutsc64fbe3fix: comment and unused variablesaec570echore: formatting updates📊 Changes
14 files changed (+508 additions, -6 deletions)
View changed files
📝
packages/hoppscotch-common/locales/en.json(+7 -2)📝
packages/hoppscotch-common/src/components/http/Request.vue(+6 -0)📝
packages/hoppscotch-common/src/components/smart/EnvInput.vue(+12 -0)📝
packages/hoppscotch-common/src/helpers/actions.ts(+3 -0)📝
packages/hoppscotch-common/src/helpers/keybindings.ts(+6 -0)📝
packages/hoppscotch-common/src/helpers/shortcuts.ts(+15 -0)📝
packages/hoppscotch-common/src/pages/graphql.vue(+8 -0)📝
packages/hoppscotch-common/src/pages/index.vue(+8 -0)📝
packages/hoppscotch-common/src/services/spotlight/searchers/tab.searcher.ts(+27 -0)📝
packages/hoppscotch-common/src/services/tab/__tests__/tab.service.spec.ts(+243 -0)📝
packages/hoppscotch-common/src/services/tab/index.ts(+23 -0)📝
packages/hoppscotch-common/src/services/tab/tab.ts(+123 -0)📝
packages/hoppscotch-desktop/.gitignore(+1 -0)📝
packages/hoppscotch-selfhost-web/src/main.ts(+26 -4)📄 Description
This adds keyboard shortcuts for focusing the URL bar and switching
between tabs using most recently used (MRU) order on the desktop app.
Expands FE-907
Closes FE-1100
Addresses https://github.com/hoppscotch/hoppscotch/issues/3520#issuecomment-3619679142.
What's changed
Added three new keyboard shortcuts for desktop:
Ctrl/Cmd + Alt + U: Focus URL barCtrl/Cmd + Alt + ]: Navigate forward through MRU tab historyCtrl/Cmd + Alt + [: Navigate backward through MRU tab historyThe shortcuts use
Ctrl+Altmodifier combinations to avoid conflictswith system shortcuts. On macOS,
Alt(Option) produces specialcharacters when combined with letter keys, so the implementation uses
e.code(physical key) instead ofe.key(produced character) fordetection.
Implementation details
The
TabServicenow tracks tab activation order via anmruOrderarray and supports bidirectional navigation with a
mruNavigationIndex:]) moves toward older tabs, backward ([) moves toward more recent tabs, both wrap aroundmruNavigationIndextracks position during MRU cycling and resets when a tab is explicitly activatedswitchToIt=false) are not added to MRU until first activatedcommitMRUNavigation()finalizes the selection by moving the tab to the front of MRU orderThe keyboard handler in
main.tscaptures shortcuts at the windowlevel using the capture phase and emits events via Tauri's event
system. The
keybindings.tslistener receives these events andinvokes the corresponding actions.
URL focus works by exposing a
focus()method fromSmartEnvInput.vueand calling it from a
request.focus-urlaction handler inRequest.vue.Testing
Test on macOS, Windows, Linux:
Cmd/Ctrl + Alt + ]repeatedly to cycle forward: C → B → A → CCmd/Ctrl + Alt + [to cycle backward through the historyCmd/Ctrl + Alt + Uto focus the URL barThe shortcuts should work regardless of keyboard layout since they
use physical key codes.
Test coverage
closeOtherTabsMRU handling🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.