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

   ### SUMMARY
   
   Keep the same chat panel mounted when switching between floating and docked 
display modes. The app currently removes `ChatFloatingHost` and mounts a 
separate `ChatPanelHost`, resetting component state. Answers, expanded tool 
results, drafts and in-flight subscriptions can disappear even though only the 
layout changed.
   
   The application shell now owns one panel in an `InPortal` and moves its 
existing DOM between the two locations. This reuses the installed 
`react-reverse-portal` mechanism already used for page content in the same 
file. The floating host accepts the panel slot and retains its existing 
standalone behavior. Authentication/feature-flag gating, error boundaries, 
registration takeover, and close/unmount behavior remain unchanged.
   
   **Independent fix against current Apache master; four files, no dependency 
on #42805.** There are no AI backend changes, migrations, new dependencies, or 
unrelated fixes.
   
   Related report: 
https://github.com/apache/superset/pull/43133#discussion_r3995800022. This 
addresses its **docking** case in the shared host. Closing/reopening an AI 
stream remains a separate lifecycle concern; this PR does not claim to solve 
it. @michael-s-molina could you review the shared chat-host change from #41205?
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Reproduced in the browser with an existing saved conversation: docking 
replaced the message DOM and lost the visible answer, expanded tool result and 
unsent draft. With this fix, docking and undocking retain the same message DOM, 
text, expanded tool result and draft, without refetching the transcript. 
Private conversation content is intentionally not included in screenshots.
   
   ### TESTING INSTRUCTIONS
   
   - New regression renders the actual `App` shell with real chat hosts and 
portals and a stateful test provider. On unmodified master it fails at the 
first mode switch: the original input with `Unsent question` is replaced by a 
new empty input.
   - After the fix, four mode switches preserve DOM identity, draft, streamed 
answer and expanded native details. A subsequent simulated stream chunk reaches 
the same panel. Closing still unmounts it and cleans up its subscription.
   - `src/views/App.test.tsx`, `src/core/chat`, and 
`src/views/routes.test.tsx`: **44 passed across five suites**.
   - All applicable changed-file pre-commit checks pass, including TypeScript, 
formatting, lint, custom rules and stylelint. Local project-reference 
declarations were built before typechecking; no generated outputs are included.
   - On the private integration containing Native AI: **159 tests passed across 
14 suites**, production frontend build succeeded, and actual browser 
docking/undocking checks passed with zero browser errors and zero transcript 
refetches. The check uses an isolated temporary web instance, not a claim of 
deploying to users or passing upstream CI.
   - The same preview also passes login and dashboard smoke: seven chart-data 
responses, all HTTP 200.
   
   Manual reproduction with `ENABLE_EXTENSIONS` enabled and a registered chat 
provider: open a conversation, expand a tool result, type an unsent draft, dock 
and undock. The content and draft should remain; a stream subscription should 
continue receiving chunks.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: review thread linked above
   - [x] Required feature flags: `ENABLE_EXTENSIONS`
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in SIP-59)
   - [ ] 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