You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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.
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](https://private-user-images.githubusercontent.com/13416971/302932750-61b65700-6681-4e89-814e-0ad1d98fcfcb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg0NDAyODcsIm5iZiI6MTcxODQzOTk4NywicGF0aCI6Ii8xMzQxNjk3MS8zMDI5MzI3NTAtNjFiNjU3MDAtNjY4MS00ZTg5LTgxNGUtMGFkMWQ5OGZjZmNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE1VDA4MjYyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU1Yjg0Mjk3YTJkMzllZjA4NmFkMmJhZTQ4NDM0Y2FhMmM4ZjYzMDU3NTlmYzA5OTZmNDIwNTdjNjVhNTk0NTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.GopK7w0t5tiMq_xh5-x9oVq5J7HJa7CvcFFee6BsWwo)
After (with jupyterlab-friendly-traceback):
![after](https://private-user-images.githubusercontent.com/13416971/302932851-08494037-9c93-46a8-bc29-469630292131.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg0NDAyODcsIm5iZiI6MTcxODQzOTk4NywicGF0aCI6Ii8xMzQxNjk3MS8zMDI5MzI4NTEtMDg0OTQwMzctOWM5My00NmE4LWJjMjktNDY5NjMwMjkyMTMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE1VDA4MjYyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVlMzMwYmZjYjRiZTU5Zjg4YjY4MWU3OGRmYjJhZmJhNGM4NTU2ZGIwMDE1NTA2MjMwMzliODUyODU4NzUyN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pUXltU-qAt3FqKT1sQMUUMF6KqceZq_xFpQOM9gZn8w)
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
The text was updated successfully, but these errors were encountered: