-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: plugin sizing updates #902
Conversation
shell/src/PluginLoader.jsx
Outdated
const [resizePluginHeight, setResizePluginHeight] = useState(null) | ||
const [resizePluginWidth, setResizePluginWidth] = useState(null) | ||
const [pluginClientWidth, setPluginClientWidth] = useState(null) |
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.
Maybe we could add comments explaining the difference between clientWidth
, resizePluginWidth
, and pluginClientWidth
? The names are a bit confusing if you don't have much context
|
# [12.1.0](v12.0.0...v12.1.0) (2025-01-23) ### Features * plugin sizing updates ([#902](#902)) ([1136e0d](1136e0d))
🎉 This PR is included in version 12.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Supports easier-to-use plugin sizing and improves performance. Should be paired with app-runtime >=3.13.0. See https://dhis2.atlassian.net/browse/LIBS-723 * feat(plugin): simpler sizing; content-driven size without animation loop * fix(plugins): remove scrollbar padding * fix: resize dif references
Address LIBS-723
Requires app-runtime changes (dhis2/app-runtime#1398)
width: auto
width: auto
, sowidth: 100%
is currently used -- margins don't work as expected in this case thoughwidth: auto
behavior could work with a<div>
around theiframe
, where thediv
uses theauto
width and the iframe useswidth: 100%
to match that sizePlugin
component's JSX, but it messes with flex styles, so I wrote up some guidance on how to get the right margin behavior insteadclassName
prop to<Plugin>
and the underlying iframecontentWidth
prop is used on thePlugin
component, then the width of the iframe will be based off the contents insideoffsetHeight
should measure a scrollbar heightI used patch-package to make it easier to test this out with app-runtime changes. I made 6 test cases in a component in the simple app to use:
height: 100%
Screen.Recording.2024-12-17.at.14.20.12.mov
To do and known issues
Before review:
div
around iframe to get default 'auto' width of divs (and iframe has width(/height?) 100% by default). Update: tried this out, and it makes the right behavior forwidth: auto
, but breaks other height behaviors. I don't think it's worth doingAfter review: