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

Add the command to toggle the virtual scrollbar to the palette #16322

Merged
merged 3 commits into from
May 22, 2024

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented May 13, 2024

References

This makes it easier to toggle the virtual scrollbar with the keyboard only.

Code changes

Add the notebook:toggle-virtual-scrollbar command to the command palette

User-facing changes

Before

image

After

image

image

Backwards-incompatible changes

None

Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@jtpio jtpio added this to the 4.2.x milestone May 13, 2024
@jtpio jtpio added the bug label May 13, 2024
@jtpio jtpio marked this pull request as ready for review May 14, 2024 07:20
@jtpio jtpio requested a review from afshin May 14, 2024 07:22
@krassowski
Copy link
Member

Should we adjust the label to "Toggle Virtual Scrollbar" when used from palette? Or maybe in general? In that case this would need to target 4.3.x to avoid breaking translations.

@jtpio
Copy link
Member Author

jtpio commented May 16, 2024

Should we adjust the label to "Toggle Virtual Scrollbar" when used from palette? Or maybe in general? In that case this would need to target 4.3.x to avoid breaking translations.

It looks like other commands don't have the word "Toggle" in their label:

image

However some commands use the word "Show", such as "Show Line Numbers", which then uses a checkbox when the lines are displayed:

image

image

Would it make sense to do something similar for the virtual scrollbar?

@krassowski
Copy link
Member

Yes, it makes sense yo me. It is more of a suggestion on making it easier for user to understand what this command is supposed to do, I do not want to block merging on this here, and if you wanted to backport this to 4.2.x the label could be adjusted in a follow up which would target 4.3.0

@jtpio
Copy link
Member Author

jtpio commented May 17, 2024

Maybe there is no hurry to get this in a 4.2.x release and we can take the time to adjust the label correctly.

@jtpio jtpio added enhancement and removed bug labels May 17, 2024
@jtpio jtpio modified the milestones: 4.2.x, 4.3.0 May 17, 2024
@jtpio jtpio marked this pull request as draft May 17, 2024 06:54
@jtpio jtpio force-pushed the virtual-scrollbar-palette branch from 909ae90 to 2084370 Compare May 17, 2024 06:57
@jtpio jtpio marked this pull request as ready for review May 17, 2024 07:49
@jtpio jtpio requested review from krassowski and afshin May 17, 2024 13:03
@@ -3554,6 +3554,10 @@ function addCommands(
(settings?.composite.windowingMode === 'full' ?? false);
return enabled;
},
isToggled: () => {
const current = tracker.currentWidget;
Copy link
Member

Choose a reason for hiding this comment

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

Should we use getCurrent here for consistency?

Suggested change
const current = tracker.currentWidget;
const current = getCurrent(tracker, shell, args);

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this was the case at some point while iterating on this PR, but it was creating some issues because of the activate logic in that function, which was preventing switching to another widget in the dock panel:

const activate = args['activate'] !== false;
if (activate && widget) {
shell.activateById(widget.id);
}

Copy link
Member

Choose a reason for hiding this comment

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

Ok, thanks for the clarification!

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Thank you!

@krassowski krassowski merged commit 3079730 into jupyterlab:main May 22, 2024
82 checks passed
@jtpio jtpio deleted the virtual-scrollbar-palette branch May 22, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants