Commit Graph
5 Commits
Author SHA1 Message Date
Saxon FletcherandClaude Opus 5.5 07574deea7 chore(studio): refine log detail panel (#52750)
<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>
2026-11-17 07:14:44 +10:00
4f75659942 feat(studio): show request timelines with ordered active log folding (#50836)
Add a Timeline tab that displays related request logs and opens a
selected step in the overview. The panel summary, timestamp, and
navigation controls follow the active log.

Long timelines show the first three steps and retain the active log in
its chronological position. Separate controls count hidden rows before
and after it, for example `+3 more`, the active log, then `+2 more`.
Expanding either control restores the full order. Query construction and
fetching are reviewed separately in #50840.

### How to test

1. With `otelUnifiedLogs` enabled, open a non-compute log with related
request activity and select Timeline. Check chronological order, then
select a step and confirm its overview and panel summary update.
2. Expand a long timeline, select a later step, and return to Timeline.
The active step should stay in order, with separate hidden counts above
and below. For nine steps with the seventh active, expect `+3 more`, the
active step, then `+2 more` after the first three steps. Expand using
both mouse and Enter.
3. If a long request is unavailable, run the deterministic
folding/navigation cases: `pnpm --filter studio exec vitest run
components/interfaces/UnifiedLogs/components/RequestTimeline.platform.test.tsx
components/interfaces/UnifiedLogs/components/LogTimeline.utils.test.ts`.

### Validation

- Focused local unit/MSW suite: 260 tests passed across 18 files with
`--retry=0 --sequence.shuffle --sequence.seed=5083605`.
- Browser QA verified a real five-step request timeline and folding.
Nine-step folding and active-log ordering were verified with
deterministic fixtures.
- All checks triggered on head `6b80811bae` passed.
- Master-only typecheck, unit, formatting, and lint workflows do not run
against this stack base. Rerun them when the PR is retargeted to
`master`.

### 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>
2026-10-28 17:14:53 +01:00
671594c69c feat(studio): group log overviews and standardize raw JSON (#50835)
Logs without a service-specific overview now show common fields and
attributes in collapsible groups. Existing service overviews use the
same section layout, with the first section open. Configured fields
share one renderer across service overviews. Raw JSON uses shared
presentation for single-log, multi-log, and downstream Auth views, with
copy controls supplied by each view.

Attribute lookups are scoped to the selected log's source, ID, and
timestamp window and respect metadata visibility. It's based on the
#50953 stack; request correlation, timeline UI, and Auth changes are
separate layers. Sections use the `CollapsibleDetailSection` that master
now shares with the audit log pages, and the new Supavisor overview
follows the same layout: no separate time header, first section open.

### How to test

1. With Unified Logs and `otelUnifiedLogs` enabled, open an API Gateway
log and a Postgres or Auth log. Check the overview sections,
expand/collapse groups, and try copying a field.
2. Open Raw JSON on a log with enough metadata to scroll. Confirm the
copy button stays visible and copies the complete JSON.
3. Select multiple logs and confirm their combined JSON still renders
correctly.

### Validation

- Synced with master; verified head
`663ebfd13117ae3c5aa0de52e4488253a317d59f`.
- Focused local unit/MSW suite: 246 tests passed across 19 files with
retries disabled, both normally and with `--sequence.shuffle
--sequence.seed=50835`. Independent focused run: 24 tests passed with
seed 5083528.
- Browser QA on the matching studio-staging preview passed: API Gateway
and Postgres section expansion/collapse, field copying, scrolling and
copying complete Raw JSON, and copying multiple selected logs.
- All four unit-test shards, all four E2E shards, typecheck, formatting,
lint ratchet, and Studio Docker build passed. The Next.js E2E report
includes one storage-folder test that passed on retry.
- Independent code review found no actionable issues. Working tree
clean.

### 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>
2026-10-28 14:07:04 +01:00
Saxon Fletcher bc9bee459f refactor(studio): extract reusable logs table building blocks (#50953)
Extract shared logs tables and query helpers. Validate query parameters and preserve defaults, keep custom preview footers independent of pagination, and cover preview behavior and omitted log counts.
2026-10-26 13:06:29 +01:00
Saxon FletcherandClaude Opus 5 9b12165400 feat(studio): multi-select logs with click, shift, and keyboard ranges (#50689)
<img width="1454" height="786" alt="image"
src="https://github.com/user-attachments/assets/995790b1-a242-4a61-a0a0-349de7234923"
/>


Stack 4/4 · previous: #50688

## Problem

Selecting several logs to copy or send to the Assistant meant using a
separate checkbox column and a banner above the table. Clicking a row
and checking a row were two different selections.

## Solution

- Unified Logs uses `useTableRowSelection`, so a row click,
Cmd/Ctrl-click, Shift-click, and the checkbox all act on one selection.
The selection resets when the project or filters change, and a linked
`?id=` still restores its log.
- The level indicator and checkbox now share one column. The checkbox
shows on hover, focus, or when the row is selected.
- The detail panel shows every selected log: one log gets the tabs, and
two or more show their combined JSON. Copy-as-JSON and "Explain with AI"
move into the panel header (`LogSelectionActions`), replacing
`RowSelectionHeader`.
- New Shift+↑ / Shift+↓ shortcuts extend the selection, with a hint in
the panel footer. Prev/next navigation follows display order and keeps
the row in view.
- `LogTypeIcon` no longer puts a nested button inside clickable rows.

## Review instructions

1. Click a log, then Shift-click another. The range should be selected
and the panel should show the combined JSON.
2. Cmd-click to add or remove single logs. Use the copy button (or its
shortcut) and "Explain with AI".
3. With the panel open, press Shift+↑ / Shift+↓ to grow and shrink the
selection.
4. Change a filter. The selection should clear.

## Checklist

- [ ] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary

* **New Features**
* Added multi-row selection in Unified Logs, including additive, range,
checkbox, and keyboard selection.
* Added bulk JSON viewing and copying, plus AI-assisted actions for
selected logs.
* Added Shift+Arrow shortcuts to extend selections and improved row
navigation.
* **Accessibility**
* Improved labels and focus behavior for log controls and log type
indicators.
* **Bug Fixes**
* Kept single-log Overview and Raw JSON views available alongside
multi-log selection.
* Applied metadata visibility settings to selected-log actions and
disabled actions for invalid log data.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-25 19:03:01 +10:00