Skip to content

Conversation

@sfc-gh-nbellante
Copy link
Contributor

@sfc-gh-nbellante sfc-gh-nbellante commented Oct 23, 2024

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

Kapture 2024-10-23 at 13 44 12

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.

@sfc-gh-nbellante sfc-gh-nbellante changed the title prototype for vega charts [WIP] prototype for fullscreen button in toolbar for vega charts Oct 23, 2024
@sfc-gh-nbellante sfc-gh-nbellante added security-assessment-completed Security assessment has been completed for PR change:refactor PR contains code refactoring without behavior change impact:users PR changes affect end users labels Oct 23, 2024
@sfc-gh-nbellante sfc-gh-nbellante force-pushed the nico/vega-fullscreen-button-to-toolbar branch from 13bb7d3 to a9a03d0 Compare October 28, 2024 23:30
@sfc-gh-nbellante sfc-gh-nbellante changed the title [WIP] prototype for fullscreen button in toolbar for vega charts [WIP] prototype for fullscreen button in toolbar for remaining components Oct 29, 2024
@sfc-gh-nbellante sfc-gh-nbellante changed the title [WIP] prototype for fullscreen button in toolbar for remaining components Use toolbar for fullscreen button Oct 29, 2024
@sfc-gh-nbellante sfc-gh-nbellante marked this pull request as ready for review October 29, 2024 21:31
Copy link
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco left a 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.

Copy link
Collaborator

@sfc-gh-bnisco sfc-gh-bnisco left a 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!

Copy link
Collaborator

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.

Copy link
Contributor Author

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 🤔

Copy link
Contributor Author

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 :(

Copy link
Collaborator

@lukasmasuch lukasmasuch left a 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.

@sfc-gh-nbellante sfc-gh-nbellante force-pushed the nico/vega-fullscreen-button-to-toolbar branch from 45decc5 to d2cb807 Compare October 30, 2024 19:09
@sfc-gh-nbellante
Copy link
Contributor Author

sfc-gh-nbellante commented Oct 30, 2024

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.

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?

@sfc-gh-nbellante sfc-gh-nbellante merged commit 09b30b9 into develop Oct 30, 2024
@sfc-gh-nbellante sfc-gh-nbellante deleted the nico/vega-fullscreen-button-to-toolbar branch October 30, 2024 20:26
@lukasmasuch
Copy link
Collaborator

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.

edegp pushed a commit to edegp/streamlit that referenced this pull request Jan 19, 2025
## 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`

![Kapture 2024-10-23 at 13 44
12](https://github.com/user-attachments/assets/47bba816-0ae0-4dca-8814-d370aab71cb1)


## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:refactor PR contains code refactoring without behavior change impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants