Files
supabase/apps/studio/components
David WhittingtonandClaude Opus 5 cef32c0cd2 fix(logs): bound the OTEL single-log lookup by source and timestamp
The Logs Explorer's single-log lookup (`genSingleLogQueryOtel`, used by
`useSingleLog` when a row is selected) matched on `id` alone and ran over
the previewer's whole selected range. `id` is not part of the ClickHouse
logs table's sort key, so every row click scanned the entire window while
materializing `log_attributes` — the widest column in the table by a wide
margin.

Two bounds, both already available client-side:

- `AND source = '...'`, derived from the table the previewer is showing.
  `source` is the second component of the sort key, so it narrows the
  sorted range before the time bound applies.
- A ±1 minute `iso_timestamp_*` bracket around the selected row's own
  timestamp, read from the page already in memory. Falls back to the
  search range when unknown (a deep-linked `?log=<id>` that isn't in a
  loaded page).

This applies the fix #47978 already made for the unified-logs inspection
query to the legacy previewer, which was missed at the time — same
reasoning, same ±1 minute window, same source-filter rationale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 18:23:20 -05:00
..

Writing components

Where to create your components

  • For components that declare the general structure and layout of a page:
    • /components/layouts/xxx
  • For components that are tightly coupled to a specific interface:
    • /components/interfaces/xxx
  • For components that are meant to be reusable across multiple pages:
    • /components/ui/xxx
  • Note: We're gradually moving files out of the to-be-cleaned folder into the respective folders as we refactor

Component structure

  • If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an index.tsx as an entry point
  • Otherwise it can just be a file on its own
  • For example:
    • components/ui
      - SampleComponentA
        - SampleComponentA.tsx
        - SampleComponentA.constants.ts
        - SampleComponentA.utils.ts
        - SampleComponentA.types.ts
        - index.ts
      - SampleComponentB.tsx
      

Template for building components


// Declare the prop types of your component
interface ComponentAProps {
  sampleProp: string
}

// Name your component accordingly — use a named export, not a default export
export const ComponentA = ({ sampleProp }: ComponentAProps) => {
  return <div>ComponentA: {sampleProp}</div>
}