[PR #5200] [MERGED] fix(desktop): redirect menu bar events to window #5104

Closed
opened 2026-03-17 02:34:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5200
Author: @CuriousCorrelation
Created: 6/26/2025
Status: Merged
Merged: 6/26/2025
Merged by: @jamesgeorge007

Base: nextHead: fix-desktop-redirect-shortcuts-via-intermidiate-events


📝 Commits (3)

  • 653bbae fix(desktop): redirect menu bar events to window
  • 84ca1a8 chore: clarify comment on keybind override
  • 0ff5da8 fix(desktop): key match, render cycle skip for events

📊 Changes

2 files changed (+110 additions, -142 deletions)

View changed files

📝 packages/hoppscotch-desktop/src-tauri/src/lib.rs (+2 -141)
📝 packages/hoppscotch-selfhost-web/src/main.ts (+108 -1)

📄 Description

This removes the visible menu bar from the desktop app while making sure all keyboard shortcuts work through FE event handling.

The shortcuts now work as window-focused events instead of global menu accelerators.

Closes HFE-915

The previous implementation used Tauri's native menu system which created a visible menu bar with "File", "View", and "Tabs" menus on Windows/Linux and also created a thin 1px line on MacOS.

While menu bar approach is still viable, it needs some more iterations to make sure we get it right. For now redirecting events via FE should work as a workaround in the meantime.

The implementation uses DOM keydown event listeners in the desktop-specific code block that emit hoppscotch_desktop_shortcut events using Tauri v2's guest-js bindings (@tauri-apps/api/event).

Notes to reviewers

This change only affects desktop mode when kernelMode === "desktop" and preserves all existing shortcut functionality. The menu bar will no longer appear on Windows/Linux while maintaining the same keyboard shortcuts users expect.

Testing should verify that all shortcuts work correctly and that no menu bar is visible on desktop platforms. Have done so for MacOS and Windows, seems to have worked.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5200 **Author:** [@CuriousCorrelation](https://github.com/CuriousCorrelation) **Created:** 6/26/2025 **Status:** ✅ Merged **Merged:** 6/26/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `fix-desktop-redirect-shortcuts-via-intermidiate-events` --- ### 📝 Commits (3) - [`653bbae`](https://github.com/hoppscotch/hoppscotch/commit/653bbae0c6618eb677a7788bd7a4ada852bf0cc3) fix(desktop): redirect menu bar events to window - [`84ca1a8`](https://github.com/hoppscotch/hoppscotch/commit/84ca1a8c5a066f4b54ae441ff788c155291330b9) chore: clarify comment on keybind override - [`0ff5da8`](https://github.com/hoppscotch/hoppscotch/commit/0ff5da8943cd473234442e4044d3040699370e8e) fix(desktop): key match, render cycle skip for events ### 📊 Changes **2 files changed** (+110 additions, -142 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-desktop/src-tauri/src/lib.rs` (+2 -141) 📝 `packages/hoppscotch-selfhost-web/src/main.ts` (+108 -1) </details> ### 📄 Description This removes the visible menu bar from the desktop app while making sure all keyboard shortcuts work through FE event handling. The shortcuts now work as window-focused events instead of global menu accelerators. Closes HFE-915 The previous implementation used Tauri's native menu system which created a visible menu bar with "File", "View", and "Tabs" menus on Windows/Linux and also created a thin 1px line on MacOS. While menu bar approach is still viable, it needs some more iterations to make sure we get it right. For now redirecting events via FE should work as a workaround in the meantime. The implementation uses DOM keydown event listeners in the desktop-specific code block that emit `hoppscotch_desktop_shortcut` events using Tauri v2's guest-js bindings (`@tauri-apps/api/event`). ### Notes to reviewers This change only affects desktop mode when `kernelMode === "desktop"` and preserves all existing shortcut functionality. The menu bar will no longer appear on Windows/Linux while maintaining the same keyboard shortcuts users expect. Testing should verify that all shortcuts work correctly and that no menu bar is visible on desktop platforms. Have done so for MacOS and Windows, seems to have worked. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:34:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5104
No description provided.