## Problem
On the organization usage page, the per-project breakdowns list project
names, but there's no way to jump to that project's usage. You have to
find it in the project dropdown instead. Resolves FE-5153.
## Solution
Project names in the usage breakdowns are now buttons that set the
`projectRef` filter and clear `branchRef`, so the page shows that
project's usage. The other query params, such as the date range, are
left alone.
- New `UsageProjectName` component. It renders plain text when that
project is already selected, and a button otherwise. It underlines on
hover only.
- Applied in the metric breakdown tooltip (`BillingMetric`), the compute
hover card (`ComputeMetric`) and the database size table
(`DatabaseSizeUsage`).
- `TotalUsage` passes the selected `projectRef` down to the metric
components.
- The `projectRef`/`branchRef` nuqs parsers are now shared as
`usageFilterParsers` in `Usage.utils.ts`, so `Usage` and
`UsageProjectName` use the same definition.
Tests cover the click updating the URL (and clearing `branchRef`), the
selected project rendering as text, and the `BillingMetric` breakdown in
both states.
<img width="410" height="296" alt="Screenshot 2026-11-19 at 13 36 17"
src="https://github.com/user-attachments/assets/1f032cc3-d0e2-4185-80f7-4ab3303fc6b6"
/>
## Review instructions
1. Open an organization's usage page (`/org/<slug>/usage`) for an org
with several projects.
2. Hover a metric that has a per-project breakdown, such as Egress, and
click a project name.
3. The project dropdown should switch to that project and the usage
should update. Any date range you had selected should survive the click.
4. Hover the same metric again. The selected project is now plain text
and the others are still clickable.
5. Do the same from the compute hover card and the database size table.
## Checklist
Check all before review:
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
## Summary
Customers could see a branch-driven egress overage in their organization
total but could not select the branch on the Usage page. This adds a
branch filter next to the parent project selector and uses the selected
branch's project ref for usage requests.
- Validate bookmarked branch refs before displaying usage. Show loading
and API errors explicitly, and disclose when an unavailable branch falls
back to its parent.
- Keep the filter, notice, and usage requests on the same project ref.
Allow returning to the parent even when the branches response omits its
main row.
- Find the selected branch's disk usage beyond the first page of
organization projects and explain that deleted branches still contribute
to organization totals.
- Correct the branching and egress documentation to explain separate
branch usage.
## Scope
This is the branch-selector improvement proposed in FE-4153's
discussion. It does not provide the original ticket's reconciled
per-project egress table or historical rows for deleted branches. The
current daily-usage API contract supports a single project filter, but
does not return project-grouped usage. Keep the full reconciliation work
open.
## Validation
All 47 focused Vitest tests pass across six files, including nine MSW
page tests covering usage request refs, direct branch links,
pending/failed lookups, deleted-branch fallback, invalid-project
recovery, and denied subscription permissions. Disk tests cover
selection beyond the first 96 projects and pagination failures.
Deterministic shuffled runs with seeds `4153` and `49257` pass with
retries disabled (`--retry=0`). Four focused production mutants were
killed by behavioral assertions; original source bytes were restored and
verified after every probe.
Studio TypeScript, Prettier on all PR paths, and focused lint checks
pass; inherited `any` warnings remain.
Browser QA on the matching `be17d77` Vercel preview passed parent usage
(0.213 GB), searching for `dev-test`, branch selection, return to main,
invalid-project recovery, stale-branch fallback, and returning to
organization totals. The selected branch showed 0 GB, so nonzero branch
overage was not verified. Browser network traffic was not captured;
request-ref coverage comes from MSW.
Three existing auth/router/platform module-mock scaffolds remain as a
test-harness limitation; strict no-module-mock compliance is not
claimed.
All Studio unit-test and E2E shards passed on be17d77801; CI report jobs
are finishing.
Related: FE-4153
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Filter organization usage by project branch with searchable branch
selection. Usage details reflect the selected branch where available,
including branches found on later project-list pages.
* See whether usage is scoped to a branch, the main branch, or a
project, and switch to organization-wide totals. Billing and quota
totals include all branches, including deleted branches that are no
longer selectable.
* **Documentation**
* Clarified how non-compute usage is recorded per branch, included in
organization totals, and viewed; it isn’t itemized by branch on
invoices.
* Clarified that Preview branch Egress counts toward organization
totals, not the parent project’s usage, and how to view it.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
* track source when viewing plans
* remove log
* rename event
* Update apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
* Update apps/studio/components/interfaces/Organization/BillingSettings/BillingBreakdown/BillingMetric.tsx
Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
* Update apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
* Update apps/studio/components/interfaces/Organization/BillingSettings/Restriction.tsx
Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
* added docs for tracking
* prettier
* chore: rename origins to give more hints on where these are coming from
---------
Co-authored-by: Long Hoang <1732217+loong@users.noreply.github.com>
- Add new metric Disk Size GB-Hrs (only exposed to paid plans on Orb)
- Adjusted some texts as preparation of new billing plans
- Fixed some visual bugs with the usage summary grid
- Project allocations in tooltips are now sorted by usage (descending)
- Project allocations with too little usage (<0.01) now display "<0.01" instead of just "0"
- Usage formatter supports usage that is broken down to hours
- Stop showing percentages when the usage is 0 (previously showed "<1%"
This change is backwards compatible and can be merged. Note that there will be full overhaul in the feature of the entire usage page, this is just the least invasive change to make the transition work.
* Move all studio files from /studio to /apps/studio.
* Move studio specific prettier ignores.
* Fix the ui references from studio.
* Fix the css imports.
* Fix all package.json issues.
* Fix the prettier setup for the studio app.
* Add .turbo folder to prettierignore.
* Fix the github workflows.