Stop auto-opening the workplan panel after generation
What does this MR do and why?
Once Duo finished generating a plan, work_plan.vue opened the workplan panel on the user's behalf. With the slower async generation flow the user may have moved on to something else on the work item by the time the plan lands, and the auto-opened panel also hid the confidence score behind it. The completion status already tells the user the plan is ready, so the auto-open is disruptive rather than helpful.
This MR removes the auto-open path: the pendingGenerateOpen flag, the hasSavedContent watcher that opened the panel once content arrived, the GENERATE_AGENT_PLAN event listener and the @open-chat-request handler that set the flag. A generated plan now lands in the inline row and stays there until the user opens it. Opening the panel on an explicit request (OPEN_AGENT_PLAN_PANEL, the URL sync, the row's open button) is unchanged.
The spec is updated to assert that the panel stays closed after generation completes and that explicit opens still work.
References
- Resolves #628800 (closed)
Differences
Work plan does not auto open anymore:
Before: Clicking Generate and waiting for Duo to finish automatically opens the workplan panel, covering the work item and the confidence score, even if the user has since moved on to something else.
After: The generated plan appears in the inline row with its completion status and confidence score visible; the panel opens only when the user asks for it.
How to set up and validate locally
- Enable Duo agentic features on a group with a work item that supports agent plans (
ai_planningenabled). - Open a work item and click Generate on the workplan widget.
- Wait for generation to complete. On
masterthe workplan panel opens by itself; with this MR the plan shows in the row with its status and confidence score, and the panel stays closed. - Click the plan row / open action — the panel still opens on request.
yarn jest ee/spec/frontend/work_items/components/ai_widget/work_plan_spec.js
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.