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

Add option to open a notebook in NbClassic if it is enabled; show "Open in..." dropdown menu if there are multiple options, show single button otherwise#6866

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 32 commits intojupyter:mainfromandrii-i:detect_nbclassic_dynamically
Jun 9, 2023

Conversation

@andrii-i
Copy link
Contributor

@andrii-iandrii-i commentedMay 11, 2023
edited
Loading

  • Dynamically detect if NbClassic is enabled
  • If NbClassic is installed, add option to open a notebook in NbClassic to "Open in..." menu, command palette, "View" menu
  • Show "Open in..." dropdown menu if there are multiple options, show single button otherwise
  • Fix some lint errors in test files

Fixes#6746
Fixes#6792

"Open in..." dropdown menu
Screenshot 2023-05-11 at 1 14 26 PM
Open_in

Single button
Screenshot 2023-05-12 at 10 06 55 AM

Command palette
Screenshot 2023-05-11 at 1 16 59 PM

"View" menu
Screenshot 2023-05-11 at 1 17 58 PM

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branchandrii-i/notebook/detect_nbclassic_dynamically

@jtpio
Copy link
Member

Thanks@andrii-i for working on this.

  • changes introduced in

Since this feature is specific to thenotebook /nbclassic use case, maybe we could add the logic in the notebook repo directly instead ofjupyter-server/jupyter_server#1272?

Probably the page config option could be set somewhere here:

defget_page_config(self):

@andrii-i
Copy link
ContributorAuthor

@jtpio thank you for looking into this PR. I was under assumption that because nbclassic is a server extension I need to expose this information inhttps://github.com/jupyter-server/jupyter_server through API endpoint or PageFile. Is it possible to detect if nbclassic is installed fromlab-extension alone? How? I'd be happy to try.

@JasonWeill
Copy link
Collaborator

The PyPI docs capitalize the project asNbClassic (first C capitalized):https://pypi.org/project/nbclassic/

@andrii-iandrii-i changed the titleAdd option to open notebook in nbclassic if it is installedAdd option to open a notebook in NbClassic if it is installedMay 11, 2023
@andrii-i
Copy link
ContributorAuthor

Thank you@JasonWeill. Updated capitalization in user-facingcommandLabel andcommandDescription toNbClassic, also updated screenshots in the PR description.

Copy link
Collaborator

@JasonWeillJasonWeill left a comment

Choose a reason for hiding this comment

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

Consistent interCaps

@jtpio
Copy link
Member

jtpio commentedMay 12, 2023
edited
Loading

thank you for looking into this PR. I was under assumption that because nbclassic is a server extension I need to expose this information inhttps://github.com/jupyter-server/jupyter_server through API endpoint or PageFile. Is it possible to detect if nbclassic is installed fromlab-extension alone? How? I'd be happy to try.

I would assume it should be possible to detect it here fromapp.serverapp similar to what is done here?

https://github.com/jupyter/notebook/blob/573becfa6470ce2b9b1a1451c5a54955d57b9c7a/notebook/app.py#LL52C28-L52C41

Also it would be fine to have that logic here in thenotebook Python code, since it's just about passing an additional page config option. Which means it's not specific to the lab extension only, but in this case it should be fine.

@andrii-iandrii-i changed the titleAdd option to open a notebook in NbClassic if it is installedAdd option to open a notebook in NbClassic if it is installed; show "Open in..." dropdown menu if there are multiple options, show single button otherwiseMay 12, 2023
@andrii-i
Copy link
ContributorAuthor

@jtpio Itried to accessapp.serverapp.extension_manager.extensions innotebook/app.py and it works, thanks for the suggestion

@jtpio
Copy link
Member

@andrii-i since the default is now a button we'll have to update the reference snapshots for the UI tests.

Thinking we could also expand the UI tests to cover the case whennbclassic is installed or not (but could be done in a separate PR)

@andrii-iandrii-iforce-pushed thedetect_nbclassic_dynamically branch from2acb833 to28aba34CompareMay 18, 2023 01:31
@andrii-iandrii-iforce-pushed thedetect_nbclassic_dynamically branch fromb7996d1 to4cc542cCompareMay 18, 2023 23:45
@andrii-i
Copy link
ContributorAuthor

Failing test seems to be flakey. It passedin previous run, I can't reproduce it locally or on Gitpod

@andrii-i
Copy link
ContributorAuthor

Also after notebook is opened in JupyterLab shell when nbclassic is installed, there is still only one button
Current

@jtpio
Copy link
Member

Also after notebook is opened in JupyterLab shell when nbclassic is installed, there is still only one button

Ah right, this is likely because the page config will only be passed to the frontend when served from the notebook application. Wondering if a better could then to pass a parameter via a server extension that would be distributed via the lab extension.

@andrii-i
Copy link
ContributorAuthor

andrii-i commentedMay 24, 2023
edited
Loading

@tonyfast tagging you to follow up on a discussion during todays JupyterLab call about displaying dropdown menu in cases where there is more than 1 option in "Open in..." menu (used to be called "Interface" menu) and a button otherwise. Please see these threads for a previous discussion on the topic:#6746 (comment),#6866 (comment). Bottomline: we don't expect users to see this UI in its different variants often (and never at once) so having extra friction of dropdown menu with only 1 option seems to be not worth it. Would be interested to hear your opinion.

@tonyfast
Copy link
Collaborator

originally, i thought it didn't make sense to switch the semantics of the UI. now that i see it is a feature being degraded and deprecated then switching semantics makes sense to me. they actually are different things now. steady on. good stuff. thanks for including me.

@andrii-i
Copy link
ContributorAuthor

@tonyfast Thank you for giving this a look and providing feedback

@andrii-iandrii-iforce-pushed thedetect_nbclassic_dynamically branch from0057146 tob48d4c8CompareJune 1, 2023 22:28
@andrii-iandrii-iforce-pushed thedetect_nbclassic_dynamically branch fromf798f04 to936f647CompareJune 8, 2023 20:56
@andrii-iandrii-i requested a review fromjtpioJune 8, 2023 21:13
Copy link
Member

@jtpiojtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

@jtpiojtpio merged commit92f2336 intojupyter:mainJun 9, 2023
@jtpiojtpio mentioned this pull requestJun 9, 2023
2 tasks
@andrii-i
Copy link
ContributorAuthor

Thank you@jtpio

@andrii-iandrii-i deleted the detect_nbclassic_dynamically branchJune 9, 2023 06:08
@andrii-iandrii-i changed the titleAdd option to open a notebook in NbClassic if it is installed; show "Open in..." dropdown menu if there are multiple options, show single button otherwiseAdd option to open a notebook in NbClassic if it is enabled; show "Open in..." dropdown menu if there are multiple options, show single button otherwiseJun 12, 2023
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJun 13, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@ellisonbgellisonbgellisonbg left review comments

@JasonWeillJasonWeillJasonWeill left review comments

@jtpiojtpiojtpio approved these changes

+1 more reviewer

@GabrielaVivesGabrielaVivesGabrielaVives left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@andrii-iandrii-i

Projects

None yet

Milestone

7.0

6 participants

@andrii-i@jtpio@JasonWeill@tonyfast@ellisonbg@GabrielaVives

[8]ページ先頭

©2009-2025 Movatter.jp