mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
<img width="823" height="614" alt="image" src="https://github.com/user-attachments/assets/1c1ac47f-07e2-4bbe-a91e-5690e849e519" /> ## Problem The log detail panel felt cramped. The header split across two lines, contrast between the header, tabs and properties was weak, and long values overflowed their column. Edge function logs also had no path in the unified logs query, so their title fell back to the raw event message, which repeated the status and cut off the function name. The panel also moved under the user. Clicking a Timeline step jumped to Overview, so stepping through a request meant switching back each time, and an "Enriching log..." row pushed the details down while they loaded. ## Solution - **Header:** one line with the type icon, status badge, method and path. The log type name moves to the icon's tooltip. Long paths clip from the start so the most specific segment stays visible. - **Type and spacing:** 15px title, 12px property labels and values, 40px section and "Logged" rows, and more room around the tabs. The panel uses the card background. - **Long values:** wrap inside their column instead of overlapping the label. - **Edge function paths:** the ClickHouse query now reads `request.pathname` for `function_edge_logs`, matching the BigQuery query. - **Timeline:** clicking a step keeps the Timeline tab open, while the header, actions and other tabs follow the clicked log. A single hidden step is shown instead of "+1 more", and the first step shows its absolute time in place of the "Request started" row. - **Loading:** the header's type icon becomes a spinner of the same size while the log's details load, replacing the "Enriching log..." row. - **User tab:** the "No signed-in user" state uses the same centered empty state as the Timeline tab. Side effects to check: - Edge function rows now fill the Path column, so function-scoped tables can show that column. Path filters and facets include these rows, and Timeline steps show method and path. - Audit Logs and the Auth Users panel share these components. Audit Logs picks up the taller section rows, and Auth Users fields drop to 12px. ## How to test On `/project/<ref>/logs`: 1. Select an API Gateway log. The header is one line: icon, status badge, `METHOD /path`. The icon spins while details load, and nothing below it shifts when it stops. 2. Open **Timeline** and click a few steps. The tab stays on Timeline while the header and highlight follow each click, and Overview then shows the clicked log. The first step shows a time instead of `+0 ms`. 3. Select an edge function log. The title shows `METHOD /functions/v1/<name>` and the Path column is filled. Filtering by part of that path matches these rows. 4. Select a Postgres log. The title shows the message, and its **User** tab shows a centered empty state like Timeline's "No related logs". 5. Select a log with a long URL in a narrow panel. Values wrap inside their column and the title clips from the start. This has only been checked in Chromium. 6. Open an entry in Audit Logs and a user in Auth > Users, and check the spacing and type. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { LucideIcon } from 'lucide-react'
|
|
import { ReactNode } from 'react'
|
|
import { cn } from 'ui'
|
|
|
|
export type IconComponent =
|
|
| LucideIcon
|
|
| React.ComponentType<{ size?: number; strokeWidth?: number; className?: string }>
|
|
|
|
interface DetailSectionHeaderProps {
|
|
title: string
|
|
icon?: IconComponent
|
|
summary?: ReactNode
|
|
className?: string
|
|
}
|
|
|
|
export const DetailSectionHeader = ({
|
|
title,
|
|
icon: Icon,
|
|
summary,
|
|
className,
|
|
}: DetailSectionHeaderProps) => (
|
|
<div className={cn('relative flex h-10 items-center justify-between gap-3 px-4', className)}>
|
|
<div className="flex min-w-0 items-center gap-2">
|
|
{Icon ? (
|
|
<Icon size={14} strokeWidth={1.5} className="shrink-0 text-foreground-lighter" />
|
|
) : (
|
|
<span className="w-3.5 shrink-0" aria-hidden />
|
|
)}
|
|
<span className="truncate heading-default text-foreground">{title}</span>
|
|
</div>
|
|
{summary !== undefined && summary !== null && summary !== '' ? (
|
|
<span className="truncate text-right font-mono text-xs text-foreground">{summary}</span>
|
|
) : null}
|
|
</div>
|
|
)
|