justinpark opened a new pull request, #42143:
URL: https://github.com/apache/superset/pull/42143

   ### SUMMARY
   When the chat panel is opened/closed in panel mode, `AppContent` 
conditionally wraps the main `<Layout>` tree in a `<Splitter>` alongside the 
chat panel. Because this JSX was inlined and recreated in a different position 
in the tree depending on `isPanelOpen`, React unmounted and remounted the 
entire route content (dashboards, Explore, SQL Lab, etc.) on every toggle — 
causing a visible reload of whatever page the user was on.
   
   This PR uses `react-reverse-portal` to fix it: the `<Layout>`/route tree is 
now rendered once via `<InPortal>` at the top level of `<App>`, and 
`AppContent` renders it through `<OutPortal>` in both the inline and 
`Splitter`-wrapped branches. Since the portal keeps the underlying React 
subtree mounted regardless of where the `OutPortal` is placed, moving it in and 
out of the `Splitter` no longer triggers a remount.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before:
   
   
https://github.com/user-attachments/assets/9926760c-882d-4698-a356-d32773b7a94b
   
   After:
   
   
https://github.com/user-attachments/assets/504643b6-3b28-403d-ab66-2fea2c9ba2c1
   
   ### TESTING INSTRUCTIONS
   1. Enable the chat extension feature flag and open any page (e.g. a 
dashboard or Explore).
   2. Open the chat panel in panel mode, then close it, repeatedly.
   3. Confirm the main content area no longer reloads/flickers/resets state 
(e.g. scroll position, unsaved form state, in-progress chart render) when 
toggling.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to