Skip to content

feat: close maximized panels with escape key#2533

Merged
dsmmcken merged 3 commits intomainfrom
dmckenzie_1165
Sep 18, 2025
Merged

feat: close maximized panels with escape key#2533
dsmmcken merged 3 commits intomainfrom
dmckenzie_1165

Conversation

@dsmmcken
Copy link
Copy Markdown
Contributor

@dsmmcken dsmmcken commented Sep 10, 2025

fixes: #1165

Was annoyed with this while working on something, add handling to escape close maximize fields.

Exclude if inputs are focused (ex. monaco uses escape to deselect, but doesn't consume it, native searches clear field but don't consume it either).

Copy link
Copy Markdown
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

This PR adds the ability to close maximized panels by pressing the Escape key, addressing issue #1165. The feature intelligently excludes input elements to avoid conflicting with their built-in Escape key behaviors.

  • Added escape key handling to close maximized panels
  • Implemented input element detection to prevent conflicts with existing escape behaviors
  • Added proper event binding and cleanup for the keydown handler

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/golden-layout/src/LayoutManager.ts Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 10, 2025

Codecov Report

❌ Patch coverage is 13.33333% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.56%. Comparing base (d1b557f) to head (ff07505).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/golden-layout/src/LayoutManager.ts 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2533      +/-   ##
==========================================
- Coverage   44.57%   44.56%   -0.02%     
==========================================
  Files         764      764              
  Lines       42807    42821      +14     
  Branches    10765    10773       +8     
==========================================
+ Hits        19083    19084       +1     
- Misses      23713    23726      +13     
  Partials       11       11              
Flag Coverage Δ
unit 44.56% <13.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@mattrunyon mattrunyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks clearing selection on a grid while maximized. We seem to not stop propagation of the escape key event on grid so that you can close linker

One potential fix would be to stop propagation on grid escape in SelectionKeyHandler and change linker close to use capture phase. I think that should work

@mattrunyon
Copy link
Copy Markdown
Collaborator

mattrunyon commented Sep 17, 2025

Actually looks like linker already uses capture phase, so might just be able to consume the event in Grid? Although then it will always eat it because it still handles clearing nothing

@dsmmcken dsmmcken requested a review from mattrunyon September 17, 2025 20:24
@dsmmcken
Copy link
Copy Markdown
Contributor Author

Changed to only stop propagation when clearing.

If grid has selection and focus, and grid is maximized, and linker is open:

1st escape clears grid
2nd escape clears linker
3rd escape minimizes

@dsmmcken dsmmcken merged commit b90d540 into main Sep 18, 2025
11 checks passed
@dsmmcken dsmmcken deleted the dmckenzie_1165 branch September 18, 2025 14:03
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exit maximized panels with escape

3 participants