[UX] Sessions widget errors surface as global page alerts

Problem

Currently when the agent sessions widget on a work item or merge request fails to load, it fires a page-level createAlert, interrupting users who never interacted with the widget. The widget itself renders nothing on error, which is also exactly what it renders when there are zero sessions, so a failed load and "no agent activity" are indistinguishable.

Pajamas alert guidance is to place errors in the context of the affected component.

Affected files
  • ee/app/assets/javascripts/work_items/components/agent_sessions/index.vue
  • ee/app/assets/javascripts/vue_merge_request_widget/widgets/agent_sessions/index.vue

Proposal

Following the Pajamas alert guidelines (errors belong in the context of the affected component; page-level alerts are for page-wide problems):

  1. Replace the global alert with a contextual one. Remove the createAlert call in both widgets. On query failure, keep rendering the widget shell (title/container) and render a GlAlert with variant="danger" inside the widget body, so the error is visually tied to the component it belongs to.
  2. Follow Pajamas error-alert conventions.
    • Not dismissible (:dismissible="false"): the error reflects a persistent state, and dismissing it would return the widget to an ambiguous blank state.
    • Short, actionable message (for example, "Failed to load agent sessions.") with a Retry primary action that refetches the query, since the condition is user-recoverable.
    • Use the inline, non-sticky contained alert form - no page-level placement or toast.
  3. Fix the empty-vs-error ambiguity. When the query succeeds with zero sessions, render an explicit empty state (for example, muted "No agent sessions" text) instead of nothing, so "nothing to show" and "failed to load" are distinguishable.

For the merge request widget, prefer the MR widget framework's built-in error state handling over a hand-rolled alert, keeping the change minimal.

Edited by Emily Bauman