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

Left right panel in Notebook view #6487

Merged
merged 57 commits into from
Oct 6, 2022
Merged

Conversation

brichet
Copy link
Contributor

@brichet brichet commented Jul 25, 2022

This PR follows #6327 to add left and right panel to Notebook.

The left and right panels can be opened from the view menu.

Closes #6327
Fixes #6326
Fixes #6403
Fixes #6405

@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch brichet/notebook/left-right-widgets

@jtpio jtpio added this to the 7.0 milestone Jul 26, 2022
@jtpio
Copy link
Member

jtpio commented Jul 26, 2022

Nice thanks @brichet for picking this up 👍

@brichet
Copy link
Contributor Author

brichet commented Aug 3, 2022

Is there a way to retrieve the yarn.lock file generated during the check_release action ?
It seems that it changes, but I can't reproduce it locally.

@jtpio
Copy link
Member

jtpio commented Aug 4, 2022

Is there a way to retrieve the yarn.lock file generated during the check_release action ?
It seems that it changes, but I can't reproduce it locally.

hmm strange, if it changes during the check release then it should also change locally after running jlpm.

@jtpio
Copy link
Member

jtpio commented Aug 4, 2022

Just tried running jlpm in a fresh GitHub Codespace and it does modify the yarn.lock:

image

So these changes to the yarn.lock should be committed and pushed as well.

@brichet
Copy link
Contributor Author

brichet commented Aug 4, 2022

So these changes to the yarn.lock should be committed and pushed as well.

Right, sorry for that, indeed after cleaning everything it changes yarn.lock.

@brichet brichet force-pushed the left-right-widgets branch 2 times, most recently from 7589f6c to b885e7c Compare August 5, 2022 07:05
@brichet
Copy link
Contributor Author

brichet commented Aug 5, 2022

Maybe we could increase the test time. This PR adds some little ui-test, but I think 10 minutest is too short.

@jtpio
Copy link
Member

jtpio commented Aug 5, 2022

Maybe we could increase the test time. This PR adds some little ui-test, but I think 10 minutest is too short.

Hmm normally 10 minutes should be more than enough? Or do the new tests require that much more time?

Here is a screenshot of the cancelled check: https://github.com/jupyter/notebook/runs/7686750791?check_suite_focus=true

image

But on main they take 5 minutes to complete so still plenty of room: https://github.com/jupyter/notebook/runs/7686282650?check_suite_focus=true

image

@brichet
Copy link
Contributor Author

brichet commented Aug 5, 2022

Hmm normally 10 minutes should be more than enough? Or do the new tests require that much more time?

Not that much, they should be really quick, only opening left (toc) and right (notebooktools) panels.

@jtpio
Copy link
Member

jtpio commented Aug 5, 2022

Maybe there is something that makes them time out on CI (normally locally as well) with the new changes?

@brichet
Copy link
Contributor Author

brichet commented Aug 5, 2022

The timeout is quite long, 4 minutes :

timeout: 240000,

When a test fail 2 times (it is retried 1 time) while awaiting a specific screenshot or element, it almost timeout the whole tests.
Is there a reason to have a 4 minutes timeout ? Galata is set to 1 minute by default.

That will not fix the tests but may allow us to get the errors instead of cancelled test.

@jtpio
Copy link
Member

jtpio commented Aug 5, 2022

Is there a reason to have a 4 minutes timeout ?

This was added in jupyterlab/retrolab#273, but I don't see any reason for that particular value. So we can change it and see.

Comment on lines 41 to 43
this.restored = this.shell.restored
.then(() => undefined)
.catch(() => undefined);
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed? Or could this.shell.restored.then() be directly used on the line below?

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe this.restored = this.shell.restored?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, it's left from a copy and paste.
But we should keep this.restored = this.shell.restored. For example, the table of contents extension waits for app to be restored, but needs the Notebook panel to be ready. That's why the shell resolves the restored only when the main area has been added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 52f10ed

@jtpio
Copy link
Member

jtpio commented Aug 8, 2022

Looks like the -darwin snapshot should be removed?

image

@brichet
Copy link
Contributor Author

brichet commented Aug 8, 2022

Looks like the -darwin snapshot should be removed?

Good catch

@brichet
Copy link
Contributor Author

brichet commented Aug 9, 2022

The errors on tests seems not related (save status, kernel status...), maybe we can try running them again.

@jtpio
Copy link
Member

jtpio commented Aug 10, 2022

The errors on tests seems not related (save status, kernel status...), maybe we can try running them again.

Yes these are a bit flaky sometimes.

@jtpio
Copy link
Member

jtpio commented Aug 10, 2022

Just tried on Binder and it looks good.

left-right-areas-shift.mp4

At first it might feel a bit odd that the notebook is shifted to the side when the left or right area is opened. @hbcarlos had some good feedback about this on the original PR: jupyterlab/retrolab#275 (comment)

Posting it here for reference:

I think by default they should be hidden and only show up when the user triggers an action that requires something on the side panel. Also, regarding the design, we could divide the shell into three parts to keep the notebook always in the middle and then create the box panel for the side panels, the shell would be divided like in the following image:

notebook

Probably we could try to change how the side panels are positioned in the NotebookShell. Maybe this could be tried out in a follow-up PR.

For reference Google Docs does shift the main page a bit when opening an add-on on the right side:

google-docs-right-area.mp4

Although their top area takes the full width, which reduces this feel of being "off" since the page is still centered with the top area.

image

@brichet
Copy link
Contributor Author

brichet commented Aug 12, 2022

Nice, thanks for sharing, it would be better that way.
And as in Google Docs, we could use that space to display a button which close the panel.

@brichet
Copy link
Contributor Author

brichet commented Aug 12, 2022

The debugger panel is also missing, but I think it can be added in a follow up PR as well. I'm not sure it will be as easy to include than the other panels, as it depend on current opened widget (notebook, console...).

@jtpio
Copy link
Member

jtpio commented Aug 17, 2022

The debugger panel is also missing, but I think it can be added in a follow up PR as well. I'm not sure it will be as easy to include than the other panels

Agree this can be added in a different PR 👍 Hopefully the extension should already handle the active widget properly, otherwise we can submit fixes upstream in JupyterLab.

@jtpio
Copy link
Member

jtpio commented Aug 17, 2022

FYI @brichet I'm planning to do a pass on the changes, especially the ones on the shell.

Overall it looks good. I would like to experiment with the alternative side-panel approach mentioned above. Will report here when I have more updates.

@brichet
Copy link
Contributor Author

brichet commented Aug 17, 2022

Thanks @jtpio.
Let me know if you want me to give this alternative side panel a try.

@jtpio jtpio force-pushed the left-right-widgets branch 2 times, most recently from f679f3e to a6717a6 Compare October 6, 2022 08:57
@jtpio jtpio marked this pull request as ready for review October 6, 2022 13:36
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Nice thanks @brichet for the hard work and your patience!

We can track follow-up improvements and fixes discussed in the PR in separate issues.

@jtpio jtpio merged commit 62c0fa8 into jupyter:main Oct 6, 2022
@brichet brichet deleted the left-right-widgets branch October 6, 2022 13:45
@jtpio jtpio mentioned this pull request Oct 6, 2022
2 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants