X Tutup
Skip to content

feat: implement ai governance consumption frontend#21595

Merged
jakehwll merged 65 commits intomainfrom
jakehwll/1246-ai-governance-verbiage
Jan 29, 2026
Merged

feat: implement ai governance consumption frontend#21595
jakehwll merged 65 commits intomainfrom
jakehwll/1246-ai-governance-verbiage

Conversation

@jakehwll
Copy link
Contributor

@jakehwll jakehwll commented Jan 21, 2026

Closes #1246

This PR adds a new component to display AI Governance user entitlements in the Licenses Settings page. The implementation includes:

  • New AIGovernanceUsersConsumptionChart component that shows the number of entitled users for AI Governance features
  • Storybook stories for various states (default, disabled, error states)
  • Integration with the existing license settings page
  • Collapsible "Learn more" section with links to relevant documentation
  • Updated the ManagedAgentsConsumption component with clearer terminology ("Agent Workspace Builds" instead of "Managed AI Agents")

The 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

CleanShot 2026-01-27 at 22 44 25@2x CleanShot 2026-01-27 at 22 45 04@2x

<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">
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@jaaydenh jaaydenh left a comment

Choose a reason for hiding this comment

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

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

  1. Consistent Architecture: The new AIGovernanceUsersConsumptionChart follows the same pattern as ManagedAgentsConsumption with similar props, error handling, and loading states.

  2. Good Separation of Concerns: Moving the empty state and paywall handling to wrapper components keeps the chart component focused.

  3. Proper Type Safety: The use of TypeScript types like AIGovernanceUsersConsumption and proper generics for the chart config is well done.

  4. Consistent Styling: The chart uses the same styling patterns (colors, tooltips, legends) as other charts in the codebase.

  5. Storybook Coverage: Adding stories for the new component helps with visual testing and documentation.

🔍 Suggestions for Consideration

  1. Documentation Link: The link docs("/admin/ai-agent-governance") - I couldn't find a matching docs path at docs/admin/ai-agent-governance/. The AI governance docs appear to be at docs/ai-coder/ai-governance.md. Could you verify this path exists or will be added?

  2. 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 ManagedAgentsConsumption does with the showPaywall prop?

  3. 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.

  4. 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 chartConfig dynamically generates colors using hsl(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. 👍

jaaydenh

This comment was marked as duplicate.

Copy link
Contributor

@jaaydenh jaaydenh left a comment

Choose a reason for hiding this comment

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

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 ManagedAgentsConsumption component 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

  1. Documentation link: The empty state links to docs("/admin/ai-agent-governance") - I noticed the actual docs file is at docs/ai-coder/ai-governance.md. Will this path resolve correctly, or should it be /ai-coder/ai-governance?

  2. Minor: The component shows an empty state when data is undefined or empty. Should there be any licensing/entitlement check similar to how ManagedAgentsConsumption handles the paywall state, or is that handled elsewhere?

Overall this looks good to merge! 👍

jakehwll and others added 3 commits January 27, 2026 12:22
…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>
@github-actions
Copy link

github-actions bot commented Jan 27, 2026

@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 27, 2026

Documentation Check

Updates Needed

  • docs/admin/licensing/index.md - Update the existing screenshot (licenses-screen.png) to include the new AI Governance Users consumption chart that will appear on the Licenses page
  • docs/admin/licensing/index.md - Consider adding a brief mention that the Licenses page displays consumption for AI Governance Add-On users (similar to how it mentions license seat consumption)

Context

This PR adds a new "Users with AI Governance Add-On" consumption chart to the Licenses Settings page. The feature itself is already documented in docs/ai-coder/ai-governance.md, and the component properly links to relevant documentation (AI Bridge, Boundary, Tasks).

The terminology update from "Managed AI Agents" to "Agent Workspace Builds" in the ManagedAgentsConsumption component is good - it aligns with the documented terminology in docs/ai-coder/ai-governance.md.

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

@jakehwll jakehwll added the cherry-pick/v2.30 Needs to be cherry-picked to the 2.30 release branch label Jan 27, 2026
Base automatically changed from jakehwll/1227-extend-premium-license-aigovernance to main January 27, 2026 11:33
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Jan 28, 2026

Documentation Check

Updates Needed

The Licenses Settings page now displays two consumption charts, but the documentation doesn't describe what admins will see:

  • docs/admin/licensing/index.md - Add a section describing the consumption charts displayed on the Licenses page:
    • Agent Workspace Builds chart (for Coder Tasks usage)
    • Users with AI Governance Add-On chart (new in this PR - shows entitled user count)
    • Brief description of what each chart displays and when they appear (only when licenses are active)
    • Reference to AI Governance and Agent Workspace Builds for details

The existing screenshot at docs/images/admin/licenses/licenses-screen.png may need updating to show these new consumption charts.


Automated review via Coder Tasks

@jaaydenh
Copy link
Contributor

Screenshot 2026-01-28 at 14 08 02 The link still feels a bit odd here.

Copy link
Contributor

@jaaydenh jaaydenh left a comment

Choose a reason for hiding this comment

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

Overall, looks good. Just a nitpick with the text for one of the links.

@jakehwll jakehwll merged commit 62704eb into main Jan 29, 2026
28 checks passed
@jakehwll jakehwll deleted the jakehwll/1246-ai-governance-verbiage branch January 29, 2026 00:22
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2026
@jakehwll jakehwll removed the cherry-pick/v2.30 Needs to be cherry-picked to the 2.30 release branch label Jan 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update licenses page to mention new verbiage around AI Governance SKU

2 participants

X Tutup