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

Bring jupyterlab-recents into the core #76

Closed
wants to merge 41 commits into from

Conversation

krassowski
Copy link
Owner

@krassowski krassowski commented Nov 30, 2023

References

TODO:

  • implement recentlyClosed
  • add "Reopen Recently Closed Notebook/File" to menu (ctrl + shift + t)
  • implement a modal/popover searchable for selecting recently closed tabs
  • maybe add recently closed to running section
  • remove from recents list once opened/re-opened?
  • galata tests

Code changes

Compared to jupyterlab-recents extension:

  • remove polling for validation of paths; this was generating many background requests and was deemed undesirable overhead if we were to increase the number of requests by a factor of 10 (even though these were lightweight GET requests)
  • do not send a get request to fetch the model/content type of the document for the that the user switch to - we already have it available at hand now thanks to integration directly into docmanager (this is not public/not emitted by the signal which is why the extension had to have this sub-optimal implementation)
  • path validation is now conducted when opening the sub-menu, and when clicking on the file, limiting any overhead to the users of the feature
  • when an item is discovered to be invalid after submenu was opened it will not be removed but greyed out to avoid jitter and user accidentally clicking a wrong item
  • split recents into "recently opened" and "recently closed"
  • use IFileBrowserCommands to explicitly depend on the availability of the filebrowser to open directories (and to fallback to document manager command if filebrowser does not provide such token

Because rather than adding a new package the extension gets integrated on the lower level by adding separate plugins to relevant existing packages (document manager, main menu) merging git history did no make much sense; instead the autorship was preserved by using Co-authored-by feature.

User-facing changes

Open Recent submenu

image

Recently closed in the sidebar

image

Reopen modal

reopen-widget-2

Backwards-incompatible changes

None.

File browsers are encouraged to implement IFileBrowserCommands which was previously a no-op; if they don't then the recents menu will not show the directories.

@@ -121,7 +121,17 @@ export namespace IFileBrowserFactory {
/**
* The token that indicates the default file browser commands are loaded.
*/
export const IFileBrowserCommands = new Token<void>(
export const IFileBrowserCommands = new Token<IFileBrowserCommands>(
Copy link
Owner Author

Choose a reason for hiding this comment

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

TODO should it be?

Suggested change
export const IFileBrowserCommands = new Token<IFileBrowserCommands>(
export const IFileBrowserCommands = new Token<IFileBrowserCommands | void>(

krassowski and others added 5 commits December 4, 2023 00:22
Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
Co-authored-by: Shreyas Cholia <shreyas@gmail.com>
Co-authored-by: Matt Henderson <mhenderson@lbl.gov>
Co-authored-by: Trevor Slaton <trevor.slaton@gmail.com>
Co-authored-by: Adrien Delsalle <ad.delsalle@gmail.com>
The cycle was introduced by removing void on returned Promise.
Because void operator returns undefined, the promise on
`IFileBrowserCommands` was never awaited (on main branch)
which meant that `@jupyterlab/filebrowser-extension:widget`
(the only dependant of commands token) was able to initialise
as soon as the commands were activated (not waiting for the
reveal/settings promises cascade); this commits restores
ignoring the result of the promise and instead returns
the command mapping after the promise was invoked.
Move type to `Private`, add docstrings

Automatic application of license header
krassowski and others added 11 commits March 15, 2024 14:48
* Fix manager isDisposed is not set

* Check the current code is buggy

* Re apply the fix and lint

* Lint the code
Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
* Re-organise the kernel tree in sidebar

* Implement list view and toggle, improve buttons state

* Slightly reduce size of collapse/expand icons

* Also open menu over widget entries (children of kernels)

this makes the menu accessible in the list view

* Implement toggle memory for list/view switch

* Fix button state initialization

* Simplify state setup for buttons

* Integrity lint

* Update selectors in tests

* Fix selector in test

* Fix buttons behaviour when resizing down

* Add a timeout in test, update one snapshot

* Use icons from ToC, make kernel ID grey

* Make it only one collapse/expand button

* Update snapshots

* Freeze kernel IDs for snapshots

* Update snapshots

* Fix tooltip label
Before this commit we had two very similar snapshots:
- interface-tabs-documentation-linux.png
- running-layout-documentation-linux.png

both showing "open tabs" and "kernels" sections.
After this commit the former now only shows "open tabs"
reducing the burden reviewing snapshots when kernels
are flaky or when kernels section changes
github-actions bot and others added 2 commits March 21, 2024 11:30
@krassowski krassowski closed this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment