feat: implement ai governance consumption frontend#21595
Conversation
… jakehwll/1246-ai-governance-verbiage
| <div className="flex flex-col gap-4 items-center justify-center"> | ||
| <div className="flex flex-col gap-2 items-center justify-center"> | ||
| <span className="text-base">Users with AI Governance Add-On</span> | ||
| <span className="text-content-secondary text-center max-w-[464px] mt-2"> |
There was a problem hiding this comment.
This isn't something new to this PR but I notice I get an unnecessary horizontal scroll bar on the Licenses page on Macbook 14 in 1512x982 resolution. This doesn't happen on any of the other pages in deployment, I wonder if its because of max-w-[464px]? Ideally we should avoid setting a specific height width if possible.
jaaydenh
left a comment
There was a problem hiding this comment.
PR Review: AI Governance Consumption Frontend
Nice work adding the AI Governance Users Consumption chart! The implementation follows the existing patterns from ManagedAgentsConsumption well. Here are my observations:
✅ What Looks Good
-
Consistent Architecture: The new
AIGovernanceUsersConsumptionChartfollows the same pattern asManagedAgentsConsumptionwith similar props, error handling, and loading states. -
Good Separation of Concerns: Moving the empty state and paywall handling to wrapper components keeps the chart component focused.
-
Proper Type Safety: The use of TypeScript types like
AIGovernanceUsersConsumptionand proper generics for the chart config is well done. -
Consistent Styling: The chart uses the same styling patterns (colors, tooltips, legends) as other charts in the codebase.
-
Storybook Coverage: Adding stories for the new component helps with visual testing and documentation.
🔍 Suggestions for Consideration
-
Documentation Link: The link
docs("/admin/ai-agent-governance")- I couldn't find a matching docs path atdocs/admin/ai-agent-governance/. The AI governance docs appear to be atdocs/ai-coder/ai-governance.md. Could you verify this path exists or will be added? -
Empty State Messaging: The empty state suggests "Configure AI Governance to unlock consumption reports." This implies the feature needs configuration first. Is this the desired UX, or should it check for licensing first like
ManagedAgentsConsumptiondoes with theshowPaywallprop? -
Chart Readability at Scale: With a stacked bar chart showing 4+ user categories, it could become hard to read if there are many date points. Consider if there's a typical max number of data points to expect.
-
Accessibility: The chart relies heavily on color to differentiate users. Consider whether the default palette has sufficient contrast for color-blind users.
Minor Nits
- The
chartConfigdynamically generates colors usinghsl(var(--chart-${(index % 5) + 1}))which cycles through 5 colors. If there are more than 5 users, colors will repeat, which could be confusing.
Overall, this is a solid implementation that integrates well with the existing consumption reports infrastructure. The code is clean and follows established patterns. 👍
site/src/pages/DeploymentSettingsPage/LicensesSettingsPage/ManagedAgentsConsumption.tsx
Outdated
Show resolved
Hide resolved
site/src/pages/DeploymentSettingsPage/LicensesSettingsPage/ManagedAgentsConsumption.tsx
Show resolved
Hide resolved
.../src/pages/DeploymentSettingsPage/LicensesSettingsPage/AIGovernanceUsersConsumptionChart.tsx
Outdated
Show resolved
Hide resolved
.../src/pages/DeploymentSettingsPage/LicensesSettingsPage/AIGovernanceUsersConsumptionChart.tsx
Show resolved
Hide resolved
jaaydenh
left a comment
There was a problem hiding this comment.
Review: AI Governance Consumption Frontend
Nice work on this PR! The implementation follows established patterns well and integrates cleanly with the existing consumption reports infrastructure.
What I Like
- ✅ Consistent with the existing
ManagedAgentsConsumptioncomponent patterns - ✅ Good separation of concerns with the chart in its own file
- ✅ Proper TypeScript typing
- ✅ Clean empty state handling
- ✅ Good Storybook coverage for testing/documentation
Questions
-
Documentation link: The empty state links to
docs("/admin/ai-agent-governance")- I noticed the actual docs file is atdocs/ai-coder/ai-governance.md. Will this path resolve correctly, or should it be/ai-coder/ai-governance? -
Minor: The component shows an empty state when
datais undefined or empty. Should there be any licensing/entitlement check similar to howManagedAgentsConsumptionhandles the paywall state, or is that handled elsewhere?
Overall this looks good to merge! 👍
…overnanceUsersConsumptionChart.tsx Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com>
…overnanceUsersConsumptionChart.tsx Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com>
…agedAgentsConsumption.tsx Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com>
Documentation CheckUpdates Needed
ContextThis PR adds a new "Users with AI Governance Add-On" consumption chart to the Licenses Settings page. The feature itself is already documented in The terminology update from "Managed AI Agents" to "Agent Workspace Builds" in the Note: The screenshot update can wait until the feature is merged, but it should be tracked to keep the documentation accurate. Automated review via Coder Tasks |
Documentation CheckUpdates NeededThe Licenses Settings page now displays two consumption charts, but the documentation doesn't describe what admins will see:
The existing screenshot at Automated review via Coder Tasks |
jaaydenh
left a comment
There was a problem hiding this comment.
Overall, looks good. Just a nitpick with the text for one of the links.

Closes #1246
This PR adds a new component to display AI Governance user entitlements in the Licenses Settings page. The implementation includes:
AIGovernanceUsersConsumptionChartcomponent that shows the number of entitled users for AI Governance featuresThe chart displays the number of users entitled to use AI features like AI Bridge, Boundary, and Tasks, with a note that additional analytics are coming soon.
Preview