fix: fixed the default agent selection

What does this MR do and why?

References

The MR resolves several bugs as outlined in the relevant issue:

  1. Panel only opens when non-active agent is selected
  2. Default agent displays inconsistent name after reload
  3. Cannot reselect the same agent from dropdown

Solution

The MR removes the disconnected scoped handlers for tracking the selected agent in both: the AI panel, and the Duo Chat components in favor of the centralized state-stored property. Now both components can read from the same source and write to it whenever it is needed ensuring the counter-part reacts accordingly and gets the correct update.

Screenshots or screen recordings

Panel only opens when non-active agent is selected

Before After
closed-before closed-after

Default agent displays inconsistent name after reload

Before After
agents-name-before agents-name-after

Cannot reselect the same agent from dropdown

Before After
select-same-before select-same-after

How to set up and validate locally

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.

Related to #583579

Edited by Denys Mishunov

Merge request reports

Loading