-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Desktop App: close tabs with Ctrl+W. #9909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
|
Connected to Huly®: UBERF-13745 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a platform-level Close Current Tab action and wires it to Cmd/Ctrl+W across the desktop app (main process shortcut, IPC command, UI handler, workbench action/resource).
- Introduces CloseCurrentTab action/resource and corresponding model/action metadata.
- Registers globalShortcut CommandOrControl+W to dispatch close-tab IPC, executing the new platform action.
- Adds closeCurrentTab helper in workbench resources and integrates it into exported resources.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/workbench/src/plugin.ts | Declares new CloseCurrentTab action reference in plugin manifest. |
| plugins/workbench-resources/src/workbench.ts | Implements closeCurrentTab helper wrapping existing close logic. |
| plugins/workbench-resources/src/index.ts | Exposes CloseCurrentTab resource in exported map. |
| models/workbench/src/plugin.ts | Adds CloseCurrentTab to actionImpl resource declarations. |
| models/workbench/src/index.ts | Defines CloseCurrentTab action metadata (label, icon, keybinding, context). |
| desktop/src/ui/types.ts | Adds CommandCloseTab constant and extends Command union. |
| desktop/src/ui/index.ts | Adds generic executePlatformAction helper and IPC handler for close-tab. |
| desktop/src/main/windowsSpecificSetup.ts | Imports new command (no direct usage shown in diff hunk). |
| desktop/src/main/start.ts | Registers global shortcut Cmd/Ctrl+W to send close-tab command. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
This pull request implements a new "Close Current Tab" action and keyboard shortcut (Cmd/Ctrl+W) for the desktop application, ensuring a consistent and platform-integrated way to close the active tab. The changes span the main process, UI, core models, and plugin resources, providing a robust and extensible approach for tab management.
Keyboard Shortcut and Command Integration
CommandOrControl+Wglobal shortcut in the Electron main process to trigger the newclose-tabcommand, which is sent to the renderer process (desktop/src/main/start.ts,desktop/src/ui/types.ts). [1] [2] [3] [4]CommandCloseTabin shared types and ensured it is handled by the UI process, which delegates to the new platform action (desktop/src/ui/types.ts,desktop/src/ui/index.ts). [1] [2] [3] [4]Platform Action and Model Extension
CloseCurrentTabaction to the workbench model, including metadata, keybindings, and context, and exposed it via the workbench plugin (models/workbench/src/index.ts,models/workbench/src/plugin.ts,plugins/workbench/src/plugin.ts). [1] [2] [3]Resource and Implementation
closeCurrentTabresource and implementation in the workbench resources plugin, which safely closes the currently active tab if possible (plugins/workbench-resources/src/workbench.ts,plugins/workbench-resources/src/index.ts). [1] [2] [3]Supporting Utilities and Imports
desktop/src/ui/index.ts,desktop/src/main/windowsSpecificSetup.ts). [1] [2] [3] [4] [5]These changes provide a seamless and extensible way for users to close the current tab using a familiar keyboard shortcut, aligning with standard desktop application behavior and improving user experience.