mirror of
https://github.com/coder/coder.git
synced 2026-11-03 14:21:04 +08:00
Adds the current user's AI spend progress to the top navbar avatar dropdown when /api/v2/users/me/ai/spend reports a configured spend limit. The shared dropdown content accepts an optional profileExtra slot so the Agents sidebar can opt in later without changing the default sidebar UI. Introduces a temporary site API type and a React Query helper for AIGOV-473 that refetches each time the dropdown opens, plus shared budget progress helpers used by both the new dropdown bar and the existing Agents usage indicator. The shared AIBudgetUsage component moves to site/src/components so the dropdown and group budget UI format spend identically, including the unlimited case. The avatar border polls the spend endpoint and is colored by severity while the dropdown is closed. Closes AIGOV-473