fix(shell-panel): reset resize state when layout changes - #14364
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts calcite-sheet and calcite-shell-panel interaction lifecycle so that when interactions are reset (e.g., after reconnecting or reinitializing interact.js), the components can re-read and apply the latest token/CSS-based dimensions rather than continuing to operate on stale overridden sizes.
Changes:
- Gate
setupInteractions()inconnectedCallback()so it only runs on re-connect (whenhasUpdatedis already true). - Clear any inline/block size overrides during
cleanupInteractions()so a subsequent interaction setup uses fresh computed dimensions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/components/src/components/shell-panel/shell-panel.tsx | Reinitialize interactions on reconnect and clear size overrides during interaction cleanup so resets can pick up updated dimensions. |
| packages/components/src/components/sheet/sheet.tsx | Avoid setting up interactions before first render on connect, and clear size overrides during interaction cleanup to ensure resets use updated computed dimensions. |
|
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
2a11bba to
ae48599
Compare
layout changes
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
packages/components/src/components/shell-panel/shell-panel.tsx:235
- blocking:
disconnectedCallback()also overrides Lit’s hook without callingsuper.disconnectedCallback(), so controllers won’t receivehostDisconnectedand may leave behind listeners/observers. Addsuper.disconnectedCallback()and keepcleanUpInteractions()alongside it.
override disconnectedCallback(): void {
this.cleanUpInteractions();
}
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| private cleanUpInteractions(): void { | ||
| this.interaction?.unset(); | ||
| } |
There was a problem hiding this comment.
I'll update the rest in a follow-up PR. It should be cleanUp (verb) rather than cleanup (noun).
There was a problem hiding this comment.
Yeah, this is my bad I'm sure :)
There was a problem hiding this comment.
lol not pointing fingers, just appeasing my pedantry. 😂
| private cleanUpInteractions(): void { | ||
| this.interaction?.unset(); | ||
| } |
There was a problem hiding this comment.
Yeah, this is my bad I'm sure :)
**Related Issue:** N/A ## Summary Aligns with changes from #14364.
Related Issue: #13986
Summary
This addresses an issue where the resize state would be applied when the layout changed from
horizontaltoverticaland vice versa, leading to an incompatible size after the layout change.Notable changes
willUpdate