Skip to content

Adopt @microbit/ui's SplitView - #1386

Merged
microbit-matt-hillsdon merged 2 commits into
mainfrom
adopt-ui-split-view
Oct 30, 2026
Merged

microbit-matt-hillsdon merged 2 commits into
mainfrom
adopt-ui-split-view

Conversation

@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator

Upgrade @microbit/ui to 0.6.1 and replace our own SplitView with the
library's, which was loosely based on it.

The look is unchanged: a thin wrapper restyles the splitter with the
existing background, brand grip, z-index and simulator box shadow, and
pins it at 10px (the recipe's spacing token is scaled by the dense
preset). Hover and pressed states match HideSplitViewButton.

Behaviour that comes with the library:

  • The splitter is a focusable WAI-ARIA window splitter with keyboard
    resizing, so it needs an accessible name. Adds sidebar-resize,
    simulator-resize and serial-terminal-resize strings.
  • Drags use pointer capture, so the panes no longer need
    pointer-events: none to stop the simulator iframe swallowing them.
  • The requested size is kept when the window shrinks and restored when
    it grows back.

Worth checking the new splitter tab stops alongside the app's custom tab handling (tabOutRef, sim/serial tab control). New strings need uploading to Crowdin.

Upgrade @microbit/ui to 0.6.1 and replace our own SplitView with the
library's, which was loosely based on it.

The look is unchanged: a thin wrapper restyles the splitter with the
existing background, brand grip, z-index and simulator box shadow, and
pins it at 10px (the recipe's spacing token is scaled by the dense
preset). Hover and pressed states match HideSplitViewButton.

Behaviour that comes with the library:
- The splitter is a focusable WAI-ARIA window splitter with keyboard
  resizing, so it needs an accessible name. Adds sidebar-resize,
  simulator-resize and serial-terminal-resize strings.
- Drags use pointer capture, so the panes no longer need
  pointer-events: none to stop the simulator iframe swallowing them.
- The requested size is kept when the window shrinks and restored when
  it grows back.
@github-actions

Copy link
Copy Markdown

Preview build will be at
https://review-python.microbit.org/adopt-ui-split-view/

The patch covering the button's shadow on the splitter had a fixed
background, so it stood out when the splitter showed its hover or
pressed fill. Follow those fills, with the splitter's transition.
@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator Author

The focus ring looks a bit ugly... perhaps we should do something splitter specific here. But that's one for the UI package to ponder.

@microbit-grace microbit-grace left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

Whilst playing around, spotted that if you move the simulator's vertical split view separator so that the simulator panel is the widest possible size, the middle coding panel becomes hidden but the undo/redo button remains visible and overlays the left panel. Hidden focusable components in the middle coding panel also remain keyboard navigable though visually hidden. I wonder if the middle panel should be fully hidden instead so that the undo/redo button is visually hidden as well and the keyboard navigation in the middle panel is not possible. It seems to also behave this way on live so it's not related to the changes here

Image

@microbit-grace

microbit-grace commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The focus ring looks a bit ugly... perhaps we should do something splitter specific here. But that's one for the UI package to ponder.

Not sure if this is what you were referring to as ugly or if it's important, but found that the focus ring seems to be on top of some components, but under others (see right side of the focus ring which is broken by the simulator collapse button and the serial horizontal splitter) in the simulator panel.

Update: After more pondering, it doesn't really impact the visibility of it and it makes sense that the components are on top, so I think it's ok to leave it as is
Screenshot 2026-10-30 at 13 07 05

@microbit-matt-hillsdon

Copy link
Copy Markdown
Collaborator Author

After more pondering, it doesn't really impact the visibility of it and it makes sense that the components are on top, so I think it's ok to leave it as is

Yeah I think you'd have to pull the idea of expand/collapse buttons into UI to do better here.

This is part of the ugly but I also somehow feel that the offset looks worse here than elsewhere. Trying an inset focus ring might make sense in this odd case (perhaps true of large area focus in general).

@microbit-matt-hillsdon
microbit-matt-hillsdon merged commit d0a9a5a into main Oct 30, 2026
2 checks passed
@microbit-matt-hillsdon
microbit-matt-hillsdon deleted the adopt-ui-split-view branch October 30, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants