Skip to content

Conversation

@GeneralGDA
Copy link
Contributor

@GeneralGDA GeneralGDA commented Sep 22, 2025

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

  • Added registration of the CommandOrControl+W global shortcut in the Electron main process to trigger the new close-tab command, which is sent to the renderer process (desktop/src/main/start.ts, desktop/src/ui/types.ts). [1] [2] [3] [4]
  • Defined CommandCloseTab in 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

  • Introduced the CloseCurrentTab action 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

  • Added the closeCurrentTab resource 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

  • Extended imports and utility functions to support the new action and command, including platform resource fetching and action execution (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.

Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
@GeneralGDA GeneralGDA requested a review from Copilot September 22, 2025 12:27
@huly-github-staging
Copy link

Connected to Huly®: UBERF-13745

Copy link
Contributor

Copilot AI left a 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>
BykhovDenis
BykhovDenis previously approved these changes Sep 22, 2025
Signed-off-by: Denis Gladkiy <denis.gladkiy@hardcoreeng.com>
@haiodo haiodo merged commit 6cb1dd5 into develop Sep 22, 2025
15 checks passed
@haiodo haiodo deleted the desktop-app-close-tabs-on-ctrl-w branch September 22, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants