Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3604,9 +3604,7 @@ function addCommands(

commands.addCommand(CommandIDs.virtualScrollbar, {
label: trans.__('Show Minimap'),
caption: trans.__(
'Show Minimap (virtual scrollbar, enabled with windowing mode: full)'
),
caption: trans.__('Show Minimap'),
execute: args => {
const current = getCurrent(tracker, shell, args);

Expand All @@ -3616,20 +3614,14 @@ function addCommands(
},
icon: args => (args.toolbar ? tableRowsIcon : undefined),
isEnabled: args => {
const enabled =
(args.toolbar ? true : isEnabled()) &&
(settings?.composite.windowingMode === 'full' ?? false);
return enabled;
return args.toolbar ? true : isEnabled();
},
isToggled: () => {
const current = tracker.currentWidget;
return current?.content.scrollbar ?? false;
},
isVisible: args => {
const visible =
(args.toolbar ? true : isEnabled()) &&
(settings?.composite.windowingMode === 'full' ?? false);
return visible;
return args.toolbar ? true : isEnabled();
}
});

Expand Down
14 changes: 3 additions & 11 deletions packages/ui-components/src/components/windowedlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,17 +452,9 @@ export abstract class WindowedListModel implements WindowedList.IModel {
* @returns The current items range to display
*/
getRangeToRender(): WindowedList.WindowIndex | null {
let newWindowIndex: [number, number, number, number] = [
0,
Math.max(this.widgetCount - 1, -1),
0,
Math.max(this.widgetCount - 1, -1)
];
const newWindowIndex = this._getRangeToRender();

const previousLastMeasuredIndex = this._measuredAllUntilIndex;
if (this.windowingActive) {
newWindowIndex = this._getRangeToRender();
}
const [startIndex, stopIndex] = newWindowIndex;

if (
Expand Down Expand Up @@ -1824,10 +1816,10 @@ export class WindowedLayout extends PanelLayout {
*
* #### Notes
* This is a reimplementation of the base class method,
* and is a no-op.
*/
protected onUpdateRequest(msg: Message): void {
// This is a no-op.
// @ts-ignore
this.parent?._update();
Copy link
Author

Choose a reason for hiding this comment

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

This is obviously hacky.

We can't call this.parent.update() since it would result in an infinite update loop.

Happy to discuss a better approach though. Maybe introducing a new public rerender method in the parent?

Copy link
Owner

Choose a reason for hiding this comment

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

I think adding rerender sounds fine if required.

}
}

Expand Down
Loading