Skip to content

Conversation

@gribnoysup
Copy link
Collaborator

@gribnoysup gribnoysup commented Aug 13, 2025

I was playing around in the branch that adds AI assistant and spotted two pretty obvious issues I missed when initially adding the declarative drawer interface

  • When switching between sections in toolbar, the content wouldn't get rerendered because the portal rendering logic we have wasn't accounting for mutated nodes (as opposed to nodes being added / removed). We can track attributes changes in the mutation observer, but a bit more straightforward way of dealing with this is to force React to re-mount the section via the key prop on the anchor element.
  • We are adding sections to the toolbar data dynamically, based on the page context. When there's only one section and it is removed, our code handles removing the drawer completely just fine, but when an open section gets removed and there are more sections than one, Leafygreen component doesn't really handle it in any special way and the drawer stays open showing nothing. I reported this to leafygreen and for now opting for an easy fix that closes the drawer if there's no content to render. I'll keep an eye on how exactly they are planning to resolve this on their end and will update our fix if needed to align the behaviors

@gribnoysup gribnoysup requested a review from a team as a code owner August 13, 2025 12:22
@gribnoysup gribnoysup added the no release notes Fix or feature not for release notes label Aug 13, 2025
@github-actions github-actions bot added the fix label Aug 13, 2025
@gribnoysup gribnoysup added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Aug 13, 2025
@gribnoysup gribnoysup merged commit 15429e1 into main Aug 13, 2025
59 of 64 checks passed
@gribnoysup gribnoysup deleted the fix-multiple-drawers-rendering-issue branch August 13, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix no release notes Fix or feature not for release notes no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants