Collapse Duo question options when the thread is resolved

What does this MR do and why?

Collapses and disables the GitLab Duo clarifying-question card once its thread is resolved without an answer. Until now a resolved thread kept rendering its full interactive card, so clicking an option would post an answer into a discussion the agent had already stopped waiting on.

The suggested answers now sit behind a Show suggested answers / Hide suggested answers toggle, and everything in the card is disabled. The options stay readable, since they record what the agent weighed, but they can't be clicked. The collapse state is per view only, so it resets on reload.

References

#617978 (closed)

Screenshots or screen recordings

Default (Collapsed) Expanded Expand/Collapse Transition
image image

Screen recording of the behaviour: to be added

How to set up and validate locally

  1. Enable the feature flag in a rails console: Feature.enable(:duo_workplan_async_flow)
  2. On any work item, post a comment whose body contains a fenced json:duo-question block holding a payload with a type of closed, a question string, and an options array (each option needs an id and a label, optionally description and recommended). Add "multiple": true for the multi-select shape
  3. Reply to the thread once, so the resolve control appears on it
  4. Resolve the thread without picking an answer
  5. Confirm the options collapse behind Show suggested answers, and that expanding them shows greyed, unclickable rows with a neutral Recommended badge
  6. For the multi-select shape, confirm the Submit button is gone
  7. Reload, and confirm the card comes back collapsed

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.

Edited by Kushal Pandya

Merge request reports

Loading
Loading