[Frontend] Audit event details panel - download audit artifact
What does this MR do and why?
The audit event details panel currently has no way to download the underlying audit data — the "Download Audit Artifact" button doesn't exist yet, so users who drill into a specific event from the session view lose any way to export the JSON, even though a nearly identical capability already exists one level up. session_details_body.vue already renders a working GlButton wired to a server-side downloadPath that streams the session's audit data as JSON via send_data. In drawer/non-full-page mode, navigating from the session view into an individual event replaces session-details-body with audit_event_details_panel.vue (mutually exclusive v-if/v-else), so the download affordance simply disappears from the screen at that point.
The fix threads the same downloadPath prop (sourced from activeItem?.downloadPath, already available in both session_details_drawer.vue and agent_artifacts_app.vue) into audit_event_details_panel.vue and fills its previously-empty download-action slot with the same href-based GlButton pattern and i18n string (s__('AgentArtifacts|Download Session Artifacts')) that session_details_body.vue already uses. This required no backend changes, since the downloadPath field and its export endpoint already exist and are already exercised by the sibling component.
The change is scoped to the panel's !isFullPage branch only. In full-page mode, agent_artifacts_app.vue renders session-details-body and audit-event-details-panel side by side rather than as alternates, so the download button is already visible there via the sibling component; adding it to the panel's full-page branch too would have produced two identical download buttons on screen at once. Restricting the change to the non-full-page branch restores the download capability users lose when drilling into an event in drawer mode, without duplicating it where it's already present.
Closes https://gitlab.com/gitlab-org/gitlab/-/issues/592505
References
Closes https://gitlab.com/gitlab-org/gitlab/-/issues/592505
Screenshots or screen recordings
Full walkthrough (drawer mode: session list → session → audit event → download), recorded against a local GDK with seeded Duo Agent Platform sessions:
The audit event details panel, reached by drilling into an event from the session view:
| Before | After |
|---|---|
![]() |
![]() |
| Only the "← Audit events" back link — no way to export the session from here. | The same Download Session Artifacts button as the session view, wired to activeItem.downloadPath. |
How to set up and validate locally
I've written the final plan to /Users/xanf/.claude/plans/write-clear-numbered-steps-twinkly-parnas.md. Since ExitPlanMode isn't available in this context, here is the finished output for you to use directly in the MR:
1. In rails console, enable the feature flag:
```ruby
Feature.enable(:agent_artifacts_page)- As a user with access to a project (or group) that has GitLab Duo Agent Platform workflow sessions with recorded audit events, visit
<namespace>/<project>/-/settings/gitlab_duo/governance?tab=agent-artifacts(or the equivalent group settings page) - In the agent artifacts table, click a row to open the session details panel
- In the session's audit events list, click an audit event to open the audit event details panel
- Confirm the panel renders a "Download Audit Artifact" button with the download icon, then click it
- Confirm a JSON file downloads and, on opening it, contains the expected session/audit detail fields
One thing worth double-checking against the actual code diff before you use this: exploration found the download button already exists and works in the **drawer** view of `audit_event_details_panel.vue`, but a spec confirms it's explicitly hidden in the **maximized full-page** view (`isFullPage: true`). If this bug fix is actually about enabling it in that maximized view specifically, you'd want to adjust steps 4–5 to call out clicking the "maximize" button (`data-testid="audit-event-maximize-button"`) first.
## MR acceptance checklist
Evaluate this MR against the [MR acceptance checklist](https://docs.gitlab.com/development/code_review/#acceptance-checklist).
It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
/assign me
