mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5266] [MERGED] feat(desktop): cross-platform quit action #5132
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#5132
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/5266
Author: @CuriousCorrelation
Created: 7/22/2025
Status: ✅ Merged
Merged: 7/23/2025
Merged by: @jamesgeorge007
Base:
next← Head:desktop-feat-cross-platform-quit-action📝 Commits (1)
a397415feat(desktop): cross-platformquitaction📊 Changes
5 files changed (+75 additions, -6 deletions)
View changed files
📝
packages/hoppscotch-common/src/components.d.ts(+6 -5)📝
packages/hoppscotch-common/src/helpers/actions.ts(+36 -0)📝
packages/hoppscotch-common/src/helpers/keybindings.ts(+1 -0)📝
packages/hoppscotch-desktop/src-tauri/src/lib.rs(+21 -1)📝
packages/hoppscotch-selfhost-web/src/main.ts(+11 -0)📄 Description
This implements consistent cross-platform quit functionality that
triggers graceful application shutdown through native native commands.
Closes FE-919
The
Cmd + Qquit shortcut was previously broken across platforms withinconsistent behavior, working on Windows 11 but failing on macOS,
AppImage Linux, and Windows 10. The implementation was mixed and
unreliable.
What's changed
This adds explicit cross-platform quit shortcut handling using the
actions system. The implementation adds
Ctrl/Cmd + Qdetection inmain.tsthat maps to thectrl-qkeybinding, creates a newapp.quitaction with platform-specific handling, implements a
quit_appnativecommand that calls
app.exit(0)for graceful shutdown, and connects thectrl-qkeybinding to theapp.quitaction in the keybindingsconfiguration.
Implementation details
The shortcut handler prevents default browser behavior and triggers the
action system:
The action handler checks kernel mode and invokes the native command on
desktop:
The native
quit_appcommand triggersRunEvent::ExitRequestedfollowed by
RunEvent::Exitfor cleanup (internally):Platform behavior
Cmd + Qtriggers native quit commandCtrl + Qtriggers native quit commandNotes to reviewers
The quit action is set up immediately when the actions module is
imported and doesn't depend on any component lifecycle. Error handling
avoids fallback to
window.close()since native command failuresindicate improper context.
Testing should verify that the shortcut consistently quits the
application across macOS, Windows, and Linux without leaving background
processes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.