-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adds quick settings button to the new launcher #52
Conversation
@krassowski, I still need to add testing, but could you take a look when you get a chance. I think all the functionality is here for this one. There is one issue where the command for opening the settings editor for the new launcher only works if no default settings have been changed. Otherwise it opens the settings editor, but not to the New Launcher settings. Any idea what could be causing that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @andrewfulton9! I left a few suggestions.
I see what you mean about the query
not having much of an effect if settings editor is already open. I would call this an upstream bug in JupyterLab, as it also affects jupyter-ai and other places where this command is used with query
. I opened jupyterlab/jupyterlab#16479 to track it (we may want to address it or let it hang as a good first issue for a while, in any case it should not block this PR).
x = event.clientX; | ||
y = event.clientY; | ||
} | ||
menu.open(x, y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the menu is positioned within the browser window:
I wonder if it would be nicer if it was positioned relative to the launcher body or the button. You can pass a third argument to menu.open()
with Menu.IOpenOptions
object. Once jupyterlab/lumino#700 is released we will be able to pass a custom host
but for now we could only try using forceX
to improve the positioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It currently should be positioned to the button. It's just shifting the menu so it fits in the window. This is what it looks like when the panel isn't directly next the edge of the window:
If I use forceX
the part of the menu isn't viewable which I think may be worse:
I wonder if there is a way to align it so the top-right corner of the menu aligns with the bottom right corner of the button. In my opinion that would look the cleanest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align it so the top-right corner of the menu aligns with the bottom right corner of the button. In my opinion that would look the cleanest.
💯 agree. There is no way as of today. Can you open a feature request on lumino, and another issue here to track it as a follow-up enhancement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I opened Lumino#709 for this
src/components/quick-settings.tsx
Outdated
command: 'settingeditor:open', | ||
args: { query: 'New Launcher' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
@krassowski, I added playwright tests and I think this is ready for another review when you get a chance |
expect(await launcher.screenshot()).toMatchSnapshot( | ||
'launcher_show_starred_from_quicksettings.png' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to drop this screenshot comparison and instead add something like:
const starredSection = page.locator('.jp-CollapsibleSection-Title:has-text("Starred")')
await expect(starredSection).toBeVisible();
(I have not tested these lines so they may need adjusting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this as flaky. We already have one snapshot for this state, testing by locator visibility should be sufficient and easier to maintain long term :)
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @andrewfulton9, looks great!
Reference Issues or PRs
closes number #9
What does
this
implement/fix?Adds a quick settings button to the new launcher
Put a
x
in the boxes that applyTesting
Note that the query parameter for the command to open the settings editor only works if the default settings are in place
Documentation
Access-centered content checklist
Text styling
H1
or#
in markdown).Non-text content
Any other comments?