The Overview's "Errors in the last 24h" section now uses the Logs tab's
queries (#50954) and the read-only `EmbeddedLogsTable` (#50953) instead
of its own SQL and table. It previews the latest five errors since the
last deploy, capped at 24h, shows "+N more" when there are more and
links to the rest. It's behind the `edgeFunctionsOverview` flag, like
the rest of the new Overview.
- Rows have no multi-select checkbox. Clicking one opens it in the Logs
tab with the same range and error filter, and "View logs" and "+N more"
open the filtered list.
- With the unified logs preview off, those links open the pre-unified
Invocations tab (for invocation rows) or Logs tab (for runtime rows),
using those tabs' own `its`/`ite`/`log` params.
- "Explain with AI" and "Copy summary" send the previewed errors to the
Assistant with the same prompt as selected logs on the Logs page. The
prompt also notes how many errors were left out.
- One count query, scoped to the function and unfiltered, gives both the
error count behind "+N more" and the invocations since the deploy, from
its level and log type facets. It replaces the hand-built invocation
count SQL, so the section runs two queries instead of three.
- The row query fetches only the five errors shown, through a new
`pageSize` option on `useUnifiedLogsInfiniteQuery`.
- The section uses the edge function preset from #50957, so it runs the
Logs tab's scoped queries and shares its saved columns.
- The custom error grouping and its SQL are removed. Net, the PR removes
about 390 lines.
### How to test
1. With `edgeFunctionsOverview` on, open a function that has recent
errors. You should see up to five rows without checkboxes, and "+N more"
when there are more.
2. Click a row with the unified logs preview on. It opens the Logs tab
with that log selected. Turn the preview off and click an invocation row
and a runtime row. They open Invocations and Logs respectively.
3. Use Explain with AI and Copy summary and check the prompt.
4. For a function with no errors since the last deploy, the section
shows the invocation count instead.
### Validation
- MSW component tests: preview rows and "+N more", no checkboxes, the
summary prompt, row links with the preview on and off, and the no-errors
state. They also check the row query asks for five rows and that a
single unfiltered count runs. `pageSize` and the facet count helper have
unit tests.
- Studio typecheck, lint ratchet, Prettier and knip pass on this layer.
### Stack
Merge in order:
1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
The edge function detail layout is now breadcrumbs plus tabs
(`PageNav`), without the page header, so tabs like Logs and Code get the
full height below the tabs. The function name, invoke URL and last
deploy details move into a header on the Overview tab, which also holds
the chart period selector. Both the new and legacy Overview render it,
and both now default to a 1 hour period instead of 15 minutes.
The Overview sections (invocations, errors, performance and usage) now
sit in one default-width `PageContainer` instead of each nesting a
full-width one, and the invocations chart moves into a chart card.
Invocations has no section heading, since it's the headline metric right
below the page header.
Both overview versions use the same chart periods. Sparse chart data is
filled only between returned API buckets, avoiding synthetic zeros
outside the reported range. Chart navigation uses the full rolling
period, including a full day for the 1 day option.
The selector shows a checkmark for the selected period, and the header
announces loaded details. Self-hosted Studio retains a Copy URL action
in the detail toolbar because it has no Overview tab.
This layer doesn't depend on the logs changes below it.
**Heads-up:** the header now only appears on Overview. Code, Details,
Invocations and Logs show breadcrumbs and tabs only. This change isn't
behind a flag.
### How to test
1. Open an edge function's Overview. The header shows the name, URL
(with copy) and last deploy hover card, and the period selector sits in
the header with 1 hour selected.
2. Switch through the other tabs. Breadcrumbs and tabs stay sticky, and
there's no header.
3. With the `edgeFunctionsOverview` flag off, the legacy Overview
renders with the same header.
### Validation
- 104 focused tests pass with retries disabled and shuffled order (seed
50968). New tests cover both overview versions, period changes, empty
results, header loading and copying, and self-hosted URL copying. Test
names describe observable behavior.
- 12 targeted regression mutations were detected and restored; the
selected-indicator mutation was repeated after the visual alignment fix.
- Browser QA on the staging preview for `3d055c0dc4` covers the header
and deploy details, copied URL, period changes, all detail tabs, sticky
navigation, the legacy overview, and empty results. Temporary local flag
overrides were removed. The final test-only commit `5af6a2896b` has
identical production code; its matching preview also passed header,
URL-copy, period-switching, and Settings smoke checks.
- Independent code review and changed-file formatting checks pass. All
40 executed CI checks pass on `5af6a2896b`, including TypeScript/lint,
unit tests, Next.js and TanStack E2E tests, and builds. All six review
threads are resolved.
### Stack
Merge in order:
1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
## Context
This is largely just a mechanical change here:
Opting to use lucide icons with the `Icon` suffix across all icon
imports within `studio`
- so that it’s clearer which components are icons + reduces the
possibility of name collision with our own components
- e.g <User /> vs <UserIcon />
Also added a eslint rule for this:
<img width="1069" height="167" alt="image"
src="https://github.com/user-attachments/assets/7f36f443-5ca2-4bf6-8d22-86e774513bfc"
/>
And updated `AGENTS.md` as such:
```
Icons come from `lucide-react`, always imported with the `Icon` suffix (`import { CheckIcon, Trash2Icon } from 'lucide-react'`) — never the bare names (`Check`) or `Check as CheckIcon` aliases (lint-enforced).
```
## What kind of change does this PR introduce?
Refactor. Follow-up to #49871.
## What is the current behavior?
Branded (green) text still uses the `text-brand` classname while the
colour comes from `--primary`.
## What is the new behavior?
**Rename-only:** `text-brand` → `text-primary` across callsites and
docs. Leftover `bg-brand` / `border-brand` alias to `brand-default`. No
intentional colour changes in this PR.
This better matches how we treat our green in other components and
props, like `variant="primary"` for green buttons.
## To test
On light mode: smoke-test that branded text still looks like #49871
(readable green, not the bright fill).
-
[Homepage](https://zone-www-dot-com-git-dnywh-depr-316-text-brand-de2380-supabase.vercel.app/):
“Scale to millions” uses `text-primary`
- [Docs
homepage](https://docs-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/docs):
branded links like “More on self-hosting” are still readable
- [Typography
docs](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/typography):
documents `text-primary`
- [Colour
usage](https://design-system-git-dnywh-depr-316-text-brand-to-primary-supabase.vercel.app/design-system/docs/color-usage):
`text-primary` is visibly darker than `bg-brand-default` _on light mode_
- [Studio auth
providers](https://studio-staging-git-dnywh-depr-316-text-brand-to-60fa6c-supabase.vercel.app/dashboard/project/_/auth/providers):
enabled provider badge text readable; status dot stays bright green
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Style**
* Updated branded text, link hover states, icons, badges, indicators,
and highlighted content across the Design System, Docs, Studio, Learn,
UI Library, and marketing experiences to use the primary theme color.
* Updated syntax highlighting and table-of-contents styling for
consistent primary-color presentation.
* Refined brand color fallback behavior for bright fills and borders.
* **Documentation**
* Updated color-usage and typography guidance to recommend the primary
text utility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Problem
The edge function overview's "Errors since last deploy" panel queried
ClickHouse from the deploy timestamp to now, with no upper bound. When a
function had not been redeployed in a long time, this produced an
unbounded query range, which is suspected to have caused a recent uptime
incident.
## Fix
`getSinceLastDeployLogRange` now clamps the query start to at most 24
hours before now, shared by all three queries this panel issues
(invocation list, invocation count, runtime logs). The section title was
also updated from "Errors since last deploy" to "Errors in the last 24h"
to reflect the new bound.
## How to test
- Open an edge function's overview page for a function that was deployed
more than 24 hours ago
- Confirm the "Errors in the last 24h" panel loads without an
excessively large query range
- Expected result: the panel only queries the last 24 hours of logs
regardless of how old the last deploy was
- Run `pnpm test:studio -- EdgeFunctionRecentErrors.utils` and confirm
the range-clamping tests pass
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Updated the Edge Function errors section to show errors from the last
24 hours.
- **Bug Fixes**
- Limited error log searches to a maximum 24-hour window, preventing
outdated results from appearing.
- Improved handling of error time ranges when the last deployment
occurred earlier than the available window.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Context
Just extracting the fixes which I think are applicable from this
[PR](https://github.com/supabase/supabase/pull/47695)
Main files are
- `apps/studio/hooks/analytics/useLogsQuery.tsx`
- `packages/common/auth.tsx`
- `packages/common/feature-flags.tsx`
## Changes involved
- Adjust `useLogsQuery` to accept an object as prop, rather than 4
individual params
- This one doesn't address any Sentry issues, but is just a improvement
to the function's API imo, more readable
- Adjust how user email is retrieved in `feature-flags`
- Related Sentry issue
[here](https://supabase.sentry.io/issues/7592718607/?project=5459134)
- The error is a bit vague, but Claude's attempt to fix looks alright in
general IMO
- Minimally verified that feature flags are loading as expected still
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved log-related screens and queries for more reliable loading and
filtering across the app.
* Fixed profile and account data handling so identity details are
retrieved more consistently.
* Improved authentication handling to better recognize missing user data
and keep the app stable.
* Updated feature flag personalization to use more accurate account
information.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Problem
The edge function overview page (gated by the \`edgeFunctionsOverview\`
flag) runs three log queries against the legacy BigQuery \`logs.all\`
endpoint. These need to move to the ClickHouse-backed \`logs.all.otel\`
endpoint to stay consistent with the rest of the logs migration.
## Fix
Rewrote the three SQL query builders in
\`EdgeFunctionRecentErrors.utils.ts\` from BigQuery syntax to ClickHouse
syntax targeting the \`edge_logs\` OTEL schema. Added \`{ useOtel: true
}\` to all three \`useLogsQuery\` calls to route them to the
\`logs.all.otel\` endpoint.
Key field mappings used:
- \`metadata[0].function_id\` -> \`LogAttributes['function_id']\`
- \`metadata[0].execution_id\` -> \`LogAttributes['execution_id']\`
- \`metadata[0].level\` / \`metadata[0].event_type\` -> \`SeverityText\`
/ \`LogAttributes['event_type']\`
- \`timestamp\` -> \`toUnixTimestamp64Micro(Timestamp)\` (preserves
microsecond integer format expected downstream)
- HTTP invocations filtered by \`LogAttributes['event_type'] =
'Request'\`
- Runtime logs filtered by \`LogAttributes['event_type'] = 'Log'\`
## How to test
- Enable the \`edgeFunctionsOverview\` feature flag on a project that
has an edge function with recent invocations and errors
- Navigate to the function overview page
- The "Errors since last deploy" section should load and display error
groups correctly
- Each error group should show count, last seen time, method, status
code, and execution time
- Expanding a group should show related runtime logs beneath it
- With no errors, the empty state should show the invocation count since
last deploy
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved Edge Function recent errors with more accurate filtering of
server-side failures.
* Expanded Edge Function runtime log coverage for clearer event
visibility.
* Refreshed Edge Function since-deploy invocation counts to better match
current log querying behavior.
* **Documentation**
* Refined “minimal, well-formed query” guidance, including requiring an
identifying comment at the start and clearer log source scoping
examples.
* **Tests**
* Updated unit tests to match the revised SQL/log filtering and
selection logic.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
## Problem
Knip reports many duplicate exports (both named and default). Besides,
we're moving away from default exports and even have an eslint rule to
enforce it on new code.
## Solution
- Cleanup those exports
- Update imports when necessary
No functional changes. If it builds, it's fine
## Problem
Our `<Button>` component breaks the default `button` contract by
redefining the `type` prop to set its variant (`primary`, `default`,
etc) instead of the button type (`submit`, `button`, etc).
This is confusing and forces to write more code when using it with
shadcn components that expect/inject the standard button props.
## Solution
- rename the `type` prop to `variant`
- rename the `htmlType` prop to `type`
- propagate the changes where necessary
- format code
## How to test
As this is just prop renaming, if it builds it's ok
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
This PR migrates the whole monorepo to use Tailwind v4:
- Removed `@tailwindcss/container-queries` plugin since it's included by
default in v4,
- Bump all instances of Tailwind to v4. Made minimal changes to the
shared config to remove non-supported features (`alpha` mentions),
- Migrate all apps to be compatible with v4 configs,
- Fix the `typography.css` import in 3 apps,
- Add missing rules which were included by default in v3,
- Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot
of classes
- Rename all misnamed classes according to
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all
apps.
---------
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
## Summary
Improve the "Errors since last deploy" panel on the new edge function
overview page.
- **Error column**: stop showing the function URL. Pull the actual error
from the related runtime logs, trim the stack trace to a one-line
summary, and use that for the cell text and tooltip.
- **Troubleshoot column**: rename "Assistant" to "Troubleshoot" and add
a "View troubleshooting guide" item to the dropdown that opens
`supabase.com/docs/guides/troubleshooting` prefilled with `edge function
<ErrorType> <statusCode>`.
- **Runtime log block**: restyle the expanded per-row log section.
Monospace rows with structured timestamp / level badge / count /
message, a divider between entries, and destructive tinting only on
error rows. The previous layout ran text together with no separation.
## Test plan
- [x] `pnpm test:studio` for `EdgeFunctionRecentErrors.utils.test.ts`
(10 passing, including new cases for `summarizeErrorMessage`,
`getDisplayErrorMessage`, and `buildTroubleshootingDocsUrl`)
- [x] `pnpm typecheck` clean
- [x] `eslint` clean for changed files
- [ ] Visual check of the panel: Error cell shows the runtime error
summary, Troubleshoot dropdown opens docs in a new tab, log rows render
with the new structure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added a "View troubleshooting guide" action that opens a
status-code-specific docs page for each recent error.
* Errors now show level badges and repetition counts in the logs for
clearer scanning.
* **Bug Fixes**
* Error text is summarized and normalized for concise, single-line
display with clearer per-line styling.
* **Tests**
* New tests validate error-summary, display-fallback, and
troubleshooting-URL behaviors.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* **Refactor**
* Updated internal module import paths to use standardized alias
conventions across the codebase.
* Reorganized import statement ordering for improved code consistency.
<img width="1575" height="1134" alt="image"
src="https://github.com/user-attachments/assets/994b1113-717f-44a2-89a4-13bc0182db20"
/>
Attempts to improve our edge function overview pages to provide stronger
insights into the health of a function, including reliability (error
rates), performance (execution times) and usage (cpu and memory).
As part of this work it refactors existing charts to use our new chart
components.
main consideration is the collective performance of error queries
https://github.com/supabase/supabase/pull/44009/changes#diff-2a79cf61c5397a8ef363c333229fa7729a2efc90a4d8e0806e49c212d5aa97e7
## To test:
1. Create an edge function that errors out randomly across requests. You
can use cron to poll this function every second.
2. View the edge function and on the overview page confirm that errors
are showing and grouped correctly in recent failed invocations sections.
---------
Co-authored-by: Ali Waseem <waseema393@gmail.com>