Skip to content

ENG-2812: Add agent briefing banner to dashboard#7675

Merged
kruulik merged 39 commits intomainfrom
dashboard-activity-feed-v2
Mar 18, 2026
Merged

ENG-2812: Add agent briefing banner to dashboard#7675
kruulik merged 39 commits intomainfrom
dashboard-activity-feed-v2

Conversation

@kruulik
Copy link
Contributor

@kruulik kruulik commented Mar 17, 2026

Ticket ENG-2812

Description Of Changes

Add an agent briefing banner to the new dashboard that displays a severity-based alert with actionable quick links. The banner integrates with the agent briefing API endpoint, shows contextual alert styling (error/warning/info) based on the highest-severity quick action, and can be dismissed by the user.

Also refactors the QuickAction type to use label, action_type, action_data, and severity fields for better alignment with the API contract.

Code Changes

  • clients/admin-ui/src/features/dashboard/types.ts - Export QuickAction interface and update field names (label, action_type, action_data, severity)
  • clients/admin-ui/src/home/AgentBriefingBanner.module.scss - New styles for the alert banner and severity-colored quick action links
  • clients/admin-ui/src/home/AgentBriefingBanner.tsx - New component: severity-based Ant Design Alert with quick action navigation links
  • clients/admin-ui/src/home/HomeDashboard.tsx - Integrate AgentBriefingBanner with useGetAgentBriefingQuery and dismissible state
  • clients/admin-ui/src/mocks/dashboard/data.ts - Add mock agent briefing response data
  • clients/admin-ui/src/mocks/dashboard/handlers.ts - Add MSW handler for agent briefing endpoint

Steps to Confirm

  1. Enable the alphaDashboard feature flag
  2. Navigate to the home dashboard
  3. Verify the agent briefing banner appears at the top with mock data
  4. Verify the alert type matches the highest severity quick action (error for critical/high)
  5. Click a quick action link and verify it navigates to the correct route
  6. Close the banner and verify it is dismissed

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • No migrations
  • Documentation:
    • No documentation updates required

kruulik and others added 30 commits March 16, 2026 11:03
… data

Add the plumbing for the new Ant Design dashboard behind the
alphaDashboard feature flag. Includes RTK Query API slice with all
dashboard endpoints, MSW mock handlers with seed data, RadarChart
and ChartText fidesui enhancements, and the HomeContainer flag gate.

The actual Posture and Priority Actions cards will be added in a
follow-up PR on top of this branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move all type definitions from dashboard.slice.ts to a dedicated
types.ts file per frontend guidelines. Convert union types (PostureBand,
DiffDirection, ActionType, ActionSeverity, ActionStatus) to TypeScript
enums. Update mock data and handlers to use enum values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the Posture score card with animated count-up, radar chart with
dimension click-through, and agent annotation alert. Add the Priority
Actions card with per-action routing, urgency grouping, and dimension
filter support. Includes shared hooks and fidesui chart enhancements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, and RadarChart

- Consolidate posture-constants.ts into features/dashboard/constants.ts
- Replace router.push() with NextLink for proper a11y and prefetching
- Add Spin loading wrapper to PostureCard
- Move inline styles to SCSS modules (PostureBreakdownContent, PostureCard tooltip)
- Extract RadarTooltipContent to its own exported component with themed bg
- Use classNames package instead of manual class joining in RadarChart
- Extract magic numbers as named constants in RadarChart
- Add named export alongside default in HomeDashboard
- Rename "this_week" urgency group to "scheduled"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove openPostureDrawer, PostureBreakdownContent import, and clickable
score wrapper from PostureCard — these are re-added in the subsequent
dashboard-command-bar-pr branch where DashboardDrawer is rendered.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Moved to dashboard-command-bar-pr where the drawer is introduced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the CommandBar header with live posture score, diff indicator, and
summary stat pills. Add the DashboardDrawer for posture breakdown
details triggered from PostureCard and CommandBar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace string literals with enum values (DiffDirection, PostureBand,
ActionType, ActionSeverity, ActionStatus) and update posture-constants
import to use the new features/dashboard/constants path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Card

Move PostureBreakdownContent from posture-actions PR into this PR since
it's only used for the drawer, which is introduced here. Re-add the
clickable score wrapper and openPostureDrawer callback to PostureCard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This hook was removed from dashboard-posture-actions since the drawer
is introduced in this PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add fallback routes for POLICY_VIOLATION, PIA_UPDATE, and DSR_ACTION when IDs are missing
- Remove unused ACTION_TYPE_ICON_NAME constant

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kruulik and others added 5 commits March 16, 2026 16:07
- Refactor drawer to use discriminated union instead of ReactNode to prevent stale data
- PostureBreakdownContent now subscribes to RTK Query directly
- Use Ant Design token names for Flex gaps (large, small)
- Add aria-label to clickable posture score
- Extract BAND_COLOR_TOKEN to shared constants

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Mar 18, 2026 5:37am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Mar 18, 2026 5:37am

Request Review

kruulik and others added 2 commits March 17, 2026 09:07
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kruulik kruulik marked this pull request as ready for review March 17, 2026 13:17
@kruulik kruulik requested a review from a team as a code owner March 17, 2026 13:17
@kruulik kruulik requested review from gilluminate and removed request for a team March 17, 2026 13:17
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 17, 2026

Greptile Summary

This PR adds an AgentBriefingBanner component to the new dashboard that displays a severity-driven Ant Design Alert with dismissable state persisted to sessionStorage and quick-action navigation links, backed by a new useGetAgentBriefingQuery RTK Query endpoint and MSW mock. The refactored QuickAction type aligns cleanly with the expected API contract.

Two issues need attention before merging:

  • Runtime crash risk (AgentBriefingBanner.tsx): ACTION_CTA[action.action_type] is accessed unconditionally and cta.route(...) is called without any null guard. The TODO comment acknowledges the guard is missing, but an unknown action_type from the real API will throw TypeError and crash the component. A simple early return null when cta is undefined should be added now.
  • SSR safety (HomeDashboard.tsx): sessionStorage is accessed synchronously inside the useState initializer, which will throw ReferenceError: sessionStorage is not defined during Next.js server-side rendering. The read should be moved into a useEffect to ensure it only runs client-side.

Confidence Score: 2/5

  • Not safe to merge — contains a likely runtime crash and an SSR compatibility issue.
  • The unchecked ACTION_CTA lookup in AgentBriefingBanner.tsx will throw at runtime when the real API returns any action type not currently in the map, crashing the component. The direct sessionStorage access in the useState initializer in HomeDashboard.tsx will also throw during SSR in Next.js. Both are straightforward fixes, but they need to land before this ships to production.
  • clients/admin-ui/src/home/AgentBriefingBanner.tsx and clients/admin-ui/src/home/HomeDashboard.tsx

Important Files Changed

Filename Overview
clients/admin-ui/src/home/AgentBriefingBanner.tsx New component rendering an Alert with quick action links; contains a potential null-dereference crash when ACTION_CTA doesn't contain an entry for an action_type.
clients/admin-ui/src/home/HomeDashboard.tsx Integrates AgentBriefingBanner with dismissal persisted to sessionStorage; direct sessionStorage access in useState initializer may throw in SSR environments.
clients/admin-ui/src/features/dashboard/types.ts QuickAction interface refactored and exported with new field names aligned to API contract; straightforward and correct.
clients/admin-ui/src/home/AgentBriefingBanner.module.scss New SCSS module providing alert size and severity-colored link styles; no issues found.
clients/admin-ui/src/mocks/dashboard/data.ts Adds mock AgentBriefingResponse data with two quick actions; correctly uses the updated QuickAction shape.
clients/admin-ui/src/mocks/dashboard/handlers.ts Adds MSW handler for the agent-briefing endpoint returning mock data; straightforward addition.
changelog/7675-dashboard-agent-briefing.yaml Changelog entry for the new agent briefing banner feature; no issues.

Last reviewed commit: 9db6052

- Add null guard for unknown action_type in ACTION_CTA lookup
- Move sessionStorage read into useEffect for Next.js SSR safety

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Base automatically changed from dashboard-command-bar-pr to main March 17, 2026 20:47
@kruulik kruulik added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit 696193c Mar 18, 2026
46 checks passed
@kruulik kruulik deleted the dashboard-activity-feed-v2 branch March 18, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants