Repository navigation
Conversation
AccordionLayout and SplitLayout appended a new section's nodes at the end of the panel and left a moved section's nodes where they were, so Tab and screen readers reached the sections in a different order than the panel shows them. SplitLayout now inserts and moves a section's widget and handle after the previous section's handle, sending the widget detach and attach messages around a move as PanelLayout does, and AccordionLayout puts the title before its widget. Fixes jupyterlab#870
krassowski
reviewed
Nov 25, 2026
Member
There was a problem hiding this comment.
There is a small simplification that we can do but otherwise this looks good, thanks!
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
AccordionPanel.insertWidgetdoes not move the section in the DOM, so the Tab order differs from the visual order #870insertWidget(LabShellrestoring the sidebar section order, and the move-sections plugin from Move sidebar sections up and down without dragging jupyterlab#20498)Code changes
SplitLayout.attachWidgetinserts the widget and handle nodes after the previous section's handle (or first, for index 0) instead of appending them.SplitLayout.moveWidgetnow moves the widget and handle nodes to the same place.AccordionLayout.attachWidgetandmoveWidgetput the title right before its widget after the split layout has placed it. The title is still in the DOM before the widget'safter-attach, as before.SplitLayout._sectionReference(index)finds the node a section goes before. The API report does not change.User-facing changes
Tab and screen readers now reach accordion and split panel sections in the order the panel shows them. With the snippet from #870:
maininsertWidget(2, c)A B C D, DOMA B D CA B C D, DOMA B C DinsertWidget(0, panel.widgets[3])D A B C, DOMA B D CD A B C, DOMD A B CTests: one for
AccordionPanelwith the snippet from the issue, and forAccordionLayoutandSplitLayout, the full order of titles, widgets and handles after inserts at the start and in the middle, after moves to the start and the end, and the messages sent on a move. Thesixfive new tests fail onmain(979980 passed,65 failed) and pass here (985 passed) in Chromium;eslint,prettier --checkandyarn apiare clean.Backwards-incompatible changes
None in the API. Moving a section of a
SplitPanelorAccordionPanelnowdetaches and re-attaches its widget in the DOM, with the matching messages,moves its nodes in the DOM, which it did not before. Code that moved these nodes by hand to work around this, like JupyterLab's, still ends with the same order.AI usage