Show session counts on the Duo panel inbox tabs

What this does

Adds a GlBadge inside the #title slot of each GlTab in agent_session_inbox.vue — one for "Needs a decision", one for "All". The badge shows the count of loaded rows; when pageInfo.hasNextPage is true it shows an overflow label derived from DEFAULT_AGENT_PLATFORM_PAGINATION_VARIABLES.first so the label tracks page size automatically rather than hardcoding a string.

The badge is hidden while isInboxLoading is true, preventing a stale count from flashing during the first load or the 10-second poll.

Two new computeds (needsDecisionBadge, allBadge) read pageInfo already stored by the existing query result handler. No new queries.

Why it is split out

Slice A (MR !251149 (merged)) adds the tabbed inbox structure and the badge logic depends on it, so it was easier to review separately. Slice A has since merged, along with the inbox MSW integration spec (MR !251675 (merged)), and this MR now targets master directly. Everything stays behind the duo_panel_session_inbox flag that slice A already gates.

How the count is derived

duoWorkflowWorkflows exposes no total-count field, so the badge reflects the rows loaded in the current page. Overflow uses the configured page size, not a hardcoded literal.

Testing

Three unit cases in agent_session_inbox_spec.js: no badge while loading, the loaded edge count per tab, and the overflow label when both connections report a further page. One MSW integration case in msw_integration/ai_duo_panel/agent_session_inbox_spec.js checks each badge against its own alias's loaded rows. Both aliases return a full page with a further page in that fixture, so both badges read the overflow form.

  • yarn jest ee/spec/frontend/ai/duo_agents_platform/panel/agent_session_inbox_spec.js — 20 tests, passed
  • yarn jest:msw-integration ee/spec/frontend/msw_integration/ai_duo_panel/agent_session_inbox_spec.js — 8 tests, passed
  • ESLint and Prettier clean; no new user-facing strings

Verified in GDK against seeded sessions. Sampling the DOM every 16 ms across the panel open (457 samples) shows exactly two states and no intermediate flash:

t badges skeletons
541 ms none both tabs
4641 ms 3, 20+ none

So both branches of the computed render, and the loading gate holds for the whole 4.1 s window rather than briefly showing a zero.

Tabs while the inbox query is in flight

Tabs once the query resolves

Edited by Andrew Fontaine

Merge request reports

Loading
Loading