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

Inconsistency in the toolbar #15758

Closed
djangoliv opened this issue Feb 7, 2024 · 3 comments · Fixed by #15843
Closed

Inconsistency in the toolbar #15758

djangoliv opened this issue Feb 7, 2024 · 3 comments · Fixed by #15843
Assignees
Labels
Milestone

Comments

@djangoliv
Copy link

djangoliv commented Feb 7, 2024

Description

Since jupyterlab 4.1.0, I noticed inconsistencies when adding buttons (with panel.toolbar.insertItem, panel.toolbar.insertAfter and panel.toolbar.inserBefore) in the toolbar.

Reproduce

Create an extension adding a button with panel.toolbar.insertItem or panel.toolbar.insertAfter in the toolbar and toggle from full screen to half screen, and you will see differences in the order of the buttons.

A more simple example is to install https://github.com/logilab/jupyterlab-friendly-traceback/ which add a button with insert Item here: https://github.com/logilab/jupyterlab-friendly-traceback/blob/f62c03af0355437269559da07ffb8773eb3c7eda/src/index.ts#L68

Before (without jupyterlab-friendly-traceback) :
before

After (with jupyterlab-friendly-traceback):
after

Expected behavior

Stability even after adding button with extension.

Context

Jupyterlab 4.1.0 on firefox 122.0 (64 bits) on debian bookworm with i3.

Thanks and regards

@djangoliv djangoliv added the bug label Feb 7, 2024
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Feb 7, 2024
@krassowski krassowski added this to the 4.1.x milestone Feb 7, 2024
@JasonWeill
Copy link
Contributor

This looks similar to #15509, which was reported as fixed in 4.1.x, but which seems to be recurring

@mbektas
Copy link
Member

mbektas commented Feb 20, 2024

issue probably caused by this commit which defaults to position zero when reference item is not found. It used to return false if not found. Some extensions use this logic to try inserts. for example debugger button may not be available right away and insert is tried with other reference etc. cc. @brichet

@brichet brichet self-assigned this Feb 21, 2024
@brichet
Copy link
Contributor

brichet commented Feb 21, 2024

Thanks @djangoliv for opening this issue.
For reference the same issue was already mentioned here #15676

@mbektas thanks for the link, the issue probably comes from that commit.
I think the order of the items is not properly saved when an item is inserted in the toolbar.
It does not compute the position of the following items, which result in several item with the same position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants