chore(site): replace handrolled AI spend types with generated types - #27342
Conversation
77ae704 to
78b21c0
Compare
There was a problem hiding this comment.
Good point, and I also don't think we have other parts on the UI where a different org is referenced. Maybe the em-dash makes sense and on the info we just say something like "This user's effective group is not on scope of the current org". cc @tracyjohnsonux
There was a problem hiding this comment.
Done! Both cells now show an em-dash with the same info message: "This user's AI budget is managed by a group in another organization and isn't visible here." (waiting on Tracy if we need to change this)
e6b9066 to
8944247
Compare
There was a problem hiding this comment.
Good point, and I also don't think we have other parts on the UI where a different org is referenced. Maybe the em-dash makes sense and on the info we just say something like "This user's effective group is not on scope of the current org". cc @tracyjohnsonux
1181e90 to
ea53960
Compare
The groups and group members pages consumed AI spend through local
ai_cost_control wrapper types with TODOs to switch to the generated
contract. Both spend endpoints are now live:
- GET /organizations/{org}/groups/ai/spend -> OrganizationGroupsAISpend
- GET /groups/{group}/members/ai/spend -> GroupMembersAISpend
Drop the handrolled types and join the generated spend rows onto groups
and members by group_id/user_id at the container, so each row gets a
single enriched object.
AIGOV-509 changes a null effective_group_id to mean the budget resolves
to a group in another org (an effective group always exists otherwise),
so the member budget cells render the "managed by another org" state
instead of unlimited.
Also:
- Toast and show a warning icon in the AI budget header when the spend
fetch fails, matching the pages' existing error handling.
- Rename InfoIconTooltip to StatusIconTooltip with an info/warning kind.
ea53960 to
8b2ff65
Compare
ssncferreira
left a comment
There was a problem hiding this comment.
LGTM
just a suggestion for the tests, but not blocking.
Great job 🚀
8b2ff65 to
c2a2f18
Compare

The groups and group members pages consumed AI spend through local
ai_cost_controlwrapper types with TODOs to switch to the generated contract. Both spend endpoints are now live, so this drops the handrolled types and uses the generated ones:GET /organizations/{org}/groups/ai/spend->OrganizationGroupsAISpendGET /groups/{group}/members/ai/spend->GroupMembersAISpendThe pages fetch identity (groups/members) and spend separately, then join by
group_id/user_idat the container so each row gets a single enriched object.AIGOV-509 changes a null
effective_group_idto mean the budget resolves to a group in another org (an effective group always exists otherwise), so the member budget cells render the "managed by another org" state instead of unlimited.Note: distinguishing unbudgeted members (no Everyone-group attribution) from members whose budget resolves to a group in another org depends on #27364. Until that merges, both render as the "another org" state.
Closes https://linear.app/codercom/issue/AIGOV-528/replace-handrolled-ai-spend-types-with-generated-types-in-groups-ui
Refs AIGOV-509