Add an AI Governance dashboard side panel behind a flag
What does this MR do and why?
This adds the side panel that every AI Governance dashboard widget will open (#637204, epic &24266). It is the shared building block for the dashboard workflow issues: a card asks for a view, the panel shows it, and everything after the first click stays in the panel.
It wires one card to prove the pattern: a project in Top projects by agent sessions opens that project's sessions in a panel titled with the project. Clicking a session shows its details, laid out as in the design, and Back returns to the list.
Everything is behind the ai_governance_dashboard_side_panels wip flag, off by default.
What changes for users
- Flag off: nothing. Cards link to the Audit events tab as today.
- Flag on: a project row opens the panel instead of leaving the dashboard. Ctrl, Cmd or Shift-click still opens the Audit events tab.
How it works
- A flag.
ai_governance_dashboard_side_panels(wip, off by default), pushed by both governance controllers. With it off, nothing changes for anyone. - The dashboard owns the panel (
dashboard_app.vue).- It gives every card one function,
openGovernancePanel(view, props). With the flag off that isnull, so the cards keep their links. - The open panel is a stack of views. A card opens a fresh stack, a view can push one on top (a session over the list), Back pops it, Close clears it.
- The open panel is saved on the page's own history entry, not in the URL, so the URL stays
?tab=dashboard. A refresh, or Back from "Open in full page", reopens the panel as it was. Switching tabs starts a new history entry, so the other tabs never see it. - The panel code loads only when a panel opens, so the dashboard does not grow for anyone with the flag off.
- It gives every card one function,
How other widgets use it
- A card injects
openGovernancePaneland callsopenGovernancePanel('audit-events', { filters, title }), with the same filters its link uses (auditEventsFilters) and the name of what was clicked. - A view can push another on top (the list pushes
session), and Back pops it. - New views (MCP server, skill, policy) go in
GovernanceSidePanelnext to the two here. Session details has anactionsslot for Revoke (#637205).
Decisions
- GitLab's
DynamicPanelas the shell. It is the current page layout pattern, has the width resizer and "Open in full page", and the session drawer already uses it. The prototype draws a drawer over the dashboard; on wide screensDynamicPanelsits beside it instead. - Session details reuse
SessionDetailsDrawer. It gets optional props instead of a copy:backLabel,maximizeUrlandpanelLayout. In the panel the session follows the design: Back on the top row, a "Session #id" title, an actions row, and details stacked label over value with GitLab's attribute list. The Audit events tab looks the same as before. - "Open in full page" opens the Audit events tab with the same filters, and from a session with that session open, through the tab's existing
?session=link. - The filter bar takes
initialFilters. In the panel the page URL belongs to the dashboard, so it cannot seed from it.
Not in this MR
- The other widgets, Revoke, and the new Audit events filters (agent type, tool, action category).
- A session-by-id query, so Sessions to review can open a session directly.
- A link that opens the panel. "Open in full page" gives a shareable link to the same filters and session.
- Browser Back after clicking another tab and then the Dashboard tab opens the dashboard with the panel closed: GlTabs starts a new, empty history entry for the Dashboard tab in that case.
- Keeping the list's page, and filter changes made inside the panel, when coming back from a session. Back starts again at page 1 with the filters the panel opened with.
- Separate tracking labels for the panel. Filters and session opens in the panel count as Audit events report events for now.
Screenshots
Flag on: a project opens its sessions in the panel, a session opens on top, Back returns to the list, and "Open in full page" opens the Audit events tab with the same filter.
With the flag off the dashboard is unchanged:
How to set up and validate locally
Feature.enable(:ai_governance_dashboard_side_panels)in a Rails console.- Open a group's AI Governance dashboard with some agent sessions.
- Click a project in Top projects by agent sessions: its sessions open in the side panel, titled with the project.
- Click a session, then Back. Refresh with a session open: it opens again. Escape or Close closes the panel.
Relates to #637204

