Repository navigation
Use React button component for open/close left/right panel toggle. - #1980
jamesmisson wants to merge 18 commits into
Conversation
|
@jamesmisson is attempting to deploy a commit to the Universal Viewer Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
LanieOkorodudu
left a comment
There was a problem hiding this comment.
This looks great @jamesmisson. Thank you so much for your work.
demiankatz
left a comment
There was a problem hiding this comment.
Thanks, @jamesmisson; due to the holiday I haven't had a chance to do hands-on testing or a really deep review yet, but the code looks pretty good at a glance. See below for one suggestion that immediately sprang to mind, though!
| } | ||
| } | ||
|
|
||
| // overflow: visible is necessary for the tooltip to appear over the top of .rightPanel, unclipped, |
There was a problem hiding this comment.
Given that left and right panel have a lot of complex styling that requires detailed comments, and given that it seems to be the same for both of them, is it possible we need a side-panel.less that left and right panel both inherit from, so we can centralize the complexity and prevent things from getting out of sync in future?
Pull request description
Summary of changes
This implements the new React button component for the left and right panel toggles:
collapseButton,expandButton.I've used the existing
$collapseButtonand$expandButtonelements as react roots. It's required some rewriting of the css to position the buttons and the vertical text on the closed panels.The buttons are still rendered by the
BaseExpandPanelclass, but obviously they need to look/behave different for the left and right panels, so I've used a pattern that sets a method on the base class (defaulting to the left panel), and then overriding this in the right panel class that inherits it. This applies to the new methodsgetToggleTooltipPlacement,getExpandIcon, andgetCollapseIcon.I've added new icons for the toggles. I've taken the icon we settled on in #1804 and made versions in UV's current brutalist icon style. Keeping the same size, proportions and conventions as the other icons, these come up pretty small, so I'm not totally convinced about them (I tried a few variants - this was the best without breaking the rules of the icon style).
I've noticed that the React buttons take a noticeably longer time to load than the previous buttons - probably to be expected. We should look in to how to manage this without layout shifts on start-up.
Related issues
#1816
Contributor checklist
Accessibility & internationalisation
Compatibility & interoperability
IIIF compatibility: Changes have been tested against relevant IIIF Presentation and Image API resources, with no known regressions in supported functionality.
Extension compatibility: Changes have been checked for compatibility with existing Universal Viewer extensions and extension points.
Backwards compatibility: Changes do not unintentionally break existing public APIs, integrations or configuration options.
Browser & device compatibility: Changes have been tested across relevant supported browsers, devices and screen sizes, including responsive layouts.
tested in Chrome and Firefox but not on a tablet.
Code quality & testing
Configuration & documentation
Additional notes for reviewers: