-
Notifications
You must be signed in to change notification settings - Fork 4k
Use toolbar for fullscreen button #9721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use toolbar for fullscreen button #9721
Conversation
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx
Fixed
Show fixed
Hide fixed
13bb7d3 to
a9a03d0
Compare
sfc-gh-bnisco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good! Nice job simplifying this code even further! I have a few small suggestions inline.
frontend/lib/src/components/elements/ArrowVegaLiteChart/styled-components.ts
Outdated
Show resolved
Hide resolved
sfc-gh-bnisco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, thanks for the iterations!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove all the traces of StyledFullScreenButton within this file since it is not anymore used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good callout -- i wonder i there's a way to get eslint to complain about that 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could not find a good way. i found a project that uses typescripts ast (ts-prune) but it was so slow i couldn't even get it to finish on a subset of our repo :(
lukasmasuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 One potential small simplification: the toolbar component itself could also use context to correctly set the onExpand, onCollapse and isFullscreen for the fullscreen toolbar action button (if disableFullscreenMode == False). This would allow us to remove these props from Toolbar itself.
…hat was breaking tests
45decc5 to
d2cb807
Compare
My concern with doing that is that the toolbar then could only be used when it's a descendent of that context provider. Which, right now the only component that would break is the AudioInput, but it felt like a confusing coupling to make. Wdyt? Edit: I guess we could modify things such that we allow the context not being there when the disableFullscreenMode is true? |
Yep, I think we could only use the context within toolbar if the fullscreen mode is actually active. The other alternative might be to have a base Toolbar Component that doesn't include any fullscreen aspects and a FullscreenToolbar that uses Toolbar and adds the toolbar action + uses the context. |
## Describe your changes This PR: - removes the old `FullScreenWrapper` - changes the `withFullScreenWrapper` to instead use the newly created `ElementFullscreenWrapper` - brings fullscreen toolbar functionality and standardizes pattern across `DeckGIJsonChart`, `ArrowVegaLiteChart`, `ImageList`, `PlotlyChart`, `DataFrame`  ## Testing Plan automated tests updated --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Describe your changes
This PR:
FullScreenWrapperwithFullScreenWrapperto instead use the newly createdElementFullscreenWrapperDeckGIJsonChart,ArrowVegaLiteChart,ImageList,PlotlyChart,DataFrameTesting Plan
automated tests updated
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.