Skip to content
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

Allow notebook to be closed by pressing Esc #6189

Merged
merged 1 commit into from
Feb 9, 2024
Merged

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Feb 9, 2024

Part of #6158

#6187 changed the notebook to be displayed in a native dialog when possible.

That PR disabled the default behavior to close the dialog via Esc key, as it didn't work out of the box.

This PR enables that behavior back, and implements the missing logic to make everything work as expected.

Testing steps

  1. Open the notebook.
  2. Close it via "Close" button.
  3. Open it again. Press Esc and verify the notebook is closed and the sidebar is opened.
  4. Check that it is possible to open the notebook again, as many times as required.

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1d898d4) 99.44% compared to head (eab7dfd) 99.44%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6189      +/-   ##
==========================================
- Coverage   99.44%   99.44%   -0.01%     
==========================================
  Files         266      266              
  Lines       10147    10146       -1     
  Branches     2403     2403              
==========================================
- Hits        10091    10090       -1     
  Misses         56       56              

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

Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

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

LGTM. As discussed in this thread I do wonder if we can avoid hiding the sidebar when the notebook is open, now that we are using the browser's native modal dialog. We'd have to confirm why we hid the sidebar in the first place when the notebook is opened.

@acelaya acelaya merged commit 1afc706 into main Feb 9, 2024
4 checks passed
@acelaya acelaya deleted the notebook-close-esc branch February 9, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants