Open
Conversation
axelboc
commented
Mar 18, 2026
Comment on lines
+16
to
+17
| await expect | ||
| .element(page.getByRole('treeitem', { name: 'source.h5' })) |
Contributor
Author
There was a problem hiding this comment.
Has to be async because of the local isSidebarOpen state synchronisation.
| data-fullscreen-root | ||
| data-allow-dark-mode={disableDarkMode ? undefined : ''} | ||
| orientation="vertical" | ||
| data-sidebar-collapsed={!isSidebarOpen || undefined} |
Contributor
Author
There was a problem hiding this comment.
This is to actually hide the content of the sidebar with CSS when the sidebar is collapsed.
Comment on lines
+56
to
+58
| const { defaultLayout, onLayoutChanged } = useDefaultLayout({ | ||
| id: 'h5web:layout', | ||
| }); |
Contributor
Author
There was a problem hiding this comment.
This hook provides local storage persistence.
| (isNowOpen && !isSidebarOpen) || | ||
| (!isNowOpen && isSidebarOpen) | ||
| ) { | ||
| setSidebarOpen(isNowOpen); |
Contributor
Author
There was a problem hiding this comment.
The condition is to avoid unnecessary re-renders while resizing.
| @@ -1,3 +1,2 @@ | |||
| /* Global app styles for demo */ | |||
| @import 'react-reflex/styles.css'; | |||
Contributor
Author
There was a problem hiding this comment.
No more global styles 🎉
| setupFiles: 'src/setupTests.ts', | ||
| restoreMocks: true, | ||
| pool: 'threads', | ||
| testTimeout: 10_000, |
Contributor
Author
There was a problem hiding this comment.
It's 15s by default, which I find to be quite long when debugging failing tests locally. Don't want to set it too low, though, even if our longest test lasts only about 4s.
Contributor
Author
|
/approve |
0ac85c8 to
ce38486
Compare
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.
I'm replacing react-reflex with react-resizable-panels, a much more modern and featureful library.
With a very reasonable amount of code, we get the following features:
Screencast.from.2026-03-18.10-03-54.webm
Screencast.from.2026-03-18.10-04-27.webm
I made the splitter a bit more subtle than before, but it still has a 6px target area. I tried to replicate the style of splitters in VS Code: it expands on hover after a slight delay.
The main challenge is that
react-sizable-panelsprovides an uncontrolled API. Because of this, it was a bit tricky to maintain the localisSidebarOpenstate in sync (for the toggle sidebar button, breadcrumbs, etc.) while also continuing to support thesidebarOpenprop (which, if you recall, allows to render the viewer with the sidebar collapsed by default when embedded in the Data Portal).