mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
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>
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { CheckIcon } from 'lucide-react'
|
|
import { Button } from 'ui'
|
|
|
|
import {
|
|
EDGE_FUNCTION_CHART_INTERVALS,
|
|
getSegmentedButtonClassName,
|
|
} from './EdgeFunctionOverview.utils'
|
|
|
|
interface EdgeFunctionIntervalSelectorProps {
|
|
interval: string
|
|
onIntervalChange: (interval: string) => void
|
|
}
|
|
|
|
export const EdgeFunctionIntervalSelector = ({
|
|
interval,
|
|
onIntervalChange,
|
|
}: EdgeFunctionIntervalSelectorProps) => (
|
|
<div className="flex items-center">
|
|
{EDGE_FUNCTION_CHART_INTERVALS.map((item, index) => (
|
|
<Button
|
|
key={`function-filter-${item.key}`}
|
|
variant={interval === item.key ? 'secondary' : 'default'}
|
|
aria-pressed={interval === item.key}
|
|
icon={
|
|
interval === item.key ? (
|
|
<CheckIcon size={12} aria-hidden="true" data-testid="selected-period-indicator" />
|
|
) : undefined
|
|
}
|
|
onClick={() => onIntervalChange(item.key)}
|
|
className={getSegmentedButtonClassName(index, EDGE_FUNCTION_CHART_INTERVALS.length)}
|
|
>
|
|
{item.label}
|
|
</Button>
|
|
))}
|
|
</div>
|
|
)
|