mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
docs/reference-template
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0c97b9789b |
[FE-3107] chore(studio): remove remaining Next.js references (#54426)
Removes the remaining Next.js dependencies, compatibility shims, test
mocks, ESLint/TypeScript presets, and webpack/Next workarounds from
Studio following the TanStack Start migration.
Addresses FE-3107.
**Removed:**
- `next` and `next-router-mock` from `apps/studio/package.json` (and
updated `pnpm-lock.yaml`)
- Orphaned `apps/studio/compat/next/script.tsx` shim, `script.test.tsx`,
`compat/**` knip entry, and `nextCompat()` / `ssr.noExternal` `/^next/`
plumbing from `apps/studio/vite.config.ts`
- `apps/studio/tests/lib/route-mock.ts` and all `next-router-mock`
setup/imports across `tests/vitestSetup.ts`,
`tests/lib/custom-render.tsx`, and 12 test files
- `apps/studio/tests/pages/` directory (moved the 3 remaining tests to
`components/interfaces/Organization/Organization.utils.test.ts` and
`apps/studio/tests/routes/`)
- Unused `'use client'` directives across 23 Studio files
- Next.js/webpack workarounds: `graphiqlViteWorkers()` in
`vite.config.ts`, webpack `import.meta.glob` `try/catch` fallback in
`ConnectStepsSection.tsx`, shell `NODE_ENV=test` override in
`vite.config.ts` / root `package.json` / `studio-e2e-test.yml`, Next
`getPathMatch` and `_next` passthrough in `redirects.shared.*`,
`window.next?.router` check in `monaco-graphiql-coexistence.spec.ts`,
and unused `ANALYZE` env var in `apps/studio/turbo.jsonc`
- Next-only Sentry/chunk-load filters (`NEXT_NOT_FOUND`,
`NEXT_REDIRECT`, Next `/org/[slug]/` regex, `/app:\/\//`, dead
`includeThirdPartyErrorFilter` plumbing, webpack chunk error regex) and
stale Next/Pages Router comments, docs, and `#__next` CSS selector
**Changed:**
- `apps/studio/eslint.config.cjs`: switched from
`eslint-config-supabase/next` to the new `eslint-config-supabase/react`
preset (dropping `@next/next/no-img-element: off`, keeping `.next` /
`next-env.d.ts` ignored for local checkouts with stale pre-migration
build artifacts)
- `apps/studio/tsconfig.json`: extends `tsconfig/base.json` directly
instead of `tsconfig/nextjs.json` (identical resolved compiler options)
- `apps/studio/.github/eslint-rule-baselines.json`: pruned 33 stale
`pages/...` and `types/next.ts` entries without changing any rule
thresholds
- `apps/studio/tests/lib/custom-render.tsx`: backed
`TestFrameworkProvider` with TanStack Router instead of
`next-router-mock`
-
`apps/studio/components/interfaces/Integrations/GraphQL/GraphiQLTab.tsx`:
imports `graphiql/setup-workers/vite` directly
- `apps/studio/styles/globals.css`: replaced `@source
'../pages/**/*.{js,ts,jsx,tsx}'` with `@source
'../routes/**/*.{js,ts,jsx,tsx}'`
- `apps/studio/turbo.jsonc`: declared `"NEXT_PUBLIC_*"` in
`tasks.build.env` now that Turborepo infers `nitro` instead of `nextjs`
-
`apps/studio/components/interfaces/Organization/Organization.utils.ts`:
narrowed `buildOrgUrl`'s `slug` parameter to `string[] | undefined`
**Added:**
- `packages/eslint-config-supabase/shared.js` and
`packages/eslint-config-supabase/react.js` (plus `presets.test.ts`),
decoupling non-Next React apps from `eslint-config-next` with verified
zero non-`@next/*` rule drift while keeping
`eslint-config-supabase/next` unchanged for the Next.js apps
## To test
- Run `pnpm --filter eslint-config-supabase run test` and confirm preset
parity tests pass
- Run `pnpm --filter studio run lint`, `pnpm --filter studio run
lint:ratchet`, `pnpm --filter studio run typecheck`, `pnpm knip
--workspace apps/studio`, and `pnpm --filter studio run test`
- Run `pnpm --filter studio run build` and verify the production build,
prerendered routes, chunk-cycle check, and GraphiQL web workers succeed
- Smoke-test Studio locally (`pnpm dev:studio`): verify GraphiQL loads
cleanly, ConnectSheet framework steps render, and Tailwind styles on
route pages are intact
---------
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
|
||
|
|
0f14ef4d67 |
[FE-5109] (part 5) refactor(studio): migrate remaining interfaces and router events off next/router (#54057)
Part 5 of a 6-PR stack migrating all `next/router` and `next/compat/router` imports in `apps/studio` onto TanStack Router hooks and removing the router shims. | Part | PR | Scope | | --- | --- | --- | | 1 | #54053 | Core navigation helpers, `hooks/**`, `lib/**`, `data/prefetchers/**` | | 2 | #54054 | `components/ui/**` | | 3 | #54055 | `components/layouts/**` and `state/tabs.tsx` | | 4 | #54056 | Database, Branching, Compute, Edge Functions, Explorer, SQL Editor, Storage, Table Editor | | **5** | **#54057 ← this PR** | **Remaining `components/interfaces/**` and `QueryInsightsTable` router events** | | 6 | #54058 | Remove `next/router` & `next/compat/router` shims, `_router-events.ts`, Vite aliases, and test mocks | Migrates all remaining `apps/studio/components/interfaces/**` directories off `next/router`, including the last production `router.events` consumer (`QueryInsightsTable`) and the only default `next/router` import (`DiscordCTACard`). After this PR, zero files under `apps/studio/components/**` import `next/router` or `next/compat/router`. **Added:** - `apps/studio/components/interfaces/QueryInsights/QueryInsightsTable/QueryInsightsTable.test.tsx`: verifies that pathname changes clear selected query state without mutating destination or history search params, while same-pathname search updates preserve selection **Changed:** - Replaced the sole production `router.events.on('routeChangeStart', ...)` consumer in `QueryInsightsTable.tsx` with a `pathname` effect that clears `onCurrentSelectQuery` on pathname changes, and derived `searchQuery` directly from `nuqs` (`urlSearch`) instead of mirroring it in local state. Drops the legacy `setQueryStates({ search: null })` call on leave, which ran after `history.push` on TanStack Router (targeting the destination URL rather than the previous history entry, while browser Back is expected to restore previous search params). - Removed the `router: NextRouter` prop from `ReportWidgetRendererProps` in `Reports/ReportWidget.tsx` and updated its callers (`ChartBlock`, `ReportHeader`, `CreateReportModal`) - Updated `LOG_ROUTES_WITH_REPLICA_SUPPORT` in `Settings/Logs/Logs.constants.ts` from `[ref]` to `$ref` for TanStack route patterns - Replaced the default `import router from 'next/router'` in `Support/DiscordCTACard.tsx` with `useNavigate` - Replaced `useRouter` across `Account`, `Advisors`, `App`, `Auth`, `ErrorHandling`, `Home`, `HomePageActions`, `Integrations`, `Linter`, `LocalDropdown`, `Observability`, `Organization`, `OrganizationInvite`, `Platform/Webhooks`, `Project`, `ProjectCreation`, `ProjectHome`, `QueryPerformance`, `RedeemCredits`, `Settings`, `Sidebar`, `SignIn`, `Support`, `UnifiedLogs`, and `UserDropdown` - Updated affected tests (`Auth/Users/UserPanel`, `Home/ProjectList`, `LocalDropdown`, `Organization/*`, `OrganizationInvite`, `RedeemCredits`, `Settings/General/*`, `SignIn/SignInRecoveryCodeForm`, `UnifiedLogs/*`) **Simplified:** - `LocalDropdown`, `UserDropdown` and `RedeemCredits` build the current route from `location.href`, so the hash keeps its leading `#` - `NewOrgForm` navigates to the `returnTo` path instead of an absolute URL, which was being treated as external. It also uses a typed `/new/$slug` navigate. - Read search params from `useParams()` instead of `location.search` casts (`CronJobPage`, `QueuePage`, `LogsPreviewer`, `LinkSupportTicketPage`, `MarketplaceSidebar`, `PlanCards`, `SignUpForm`) - Dropped the dead `isReady`/`isRouterReady` constants and the `navigate<AnyRouter, string>` casts where typed routes work (`ForgotPasswordWizard`, `SignInPartner`, `ReportWidget`, `ProjectUpgradeAlert`) - Linter, `ReportHeader` and `LogsPreviewer` use `to: '.'` instead of a separate pathname subscription. `CreateReportModal` builds the preserved query params in `onSuccess` instead of a `useMemo`. - Tests use the shared `createTestRouter` and `customRender` router. `LocalDropdown` now tests that the hash is kept. Addresses [FE-5109](https://linear.app/supabase/issue/FE-5109/replace-the-nextrouter-shims-with-tanstack-router-hooks) ## To test - [x] Query Insights: select a query and confirm search/filter updates keep selection while switching projects/routes clears it; navigating to Logs keeps Logs' query params intact and pressing Back restores Query Insights' `?search=` param cleanly - [x] Auth / Sign-in flows: sign in, sign up, MFA, recovery code, forgot/reset password, and partner sign-in preserve `returnTo` and redirect as expected - [x] Organization & Project flows: creating an org/project, accepting an org invite, claiming a project, redeeming credits, and deleting/pausing/restarting a project or branch navigate cleanly - [ ] Logs & Reports: replica selector appears on supported log routes (`LOG_ROUTES_WITH_REPLICA_SUPPORT`), saved log queries open, and custom reports create/navigate properly - [ ] Sidebar, LocalDropdown, UserDropdown, Integrations (Cron/Queues/Marketplace), Advisors/Linter, and Unified Logs navigate cleanly --------- Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com> |
||
|
|
f314e6dc19 |
feat(studio): one click attribute filters in the unified logs overview panel (#53170)
## Problem Filtering via properties in the Overview tab of Unified Logs had a couple of clicks to it. ## Solution Attribute rows now expose equals and not-equals directly, through one shared code path. - **Hover devices** (`(hover: hover) and (pointer: fine)` above `md`): hovering or keyboard-focusing a row reveals borderless icon buttons at its right edge — equals, not equals, copy — following the same reveal pattern as the "Only" button on the sidebar filters. The value fades out behind them so nothing is occluded or reflowed. - **Touch devices and small viewports**: unchanged dropdown, now listing "Filter: equals", "Filter: not equals" and "Copy <attribute>" instead of the single "Add filter". - Only rows that can actually be filtered get filter actions; everything else gets copy alone. | Before | After | |--------|--------| | <img width="451" height="191" alt="Screenshot 2026-11-09 at 16 12 08" src="https://github.com/user-attachments/assets/ffc68a34-4373-44ea-8922-8f5b3dd436a0" /> | <img width="465" height="148" alt="Screenshot 2026-11-09 at 16 12 25" src="https://github.com/user-attachments/assets/0bf41014-25d7-4390-ba5f-ab7a796ec1de" /> | ## Review instructions 1. Open the preview, go to a project's Logs, and click a log row to open the detail dock on the Overview tab. 2. Hover a filterable row (Path, Method, Status, or any attribute). Equals, not-equals and copy buttons fade in at the right edge; the value fades out. Tab into them to check the focus rings and tooltips. 3. Click the equals button on Path. The filter appears in the filter bar and the log list updates. Do the same with not-equals on another row and confirm the chip uses `<>`. 4. Hover a row that can't be filtered (for example Host or Client). Only the copy button appears, and no filter action is offered. 5. Apply the same filter twice — no duplicate chip. Then apply the opposite operator on that column — the chip's operator is replaced rather than mixed. 6. Narrow the window below 768px (or use a touch device). The hover buttons disappear and clicking a row opens the dropdown with "Filter: equals", "Filter: not equals" and "Copy <attribute>". |
||
|
|
7867f22522 |
feat(studio): link log users and show Auth activity timelines (#50837)
Add a User tab that resolves the signed-in user from the selected log or a related request step. It shows the shared Auth profile, offers filtering from the User ID row, and explains anonymous, external, or deleted users. When unified logs are enabled, the Auth user's Logs tab shows the user's 10 most recent logs in `EmbeddedLogsTable`, with the Logs page's columns and row styling. A row opens that log on the Logs page, filtered to the user, and View more in Logs opens the rest. Other configurations retain the existing Logs view. Shared user presentation is isolated in #50841; this PR contains the log/Auth integration and resolves missing-user queries to null. The list uses the #50953 helpers instead of its own: `createUnifiedLogsSearch` builds the query search, `buildUnifiedLogsUrl` builds the links (it now takes a `logId` to open a log), and the query asks for only the 10 rows it shows via `pageSize`. At the panel's default width the table is wider than the panel, so Event message needs a horizontal scroll; the empty state renders outside the table so it stays in view. Issue: [DEBUG-222](https://linear.app/supabase/issue/DEBUG-222/build-correlated-log-and-user-connections-in-studio) ### How to test 1. With the Unified Logs preview and `otelUnifiedLogs` enabled, open a signed-in user's log and select User. Check the profile, copy the User ID, and use Add filter to filter logs to that user. 2. Use Open in Authentication, then open the user's Logs tab. Select a row and confirm it opens the matching log; check that View more in Logs preserves the user filter. 3. Open an anonymous request and confirm the explanatory state. For correlated, external, and deleted-user cases, run the fixtures: `pnpm --filter studio exec vitest run components/interfaces/UnifiedLogs/components/LogUser.platform.test.tsx`. 4. In the log's User tab, focus User ID and press Enter, Arrow Down, Enter. Confirm it copies the ID without changing the selected log. Arrow Down should navigate logs again after the menu closes. ### Validation - Latest head: `8e4a9993b0db52ec5e611e55233b5ed77f67e358`, based on `master`, with conflicts resolved and independent review complete. - Local baseline and shuffled verification passed 324 tests across 26 files with retries disabled (shuffle seed `5083710`). An independent affected-suite run passed 29 tests with retries disabled and shuffle seed `5083730`. - Live QA found and reproduced a keyboard collision: field-menu Arrow Down also selected the next log. The shared menu now keeps keyboard events inside the menu. The regression fails when the guard is removed and passes after restoration. - On the verified latest-head preview, keyboard User ID copy, mouse copy, Add filter, Escape, navigation after closing the menu, and adjacent Auth email copying passed. No browser console errors were observed; browser network telemetry was unavailable. - Full signed-in activity, matching log/profile, Authentication navigation, View more filtering, anonymous state and deleted-user handling passed on `311206f9ef`. The subsequent change only affects menu keyboard propagation, which was revalidated on the latest head. - The disposable staging user was deleted and absence verified. Temporary key files were removed and the clipboard cleared. - Current CI: all E2E suites, unit tests, formatting, lint, Docker and deployments passed; typecheck is still running. Local full typecheck exhausted Node's heap, so no local full pass is claimed. ### Stack All prerequisite log-decoupling and request-correlation PRs, including #50841, are merged into `master`. This is the final code PR in the stack. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |
||
|
|
bd62dec2e2 |
refactor(studio): share Auth user cards and detail fields (#50841)
Extract shared Auth user cards and copyable detail fields, and use the shared raw-JSON display in the user panel. The existing Logs view remains available; unified activity timelines and log-user filtering arrive separately in #50837. This includes display-name/initials coverage and the Auth panel's component and browser tests. The browser test now verifies keyboard copying and Escape panel dismissal separately: the existing Auth Escape shortcut closes the details panel, so expecting it to restore focus to a field was incorrect. Its Raw JSON check reads the copied JSON's fields, since the code view's text includes line numbers. `UserCard` is Studio's first `Avatar`, so `vite.config.ts` pins `avatar.tsx` to its own chunk, like `field`, `drawer` and `slider`. Otherwise Rolldown pools it into the Auth `users` page chunk that the `ui` barrel then imports back, a chunk cycle that fails the TanStack build. ### How to test 1. Open an existing user in Authentication → Users. Check the profile card, overview fields, and name/avatar fallbacks for a user without profile metadata. 2. Open a copyable field using both mouse and keyboard (Enter), choose Copy, and check the clipboard value. 3. Open Raw JSON, scroll, and use the floating copy button. Confirm the existing Logs tab still opens and Escape closes the user panel. ### Validation - Final head `f4f8cb22e97fefac56c68b4676184d8358d8080e` targets master without conflicts. - Focused local tests: 13 passed across three files, retries disabled, including independent shuffled seed 5084131. Real panel/MSW tests cover field copying and complete nested JSON; fallback and Unicode regressions detect the original broken behavior. - Browser QA passed on `6b49434339`: nameless profile fallback, overview fields, mouse/keyboard copying, Raw JSON scrolling/copying, existing Logs tab, and Escape dismissal. Later commits change only the E2E test; application code is identical. - All GitHub checks passed on the final head, including four unit-test shards, four Next/TanStack E2E shards, typecheck, formatting, lint ratchet, knip, and Studio Docker build. - Independent review found no remaining issues; all review threads are resolved. - Fresh final-head studio-staging preview is blocked during dependency installation: the registry returns HTTP 451 for `react-hook-form@7.72.1`. The earlier matching application preview passed browser QA; this deployment failure remains visible. ### Stack Based on the logs table building blocks stack, which merges first: #50953 → #50954 → #50955 → #50957 → #50958 → #52281. Then merge in order: 1. #50835 — grouped log overviews and raw JSON 2. #50840 — request correlation queries 3. #50836 — request timeline UI and folding 4. #50841 — shared Auth user details 5. #50837 — log user correlation and Auth activity --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jordi Enric <jordi.err@gmail.com> |