Remove duo_chat_workplan_empty_state flag
What does this MR do and why?
Consolidates the duo_chat_workplan_empty_state feature flag into the existing workplan flag, eliminating a redundant flag and fixing an actor mismatch.
Full context (AI generated)
Problem
The duo_chat_workplan_empty_state flag was pushed globally in gon_helper.rb with a user actor (current_user). This meant the "Generate workplan" button in Duo Chat could appear for users in projects/groups where the workplan feature was not actually enabled.
Solution
The backend only includes the AGENT_PLAN widget when the workplan feature is enabled for the project or group root ancestor. Since WorkItemAiWidget and WorkPlan are only rendered when that widget is provided, a separate frontend flag is unnecessary.
This MR:
- Removes the
workplanfrontend feature flag pushes from the EE project and group work item controllers - Removes the component-level
workplanfeature flag checks fromwork_plan.vue; the component registers and refreshes the Duo Chat empty-state header while mounted - Removes the global user-actor push of
duo_chat_workplan_empty_statefromgon_helper.rb - Deletes the
duo_chat_workplan_empty_stateYAML definition - Updates the affected frontend and controller specs
Button action confirmation
Both GenerateWorkplanEmptyState (the Duo Chat empty-state button) and WorkPlan.handleRegenerate (the workplan widget's "Generate" button) use buildWorkPlanChatCommand — they are already equivalent.
References
- Closes #613424 (closed)
Screenshots or screen recordings
No UI changes — this is a feature flag consolidation. The "Generate workplan" button in Duo Chat is available only when the backend provides the AGENT_PLAN widget, which requires the workplan feature to be enabled for the project or group.
How to set up and validate locally
- Enable the
workplanflag - Visit a work item with a workplan that has not been generated yet, but the workplan widget is already visible (means
AiPlanningistrue) - Open Duo Chat — the "Generate workplan" button should appear in the empty state
- Generate a workplan
- Open the Duo chat with a fresh state and you'll see "Review and confirm". It opens the panel with the workplan. (In case it was already open, it closes it again, which is not the best UX. But this MR isn't about fixing this UX)
- Disable the flag and verify the workplan widget and button are not rendered
This feature doesn't work when the Chat was already opened from before from another page. Make sure to open a fresh chat on the work item.
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.