Carry the conversation into the editor when the Expert navigates
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 149
Description
When the user approves the plan, the Expert navigates them into the immersive editor so it can build. The onboarding surface can't go with them, because it's rendered on a team page. The Expert drawer can, because `RightDrawer` is mounted above the router views and survives navigation.
So at that moment the surface needs to close and the drawer needs to open, with the conversation intact.
The good news is that there's nothing to transfer. The messages live in the store, not in either renderer, so this is unmounting one and mounting the other. `openAssistantDrawer` already exists in `product-expert.js`.
### Done when
* Approving a plan takes the user into the editor with the conversation visible in the drawer.
* Nothing is lost across the transition: transcript, pending state, whatever the Expert was mid-way through.
* The surface doesn't linger behind the editor or reopen afterwards.
### Worth knowing
Timing is the risk. The navigation and the surface teardown and the drawer opening all happen around the same moment, and the editor takes a while to load. Getting the order wrong gives you either a flash of nothing or a surface briefly on top of a loading editor.
Worth deciding what triggers it. The Expert makes a `ui_navigate` call, so the handoff could hang off that, or off the route change itself. Hanging it off the route change is probably more robust, since it also covers the user navigating away by other means.
flowfuse#8323 is directly relevant: the Expert can start writing flows before the immersive editor has finished loading. Whatever this task does about ordering may overlap with that fix, so worth reading it first.
The drawer has a pinned and an unpinned state. Coming out of a full-attention surface into a collapsed drawer would feel like the conversation vanished, so it probably wants to arrive pinned regardless of what the user's previous preference was. Worth checking whether that stomps a stored preference they'd expect to keep.
Contributor guide
Assessment
This issue has not been assessed yet.