Skip to content

fix(shell-panel): reset resize state when layout changes - #14364

Merged
jcfranco merged 4 commits into
devfrom
jcfranco/13986-use-updated-dimensions-on-interaction-reset
May 19, 2026
Merged

fix(shell-panel): reset resize state when layout changes#14364
jcfranco merged 4 commits into
devfrom
jcfranco/13986-use-updated-dimensions-on-interaction-reset

Conversation

@jcfranco

@jcfranco jcfranco commented May 1, 2026

Copy link
Copy Markdown
Member

Related Issue: #13986

Summary

This addresses an issue where the resize state would be applied when the layout changed from horizontal to vertical and vice versa, leading to an incompatible size after the layout change.

Notable changes

  • moves interaction setup/teardown to willUpdate
  • uses ref to store handle element
  • revisit resize interaction naming
  • cleans up test

@jcfranco
jcfranco requested a review from Copilot May 1, 2026 19:26
@github-actions github-actions Bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label May 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() in connectedCallback() so it only runs on re-connect (when hasUpdated is 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.

Comment thread packages/components/src/components/shell-panel/shell-panel.tsx Outdated
Comment thread packages/components/src/components/sheet/sheet.tsx Outdated
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the Stale Issues or pull requests that have not had recent activity. label May 9, 2026
@jcfranco
jcfranco requested a review from Copilot May 11, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

Comment thread packages/components/src/components/shell-panel/shell-panel.tsx
Comment thread packages/components/src/components/sheet/sheet.tsx
Comment thread packages/components/src/components/sheet/sheet.tsx Outdated
Comment thread packages/components/src/components/shell-panel/shell-panel.tsx Outdated
@github-actions github-actions Bot removed the Stale Issues or pull requests that have not had recent activity. label May 15, 2026
@jcfranco
jcfranco requested a review from Copilot May 15, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread packages/components/src/components/shell-panel/shell-panel.tsx
Comment thread packages/components/src/components/sheet/sheet.tsx
Comment thread packages/components/src/components/shell-panel/shell-panel.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread packages/components/src/components/shell-panel/shell-panel.tsx
Comment thread packages/components/src/components/sheet/sheet.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

@jcfranco
jcfranco requested a review from Copilot May 19, 2026 21:46
@jcfranco jcfranco added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread packages/components/src/components/shell-panel/shell-panel.tsx
Comment thread packages/components/src/components/sheet/sheet.tsx Outdated
@jcfranco jcfranco changed the title fix(sheet, shell-panel): use updated dimensions on interaction reset fix(shell-panel): use updated dimensions on interaction reset May 19, 2026
@jcfranco
jcfranco force-pushed the jcfranco/13986-use-updated-dimensions-on-interaction-reset branch from 2a11bba to ae48599 Compare May 19, 2026 22:20
@jcfranco
jcfranco requested a review from Copilot May 19, 2026 22:21
@jcfranco jcfranco changed the title fix(shell-panel): use updated dimensions on interaction reset fix(shell-panel): reset resize state when layout changes May 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread packages/components/src/components/shell-panel/shell-panel.tsx
Comment thread packages/components/src/components/shell-panel/shell-panel.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 calling super.disconnectedCallback(), so controllers won’t receive hostDisconnected and may leave behind listeners/observers. Add super.disconnectedCallback() and keep cleanUpInteractions() alongside it.
  override disconnectedCallback(): void {
    this.cleanUpInteractions();
  }

Comment thread packages/components/src/components/shell-panel/shell-panel.tsx
Comment thread packages/components/src/components/shell-panel/shell-panel.tsx Outdated
jcfranco and others added 2 commits May 19, 2026 15:41
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines +325 to 327
private cleanUpInteractions(): void {
this.interaction?.unset();
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the rest in a follow-up PR. It should be cleanUp (verb) rather than cleanup (noun).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is my bad I'm sure :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol not pointing fingers, just appeasing my pedantry. 😂

@jcfranco
jcfranco marked this pull request as ready for review May 19, 2026 23:02
@jcfranco
jcfranco requested review from Elijbet and driskull May 19, 2026 23:03

@driskull driskull left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🍻

Comment on lines +325 to 327
private cleanUpInteractions(): void {
this.interaction?.unset();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is my bad I'm sure :)

@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 19, 2026
@jcfranco
jcfranco merged commit 00dc777 into dev May 19, 2026
22 checks passed
@jcfranco
jcfranco deleted the jcfranco/13986-use-updated-dimensions-on-interaction-reset branch May 19, 2026 23:44
jcfranco added a commit that referenced this pull request May 28, 2026
**Related Issue:** N/A

## Summary

Aligns with changes from
#14364.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants