Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Close the browser tab when clicking on "Close and Shut Down Notebook"#6937

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jtpio merged 12 commits intojupyter:mainfromjtpio:close-and-shutdown
Jun 22, 2023

Conversation

@jtpio
Copy link
Member

@jtpiojtpio commentedJun 20, 2023
edited
Loading

Fixes#6934
Fixes#1159

This mimics the behavior of the Classic Notebook:

close-and-halt.mp4

In Notebook 7:

notebook-7-close-and-halt.mp4

Changes

  • Add new semantic command to thecloseAndCleaners
  • Move the close and cleaners down in the file menu. Related toNotebook v7 menus should match the v6 ones whenever possible #6398
  • Keep the same "Close and Halt" name in the menu entry as in the classic UI
  • Update reference snapshots
  • Add UI test to check the browser tab is closed when clicking on the menu item

@jtpiojtpio added this to the7.0 milestoneJun 20, 2023
@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branchjtpio/notebook/close-and-shutdown

@jtpio
Copy link
MemberAuthor

bot please update playwright snapshots

@jtpiojtpio closed thisJun 20, 2023
@jtpiojtpio reopened thisJun 20, 2023
@jtpiojtpio marked this pull request as ready for reviewJune 20, 2023 08:11
@jtpio
Copy link
MemberAuthor

cc@gutow for awareness

@jtpiojtpio requested a review fromandrii-iJune 20, 2023 08:11
@jtpiojtpio changed the titleClose the browser tab when clicking on "Close and Shut Down Notebook"Close the browser tab when clicking on "Close and Halt"Jun 20, 2023
Copy link
Contributor

@andrii-iandrii-i left a comment
edited
Loading

Choose a reason for hiding this comment

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

This looks and works well, thank you for working on this@jtpio.

I believe there is spaceto improve user experience further beyond adding parity with nbclassic:

  1. It's not clear what exactly "Close and Halt" and "Shut Down" items do and what is the difference between them. Please find suggestions below on renaming "Close and Halt" into "Close Notebook and Shutdown Kernel". "Shut Down" should then be renamed into "Shut Down Server". I think this can be done within this PR but can also be taken care of separately.
  2. "Close and Halt" terminates kernel of the notebook and "Shut Down" terminates server with all kernels. When this happens all unsaved data is lost. Therefore these buttons are destructive and can lead to data loss. To remedy this, we could ask a user to confirm his action via modal/popup window. We should then also add "..." to the end of both options to indicate that selecting the item will lead to further options or require additional input. It would probably be best to do it in a separate PR after Notebook 7 launch, please let me know if you agree with the approach and I can create an issue to track it.

gutow reacted with thumbs up emoji

constid='notebook:close-and-halt';
commands.addCommand(id,{
label:trans.__('Close and Halt'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
label:trans.__('Close andHalt'),
label:trans.__('CloseNotebookandShutdown Kernel'),

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

If going with this suggestion then we'll likely need to useShut Down instead ofShutdown for consistency with the other menu entries.

expect(awaitpanel.screenshot()).toMatchSnapshot(imageName);
});

test('Clicking on "Close and Halt" should close the browser tab',async({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
test('Clicking on "Close andHalt" should close the browser tab',async({
test('Clicking on "CloseNotebookandShutdown Kernel" should close the browser tab',async({

);
awaitpage.goto(`notebooks/${tmpPath}/${notebook}`);

constmenuPath='File>Close and Halt';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
constmenuPath='File>Close andHalt';
constmenuPath='File>CloseNotebookandShutdown Kernel';

@jtpio
Copy link
MemberAuthor

  1. It's not clear what exactly "Close and Halt" and "Shut Down" items do and what is the difference between them. Please find suggestions below on renaming "Close and Halt" into "Close Notebook and Shutdown Kernel". "Shut Down" should then be renamed into "Shut Down Server". I think this can be done within this PR but can also be taken care of separately.

Good question. JupyterLab uses "Close and Shut Down Notebook", while for the Classic Notebook it's "Close and Halt". This PR went with "Close and Halt" so it looks the same as the classic notebook and also taking into consideration#6398 (for example if folks have screenshots showing these menu entries in the course materials).

However for consistency with JupyterLab it would be fine to go with "Close and Shut Down Notebook" yes, no strong opinion.

2. To remedy this, we could ask a user to confirm his action via modal/popup window

Normally there is already a dialog (see the second screencast):

image

@andrii-i
Copy link
Contributor

However for consistency with JupyterLab it would be fine to go with "Close and Shut Down Notebook" yes, no strong opinion.

From my point of view, "Close and Shut Down Notebook" is significantly more clear in explaining its function. "Close and Shut Down Notebook" still describes what happens with kernel better vs for example "Close and Halt Notebook" as "halt" implies pausing. Also we already use "Shut Down" for process termination so with "halt" we would be introducing a second term for the same action. We could also check in with other contributors during the call today.

Normally there is already a dialog (see the second screencast)

Yes, somehow missed this.

@jtpio
Copy link
MemberAuthor

From my point of view, "Close and Shut Down Notebook" is significantly more clear in explaining its function. "Close and Shut Down Notebook" still describes what happens with kernel better vs for example "Close and Halt Notebook" as "halt" implies pausing. Also we already use "Shut Down" for process termination so with "halt" we would be introducing a second

Yes that sounds fine too. Users familiar with theClose and Halt entry from the classic notebook would probably be not too confused if it's now nameClose and Shut Down Notebook now anyway.

Co-Authored-By: Andrii Ieroshenko <ieroshenkoa@gmail.com>
@jtpio
Copy link
MemberAuthor

bot please update playwright snapshots

@jtpiojtpio closed thisJun 21, 2023
@jtpiojtpio reopened thisJun 21, 2023
@jtpio
Copy link
MemberAuthor

FYI@andrii-i I updated the PR to take your suggestions in consideration.

@jtpiojtpio changed the titleClose the browser tab when clicking on "Close and Halt"Close the browser tab when clicking on "Close and Shut Down Notebook"Jun 21, 2023
@jtpio
Copy link
MemberAuthor

Merging as the comments above have been addressed.

Thanks@andrii-i for the review!

@jtpiojtpio merged commit77f87de intojupyter:mainJun 22, 2023
@jtpiojtpio deleted the close-and-shutdown branchJune 22, 2023 07:41
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJun 22, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@andrii-iandrii-iandrii-i approved these changes

Assignees

@jtpiojtpio

Projects

None yet

Milestone

7.0

Development

Successfully merging this pull request may close these issues.

Browser tab does not close when a notebook is shutdown v7.0.0.rc.0 "Close and Halt" not closing the page in master

2 participants

@jtpio@andrii-i

[8]ページ先頭

©2009-2025 Movatter.jp