Commit Graph
4 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
kemal.earth f314e6dc19 feat(studio): one click attribute filters in the unified logs overview panel (#53170)
## Problem

Filtering via properties in the Overview tab of Unified Logs had a
couple of clicks to it.

## Solution

Attribute rows now expose equals and not-equals directly, through one
shared code path.

- **Hover devices** (`(hover: hover) and (pointer: fine)` above `md`):
hovering or keyboard-focusing a row reveals borderless icon buttons at
its right edge — equals, not equals, copy — following the same reveal
pattern as the "Only" button on the sidebar filters. The value fades out
behind them so nothing is occluded or reflowed.
- **Touch devices and small viewports**: unchanged dropdown, now listing
"Filter: equals", "Filter: not equals" and "Copy &lt;attribute&gt;"
instead of the single "Add filter".
- Only rows that can actually be filtered get filter actions; everything
else gets copy alone.

| Before | After |
|--------|--------|
| <img width="451" height="191" alt="Screenshot 2026-11-09 at 16 12 08"
src="https://github.com/user-attachments/assets/ffc68a34-4373-44ea-8922-8f5b3dd436a0"
/> | <img width="465" height="148" alt="Screenshot 2026-11-09 at 16 12
25"
src="https://github.com/user-attachments/assets/0bf41014-25d7-4390-ba5f-ab7a796ec1de"
/> |

## Review instructions

1. Open the preview, go to a project's Logs, and click a log row to open
the detail dock on the Overview tab.
2. Hover a filterable row (Path, Method, Status, or any attribute).
Equals, not-equals and copy buttons fade in at the right edge; the value
fades out. Tab into them to check the focus rings and tooltips.
3. Click the equals button on Path. The filter appears in the filter bar
and the log list updates. Do the same with not-equals on another row and
confirm the chip uses `<>`.
4. Hover a row that can't be filtered (for example Host or Client). Only
the copy button appears, and no filter action is offered.
5. Apply the same filter twice — no duplicate chip. Then apply the
opposite operator on that column — the chip's operator is replaced
rather than mixed.
6. Narrow the window below 768px (or use a touch device). The hover
buttons disappear and clicking a row opens the dropdown with "Filter:
equals", "Filter: not equals" and "Copy &lt;attribute&gt;".
2026-11-09 18:12:43 +00:00
7867f22522 feat(studio): link log users and show Auth activity timelines (#50837)
Add a User tab that resolves the signed-in user from the selected log or
a related request step. It shows the shared Auth profile, offers
filtering from the User ID row, and explains anonymous, external, or
deleted users.

When unified logs are enabled, the Auth user's Logs tab shows the user's
10 most recent logs in `EmbeddedLogsTable`, with the Logs page's columns
and row styling. A row opens that log on the Logs page, filtered to the
user, and View more in Logs opens the rest. Other configurations retain
the existing Logs view. Shared user presentation is isolated in #50841;
this PR contains the log/Auth integration and resolves missing-user
queries to null.

The list uses the #50953 helpers instead of its own:
`createUnifiedLogsSearch` builds the query search, `buildUnifiedLogsUrl`
builds the links (it now takes a `logId` to open a log), and the query
asks for only the 10 rows it shows via `pageSize`. At the panel's
default width the table is wider than the panel, so Event message needs
a horizontal scroll; the empty state renders outside the table so it
stays in view.

Issue:
[DEBUG-222](https://linear.app/supabase/issue/DEBUG-222/build-correlated-log-and-user-connections-in-studio)

### How to test

1. With the Unified Logs preview and `otelUnifiedLogs` enabled, open a
signed-in user's log and select User. Check the profile, copy the User
ID, and use Add filter to filter logs to that user.
2. Use Open in Authentication, then open the user's Logs tab. Select a
row and confirm it opens the matching log; check that View more in Logs
preserves the user filter.
3. Open an anonymous request and confirm the explanatory state. For
correlated, external, and deleted-user cases, run the fixtures: `pnpm
--filter studio exec vitest run
components/interfaces/UnifiedLogs/components/LogUser.platform.test.tsx`.
4. In the log's User tab, focus User ID and press Enter, Arrow Down,
Enter. Confirm it copies the ID without changing the selected log. Arrow
Down should navigate logs again after the menu closes.

### Validation

- Latest head: `8e4a9993b0db52ec5e611e55233b5ed77f67e358`, based on
`master`, with conflicts resolved and independent review complete.
- Local baseline and shuffled verification passed 324 tests across 26
files with retries disabled (shuffle seed `5083710`). An independent
affected-suite run passed 29 tests with retries disabled and shuffle
seed `5083730`.
- Live QA found and reproduced a keyboard collision: field-menu Arrow
Down also selected the next log. The shared menu now keeps keyboard
events inside the menu. The regression fails when the guard is removed
and passes after restoration.
- On the verified latest-head preview, keyboard User ID copy, mouse
copy, Add filter, Escape, navigation after closing the menu, and
adjacent Auth email copying passed. No browser console errors were
observed; browser network telemetry was unavailable.
- Full signed-in activity, matching log/profile, Authentication
navigation, View more filtering, anonymous state and deleted-user
handling passed on `311206f9ef`. The subsequent change only affects menu
keyboard propagation, which was revalidated on the latest head.
- The disposable staging user was deleted and absence verified.
Temporary key files were removed and the clipboard cleared.
- Current CI: all E2E suites, unit tests, formatting, lint, Docker and
deployments passed; typecheck is still running. Local full typecheck
exhausted Node's heap, so no local full pass is claimed.

### Stack

All prerequisite log-decoupling and request-correlation PRs, including
#50841, are merged into `master`. This is the final code PR in the
stack.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-29 16:15:21 +01:00
bd62dec2e2 refactor(studio): share Auth user cards and detail fields (#50841)
Extract shared Auth user cards and copyable detail fields, and use the
shared raw-JSON display in the user panel. The existing Logs view
remains available; unified activity timelines and log-user filtering
arrive separately in #50837.

This includes display-name/initials coverage and the Auth panel's
component and browser tests. The browser test now verifies keyboard
copying and Escape panel dismissal separately: the existing Auth Escape
shortcut closes the details panel, so expecting it to restore focus to a
field was incorrect. Its Raw JSON check reads the copied JSON's fields,
since the code view's text includes line numbers.

`UserCard` is Studio's first `Avatar`, so `vite.config.ts` pins
`avatar.tsx` to its own chunk, like `field`, `drawer` and `slider`.
Otherwise Rolldown pools it into the Auth `users` page chunk that the
`ui` barrel then imports back, a chunk cycle that fails the TanStack
build.

### How to test

1. Open an existing user in Authentication → Users. Check the profile
card, overview fields, and name/avatar fallbacks for a user without
profile metadata.
2. Open a copyable field using both mouse and keyboard (Enter), choose
Copy, and check the clipboard value.
3. Open Raw JSON, scroll, and use the floating copy button. Confirm the
existing Logs tab still opens and Escape closes the user panel.

### Validation

- Final head `f4f8cb22e97fefac56c68b4676184d8358d8080e` targets master
without conflicts.
- Focused local tests: 13 passed across three files, retries disabled,
including independent shuffled seed 5084131. Real panel/MSW tests cover
field copying and complete nested JSON; fallback and Unicode regressions
detect the original broken behavior.
- Browser QA passed on `6b49434339`: nameless profile fallback, overview
fields, mouse/keyboard copying, Raw JSON scrolling/copying, existing
Logs tab, and Escape dismissal. Later commits change only the E2E test;
application code is identical.
- All GitHub checks passed on the final head, including four unit-test
shards, four Next/TanStack E2E shards, typecheck, formatting, lint
ratchet, knip, and Studio Docker build.
- Independent review found no remaining issues; all review threads are
resolved.
- Fresh final-head studio-staging preview is blocked during dependency
installation: the registry returns HTTP 451 for
`react-hook-form@7.72.1`. The earlier matching application preview
passed browser QA; this deployment failure remains visible.

### 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-29 15:22:12 +01:00