Commit Graph
3 Commits
Author SHA1 Message Date
supabase-vercel-tedd[bot] be19e47cf3 fix(studio): keep homepage service chart order stable across intervals (#53522)
## Problem

On the project homepage, the service usage cards (Postgres, Edge
Functions, Auth, Storage, Realtime, API Gateway) were sorted by request
total for the selected interval. Changing the interval changes the
totals, so the cards reshuffled every time the interval changed (and
while data was loading, when totals are briefly zero).

## Solution

- `buildSortedServiceCards` → `buildServiceCards` in
`ProjectUsage.metrics.ts`: it still drops disabled services and maps
stats, but keeps the order the services are declared in
`ProjectUsageSectionDeltas.tsx` instead of sorting by traffic.
- Removed the now-unused `sortServicesByTraffic` helper and its tests.
- Added a test that the card order is the same when totals change.

## How to verify

On a project's homepage (Studio preview), in the usage section with the
"Total Requests" / "Success Rate" header:

1. Note the order of the service cards.
2. Switch the interval dropdown between "Last 60 minutes", "Last 24
hours", and "Last 7 days".
3. The cards stay in the same order for every interval: Postgres, Edge
Functions, Auth, Storage, Realtime, API Gateway (services that are not
enabled for the project are skipped).
4. Reloading the page with any interval shows the same order, including
while the charts are loading.

## Checks run

- `pnpm turbo run typecheck --filter='...[origin/master]'`: pass
- `vitest run
components/interfaces/ProjectHome/ProjectUsage.metrics.test.ts`: 12
passed
- `eslint` on the changed files: pass
- Prettier check on the changed files: pass
- `pnpm turbo run lint --filter='[origin/master]'`:
`studio#lint:type-checks` ran out of memory twice in the sandbox
(JavaScript heap out of memory).
- `vitest related` for the changed files fails on clean master too, with
an unrelated parse error on wrapper markdown imports.

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-11-17 14:25:21 -06:00
Jordi Enric 15ef851e67 feat(studio): homepage usage charts backed by service-health, behind a flag (#46373) 2026-06-17 21:51:23 +02:00
Pamela Chia 01c178e159 chore(studio): graduate homeNew experiment (#43437)
## Summary

The `homeNew` PostHog experiment has concluded. This PR graduates it by
making the new homepage (`ProjectHome`, formerly `HomeV2`) the permanent
default for all users, and removes all dead code from the old
experiment.

## Changes

- Remove `homeNew` PostHog feature flag checks and `home_new` experiment
exposure tracking from 3 files
- Rename `HomeNew/` → `ProjectHome/` directory and `HomeV2` →
`ProjectHome` export
- Delete old `Home/Home.tsx` component (shared components like
`ProjectList/` are kept — still used by org pages)
- Delete `pages/project/[ref]/building.tsx` and add a server-side
redirect from `/project/:ref/building` → `/project/:ref` to prevent 404s
during rollout (old cached JS bundles may still route to `/building`)
- Simplify `ContentWrapper` building-state logic in `ProjectLayout` —
always redirect building projects to home, always suppress building
interstitial on home page
- Always route to `/project/{ref}` after project creation (remove
`/building` path)
- Update all Observability imports from `HomeNew` → `ProjectHome`

## Self-hosted behavior change

Self-hosted Studio previously showed the old `Home` component (client
libraries + example projects) since PostHog flags don't load. This PR
changes self-hosted to show `ProjectHome` (TopSection with service
status + instance diagram, advisor, custom reports). All sections query
backend APIs that exist on self-hosted. E2E tests pass against the
self-hosted build.

## Testing

- [x] `pnpm turbo run build --filter=studio` passes
- [x] No remaining references to `homeNew`, `home_new`, or `HomeNew` in
codebase
- [x] No broken imports to deleted files
- [x] Self-hosted E2E tests pass (145 passed, 1 flaky, 4 skipped)
- [x] `/building` redirect added to both platform and self-hosted config
blocks

**Quick test:**
1. Navigate to any project homepage — should render the ProjectHome
component
2. Create a new project — should redirect to `/project/{ref}` (not
`/building`)
3. Visit a project in `COMING_UP` state on a non-home route — should
redirect to home
4. Visit `/project/{ref}/building` directly — should 302 redirect to
`/project/{ref}`

## Linear

- fixes GROWTH-671
2026-03-10 17:03:58 +09:00