mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #5190] [MERGED] feat(desktop): native tab keyboard shortcuts #5096
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#5096
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/5190
Author: @CuriousCorrelation
Created: 6/24/2025
Status: ✅ Merged
Merged: 6/24/2025
Merged by: @jamesgeorge007
Base:
next← Head:feat-desktop-common-keyboard-shortcuts📝 Commits (5)
2ea9e93feat(desktop): native tab keyboard shortcutsb26ff05fix(desktop): missingtab_firstmenu itema662ce9fix(desktop): more ergonomic first/last tab binds9f9c40bfeat(desktop): add new tab shortcuts to spotlight4582f4afix(desktop); log error asconsole.error📊 Changes
13 files changed (+426 additions, -15 deletions)
View changed files
📝
devenv.nix(+1 -0)📝
packages/hoppscotch-common/locales/en.json(+4 -0)📝
packages/hoppscotch-common/package.json(+1 -0)📝
packages/hoppscotch-common/src/helpers/actions.ts(+5 -0)📝
packages/hoppscotch-common/src/helpers/keybindings.ts(+79 -4)📝
packages/hoppscotch-common/src/pages/graphql.vue(+23 -0)📝
packages/hoppscotch-common/src/pages/index.vue(+24 -0)📝
packages/hoppscotch-common/src/services/spotlight/searchers/tab.searcher.ts(+44 -0)📝
packages/hoppscotch-common/src/services/tab/index.ts(+33 -0)📝
packages/hoppscotch-common/src/services/tab/tab.ts(+66 -1)📝
packages/hoppscotch-desktop/src-tauri/src/lib.rs(+139 -1)📝
packages/hoppscotch-desktop/src-tauri/src/main.rs(+2 -2)📝
pnpm-lock.yaml(+5 -7)📄 Description
This adds native menu items with keyboard accelerators for tab management ops for the desktop app. These are standard desktop app shortcuts for tab control.
Closes HFE-907
Closes #3520
Closes HP-24
Shortcuts added
(, navigate to the left-most tab), navigate to the right-most tab9 comes before 0 on QWERTY so it seems more ergonomic.
Implementation details
The impl creates menu items with platform-appropriate accelerators (Cmd/Ctrl) that emit events to the frontend keybinding module so tab navigation and management can work.
The architecture uses Tauri's native menu system to register accelerators at the OS level, which then emit
hoppscotch_desktop_shortcutevents to the frontend.This approach makes shortcuts work globally within the app window and follow platform conventions. Global shortcuts would have prevented shortcuts from reaching other apps (global shortcuts are system level).
The FE keybinding system is extended to support desktop-specific bindings through kernel mode detection, to separate base web shortcuts from desktop-only shortcuts like these (mentioned above).
Some additions to tab service: methods like
goToNextTab(),goToPreviousTab(),goToLastTab()plus some foundation / plumbing for future shortcut expansion.Notes to reviewers
This also addresses the UX issue where users would accidentally close the entire app when trying to close tabs with Ctrl/Cmd+W.
The shortcuts now match standard desktop application behavior across most browsers (firefox, chrome, etc) and also IDEs to an extent (think VS code). The desktop shortcuts only activate when running in desktop kernel mode, so no changes web app behavior.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.