Skip to content

feat(site/src/pages/DeploymentSettingsPage/LicensesSettingsPage): show agent usage in minutes and restructure license product grid - #28608

Draft
tracyjohnsonux wants to merge 3 commits into
mainfrom
lic-page-visual-minutes
Draft

feat(site/src/pages/DeploymentSettingsPage/LicensesSettingsPage): show agent usage in minutes and restructure license product grid#28608
tracyjohnsonux wants to merge 3 commits into
mainfrom
lic-page-visual-minutes

Conversation

@tracyjohnsonux

Copy link
Copy Markdown
Contributor

Visual updates to the licenses page (/deployment/licenses), frontend only. Agent usage is now displayed in minutes instead of hours, the per-license Products area uses a responsive 2-up grid, agents-only licenses report Minutes in the license row, every license shows a Coder Agents trial or community card when it has no agents grant, and legacy AI Governance seats render inside Products instead of a separate Add-ons section.

Changes

  • Products grid: replaced flex-wrap + min-w-[320px] flex-1 cards (which stretched a wrapped card to full width) with grid grid-cols-1 lg:grid-cols-2, so cards stay 2-up and only stack at narrow widths.
  • Hours to minutes: display-only conversion from existing data. Used minutes = floor(actual_ms / 60_000); allocation and thresholds = claim hours × 60. Copy updated ("Total Agent minutes", "Agent minutes used", "Agent minutes exceeded"). TotalAgentHoursCard renamed to TotalAgentMinutesCard with bar math and warnings converted.
  • Agents-only licenses: a license that grants agent runtime hours but has no user_limit claim shows a Minutes column (used / allocation, Unlimited for -1) in place of Users, hides the Coder Workspaces card, and labels itself "Coder Agents".
  • Trial / community cards: the Coder Agents card renders for all licenses. Without an agents grant, trial licenses show "Coder Agents Trial" (minutes used, unlimited concurrency, Upgrade), and non-trial licenses show the community card (minutes used, max 5 concurrent agents, "Try unlimited for 30 days" → /deployment/premium, "View docs").
  • AI Governance seats: moved from the "Add-ons" section into the Products grid; the Add-ons heading is removed.

No API or backend changes; all values derive from existing entitlement fields (actual_ms) and license JWT claims.

Testing

  • pnpm check (biome), tsc -p ., and knip pass.
  • LicenseCard.test.tsx (3 tests) and the Storybook vitest project for the directory (12 files, 101 tests) pass, including new stories for the licensed-minutes, agents-only, trial, and community states.
Implementation notes and decisions
  • Overlap review: checked open PRs from @jaaydenh. feat: split public capabilities from entitlement details #28488 (split public capabilities from entitlement details) rewrites LicensesSettingsPage.tsx query wiring, which this PR does not touch. feat: report Community Agent Time usage #28489 (community Agent Time usage) is the backend change that populates actual_ms without a usage_period on unlicensed deployments; the community/trial cards consume that as-is. No file conflicts.
  • Agents-only detection heuristic: a license is treated as agents-only when it grants agent runtime hours (agent_runtime_hours_allocation > 0 or -1) and carries no user_limit claim. A license bundling seats and agent hours keeps the Users column (covered by the AgentHoursWithSeatsKeepsUsersColumn story).
  • Minutes comparisons: exceeded/soft-limit checks moved from tenths-of-hours flooring to whole minutes so the displayed value and the warning states flip at the same instant.
  • Breakpoint choice: Tailwind 3.4 without container queries, so the grid collapses at the lg viewport breakpoint; below that the settings content area is too narrow for two 320px cards.
  • Upsell card layouts: both trial and community variants show "Agent minutes used" first (em dash when usage is unavailable) so the two layouts stay consistent; previously the metric was hidden when undefined.
  • Rename: TotalAgentHoursCardTotalAgentMinutesCard (component, file, stories) so the name matches what it renders.

🤖 This PR was generated by Coder Agents on behalf of @tracyjohnsonux.

…w agent usage in minutes and restructure license product grid
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.

1 participant