Skip to content

[SANDBOX] feat: reorganize trace view header and signals colors#1573

Draft
kolbeyang wants to merge 6 commits intoagent/lam-1397/trace-level-tags/6f21a5from
refactor/trace-view-header-signals
Draft

[SANDBOX] feat: reorganize trace view header and signals colors#1573
kolbeyang wants to merge 6 commits intoagent/lam-1397/trace-level-tags/6f21a5from
refactor/trace-view-header-signals

Conversation

@kolbeyang
Copy link
Copy Markdown
Collaborator

@kolbeyang kolbeyang commented Apr 2, 2026

Collapsed

image

Expanded

image

Traces table

image

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 2, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ skull8888888
✅ kolbeyang
❌ laminar-coding-agent[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@kolbeyang kolbeyang changed the base branch from main to dev April 2, 2026 23:53
@kolbeyang kolbeyang self-assigned this Apr 2, 2026
@kolbeyang kolbeyang changed the base branch from dev to agent/lam-1397/trace-level-tags/773e89 April 2, 2026 23:54
@kolbeyang kolbeyang changed the base branch from agent/lam-1397/trace-level-tags/773e89 to agent/lam-1397/trace-level-tags/6f21a5 April 2, 2026 23:54
* skeleton hash

* fixes

* fixes

* simplify
@kolbeyang kolbeyang force-pushed the refactor/trace-view-header-signals branch from 9a14f31 to 4ef47db Compare April 8, 2026 17:25
laminar-coding-agent bot and others added 3 commits April 8, 2026 18:34
* wip: initial setup

* feat(LAM-1397): add trace-level tags

Extend existing span-level tags to also work at the trace level, allowing
users to tag entire traces for easier retrieval and filtering.

- Add `trace_tags` column to ClickHouse `traces_replacing` table and
  recreate views with renamed columns: physical `tags` → view `span_tags`,
  physical `trace_tags` → view `tags`
- Add `trace_tags` column to PostgreSQL `traces` table with Drizzle migration
- Add trace tags API routes (POST to add, DELETE to remove) that update
  both ClickHouse and PostgreSQL
- Refactor `TagsContextProvider` to support both span and trace modes
  via a `TagsMode` discriminated union
- Update `pick-tag.tsx` and `create-tag.tsx` with mode-dependent API URLs
- Wire up trace header with real tag components replacing WIP placeholder
- Rename traces table "Tags" column to "Span tags", add new "Tags" column
  for trace-level tags, and enable filtering on both
- Add `span_tags` to query engine allowed columns
- Fix realtime SSE filter mapping for `tags` and `span_tags` keys
- Update Rust `Trace`, `CHTrace`, and `RealtimeTrace` structs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: avoid SWR cache type mismatch in trace mode tag uncheck

In trace mode, the SWR cache holds string[] (raw tag names from API),
but handleUncheckTag was writing SpanTag[] objects as optimistic data.
When the normalization in tags-context.tsx subsequently cast these
SpanTag objects as strings, it produced [object Object]. Fix by
using the same revalidation pattern as handleCheckTag for trace mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: shared TagsCell component, CH view alias fix, rebase on dev

- Extract shared TagsCell component with colored dots + count display
- Fix ClickHouse view alias collision (table-qualify column refs)
- Add tagClasses to TracesStore (fetched once, shared across tables)
- Renumber Postgres migration to 0078 after rebase on dev

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address PR feedback

- Remove double decodeURIComponent in trace tag DELETE route
- Replace DEFAULT_TAG_COLOR with tailwind bg-gray-300
- Wrap resolvedTags in useMemo
- Move fetchTagClasses call to TracesTable component (matching fetchStats pattern)
- Remove projectId from TracesProps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: move tag classes out of TracesStore, use SWR in TagsCell

TagsCell now fetches tag classes via SWR (deduped/cached), removing
the coupling to TracesStore and TracesTable. This shares the SWR
cache with TagsContextProvider so tag classes are fetched once
regardless of which component needs them first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: align trace tags column id with filter key and CH view column

Column id was "trace_tags" but filter key and CH view column are both
"tags", causing filter/sort mismatches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: await ClickHouse mutations, remove duplicate snapshot key

- Await clickhouseClient.command() in trace tag POST and DELETE routes
  to match existing span tag patterns and catch connection errors
- Remove duplicate trace_tags key in 0078 migration snapshot JSON

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: unify tags UI into TagsInline component

- New TagsInline component: self-contained fragment with AnimatePresence,
  animated tag badges, and trigger button. Parent controls layout.
- TagsTrigger auto-detects minimal vs regular based on tag count
  (removed isMinimal prop)
- Trace header and span controls both use TagsInline
- Span view: tags moved after Add to labeling queue / Add to dataset

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: restore encodeURIComponent on span tag delete URL

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: delete dead TagsList and TagsTrigger components

Both replaced by TagsInline which consolidates the tag badges,
animation, and trigger button into a single component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: restore migration 33 to original content

The merge from dev brought in changes to an already-applied ClickHouse
migration. Restored to original to avoid confusion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: renumber CH migration 34_trace_tags to 35 to avoid collision with dev

Dev added 34_hide_l0_clusters.sql as migration 34. Our branch also used
number 34 for trace_tags. Renumbered ours to 35, matching the pattern
used for the Postgres migration renumbering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: correct out-of-order migration journal timestamp

Migration 0080_trace_tags had a manually set timestamp (1774700000000)
that was earlier than migration 0079. Updated to 1775146000000 to
maintain chronological order in the journal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: stop swapping tags/trace_tags aliases in ClickHouse view

The view was aliasing traces_replacing.tags (span-level) as span_tags
and traces_replacing.trace_tags (trace-level) as tags, which silently
changed the meaning of the tags column for all consumers.

Now the view keeps the natural naming: tags = span-level (unchanged
from before this feature), trace_tags = trace-level (new column).

Updated all consumers:
- ClickHouse view: tags stays as tags, trace_tags stays as trace_tags
- Frontend TraceRow: spanTags (from tags), traceTags (from trace_tags)
- Frontend columns/filters: updated sql refs and filter keys
- Rust RealtimeTrace: span_tags + trace_tags (no swap in constructor)
- Rust filter matching: direct mapping instead of cross-mapping

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: query validator allows span_tags but view exposes trace_tags

The ClickHouse views expose tags (span-level) and trace_tags
(trace-level). The query validator incorrectly listed span_tags
which doesn't exist in any view. Changed to trace_tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: move trace_tags to separate ClickHouse table with ReplacingMergeTree

Replace expensive ALTER TABLE UPDATE mutations with simple INSERTs into a
dedicated trace_tags table. The views (raw_traces_v0, traces_v0) are
recreated to LEFT JOIN the new table. Backend trace processor writes to
both tables for backwards compat. Frontend tag add/remove routes now
INSERT into trace_tags instead of mutating traces_replacing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: squash trace_tags migrations 35+36 into single migration

Combines the column addition (migration 35) and separate table creation
(migration 36) into one migration. Also reverts migration 33 to match dev.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove trace_tags re-insertion during span ingestion

Span ingestion never modifies trace_tags, but was re-inserting stale
values into ClickHouse with a fresh updated_at timestamp. This raced
with API-driven tag removals: the ReplacingMergeTree would keep the
stale row (with the higher updated_at) over the API's deletion row.

Only the tag API routes should write to the ClickHouse trace_tags
table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: return 404 when trace tag routes target nonexistent trace

POST and DELETE trace tag routes now check if the PostgreSQL UPDATE
matched any rows before writing to ClickHouse. Previously, a request
with a nonexistent traceId would insert an orphan row with empty tags
into the ClickHouse trace_tags table and return 200.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: remove unused CHTraceTag and insert_trace_tags_batch

Dead code after removing the trace_tags re-insertion from span
ingestion. Trace tag writes to ClickHouse are handled by the
Next.js API routes using the JavaScript ClickHouse client.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: trace tag routes read/write exclusively from CH trace_tags table

Removed PG dependency from trace tag API routes. GET, POST, and DELETE
now interface only with the ClickHouse trace_tags table. Fixed
DateTime64(6) timestamp serialization (requires microseconds, not
fractional seconds) which caused silent insert failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: clarify trace_tags comment to distinguish table from column

The comment incorrectly implied nothing was written to ClickHouse,
but CHTrace does write an empty trace_tags to traces_replacing.
Updated to clarify the view reads from the separate trace_tags
table (via LEFT JOIN), not from traces_replacing.trace_tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* revert: restore processor.rs to dev state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: update sessions table tags column to use renamed spanTags property

The TraceRow type was renamed from `tags` to `spanTags`, but the sessions
table column accessor was not updated, causing trace sub-rows to always
show "-" instead of their actual span tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: remove trace_tags from PostgreSQL entirely

trace_tags now lives exclusively in the ClickHouse trace_tags table.
Removes the PG column, Drizzle migration (0080), schema field, and all
Rust references (Trace struct, upsert query, CHTrace, RealtimeTrace).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add trace_tags field to RealtimeTrace struct

The frontend TraceRow type requires both spanTags and traceTags. Without
trace_tags in the SSE payload, realtime updates would set traceTags to
undefined, causing previously displayed trace tags to disappear when the
row is replaced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: rename sessions table tags column to "Span tags" for consistency

In the traces table, "Tags" now refers to trace-level tags and "Span tags"
refers to span-level tags. The sessions table was still using the old
"Tags" label for span-level tags, creating an inconsistency. Updated the
header, column id, filter name, and default column order to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* wip: initial setup

* feat(LAM-1397): add trace-level tags

Extend existing span-level tags to also work at the trace level, allowing
users to tag entire traces for easier retrieval and filtering.

- Add `trace_tags` column to ClickHouse `traces_replacing` table and
  recreate views with renamed columns: physical `tags` → view `span_tags`,
  physical `trace_tags` → view `tags`
- Add `trace_tags` column to PostgreSQL `traces` table with Drizzle migration
- Add trace tags API routes (POST to add, DELETE to remove) that update
  both ClickHouse and PostgreSQL
- Refactor `TagsContextProvider` to support both span and trace modes
  via a `TagsMode` discriminated union
- Update `pick-tag.tsx` and `create-tag.tsx` with mode-dependent API URLs
- Wire up trace header with real tag components replacing WIP placeholder
- Rename traces table "Tags" column to "Span tags", add new "Tags" column
  for trace-level tags, and enable filtering on both
- Add `span_tags` to query engine allowed columns
- Fix realtime SSE filter mapping for `tags` and `span_tags` keys
- Update Rust `Trace`, `CHTrace`, and `RealtimeTrace` structs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: avoid SWR cache type mismatch in trace mode tag uncheck

In trace mode, the SWR cache holds string[] (raw tag names from API),
but handleUncheckTag was writing SpanTag[] objects as optimistic data.
When the normalization in tags-context.tsx subsequently cast these
SpanTag objects as strings, it produced [object Object]. Fix by
using the same revalidation pattern as handleCheckTag for trace mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: shared TagsCell component, CH view alias fix, rebase on dev

- Extract shared TagsCell component with colored dots + count display
- Fix ClickHouse view alias collision (table-qualify column refs)
- Add tagClasses to TracesStore (fetched once, shared across tables)
- Renumber Postgres migration to 0078 after rebase on dev

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address PR feedback

- Remove double decodeURIComponent in trace tag DELETE route
- Replace DEFAULT_TAG_COLOR with tailwind bg-gray-300
- Wrap resolvedTags in useMemo
- Move fetchTagClasses call to TracesTable component (matching fetchStats pattern)
- Remove projectId from TracesProps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: move tag classes out of TracesStore, use SWR in TagsCell

TagsCell now fetches tag classes via SWR (deduped/cached), removing
the coupling to TracesStore and TracesTable. This shares the SWR
cache with TagsContextProvider so tag classes are fetched once
regardless of which component needs them first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: align trace tags column id with filter key and CH view column

Column id was "trace_tags" but filter key and CH view column are both
"tags", causing filter/sort mismatches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: await ClickHouse mutations, remove duplicate snapshot key

- Await clickhouseClient.command() in trace tag POST and DELETE routes
  to match existing span tag patterns and catch connection errors
- Remove duplicate trace_tags key in 0078 migration snapshot JSON

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: unify tags UI into TagsInline component

- New TagsInline component: self-contained fragment with AnimatePresence,
  animated tag badges, and trigger button. Parent controls layout.
- TagsTrigger auto-detects minimal vs regular based on tag count
  (removed isMinimal prop)
- Trace header and span controls both use TagsInline
- Span view: tags moved after Add to labeling queue / Add to dataset

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: restore encodeURIComponent on span tag delete URL

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: delete dead TagsList and TagsTrigger components

Both replaced by TagsInline which consolidates the tag badges,
animation, and trigger button into a single component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: restore migration 33 to original content

The merge from dev brought in changes to an already-applied ClickHouse
migration. Restored to original to avoid confusion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: renumber CH migration 34_trace_tags to 35 to avoid collision with dev

Dev added 34_hide_l0_clusters.sql as migration 34. Our branch also used
number 34 for trace_tags. Renumbered ours to 35, matching the pattern
used for the Postgres migration renumbering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: correct out-of-order migration journal timestamp

Migration 0080_trace_tags had a manually set timestamp (1774700000000)
that was earlier than migration 0079. Updated to 1775146000000 to
maintain chronological order in the journal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: stop swapping tags/trace_tags aliases in ClickHouse view

The view was aliasing traces_replacing.tags (span-level) as span_tags
and traces_replacing.trace_tags (trace-level) as tags, which silently
changed the meaning of the tags column for all consumers.

Now the view keeps the natural naming: tags = span-level (unchanged
from before this feature), trace_tags = trace-level (new column).

Updated all consumers:
- ClickHouse view: tags stays as tags, trace_tags stays as trace_tags
- Frontend TraceRow: spanTags (from tags), traceTags (from trace_tags)
- Frontend columns/filters: updated sql refs and filter keys
- Rust RealtimeTrace: span_tags + trace_tags (no swap in constructor)
- Rust filter matching: direct mapping instead of cross-mapping

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: query validator allows span_tags but view exposes trace_tags

The ClickHouse views expose tags (span-level) and trace_tags
(trace-level). The query validator incorrectly listed span_tags
which doesn't exist in any view. Changed to trace_tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: move trace_tags to separate ClickHouse table with ReplacingMergeTree

Replace expensive ALTER TABLE UPDATE mutations with simple INSERTs into a
dedicated trace_tags table. The views (raw_traces_v0, traces_v0) are
recreated to LEFT JOIN the new table. Backend trace processor writes to
both tables for backwards compat. Frontend tag add/remove routes now
INSERT into trace_tags instead of mutating traces_replacing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: squash trace_tags migrations 35+36 into single migration

Combines the column addition (migration 35) and separate table creation
(migration 36) into one migration. Also reverts migration 33 to match dev.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove trace_tags re-insertion during span ingestion

Span ingestion never modifies trace_tags, but was re-inserting stale
values into ClickHouse with a fresh updated_at timestamp. This raced
with API-driven tag removals: the ReplacingMergeTree would keep the
stale row (with the higher updated_at) over the API's deletion row.

Only the tag API routes should write to the ClickHouse trace_tags
table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: return 404 when trace tag routes target nonexistent trace

POST and DELETE trace tag routes now check if the PostgreSQL UPDATE
matched any rows before writing to ClickHouse. Previously, a request
with a nonexistent traceId would insert an orphan row with empty tags
into the ClickHouse trace_tags table and return 200.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: remove unused CHTraceTag and insert_trace_tags_batch

Dead code after removing the trace_tags re-insertion from span
ingestion. Trace tag writes to ClickHouse are handled by the
Next.js API routes using the JavaScript ClickHouse client.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: trace tag routes read/write exclusively from CH trace_tags table

Removed PG dependency from trace tag API routes. GET, POST, and DELETE
now interface only with the ClickHouse trace_tags table. Fixed
DateTime64(6) timestamp serialization (requires microseconds, not
fractional seconds) which caused silent insert failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: clarify trace_tags comment to distinguish table from column

The comment incorrectly implied nothing was written to ClickHouse,
but CHTrace does write an empty trace_tags to traces_replacing.
Updated to clarify the view reads from the separate trace_tags
table (via LEFT JOIN), not from traces_replacing.trace_tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* revert: restore processor.rs to dev state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: update sessions table tags column to use renamed spanTags property

The TraceRow type was renamed from `tags` to `spanTags`, but the sessions
table column accessor was not updated, causing trace sub-rows to always
show "-" instead of their actual span tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: remove trace_tags from PostgreSQL entirely

trace_tags now lives exclusively in the ClickHouse trace_tags table.
Removes the PG column, Drizzle migration (0080), schema field, and all
Rust references (Trace struct, upsert query, CHTrace, RealtimeTrace).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: refactor tags system to support trace-level tags with new display components

- Add TagsMode discriminated union to tags-context for span/trace mode switching
- Create TagsCell (overlapping circles), TagsInline (animated badges), TagsButton (header button)
- Extract TraceDropdown from header, refactor header to flex-wrap layout with TagsButton
- Replace TagsTrigger+TagsList in span-controls with self-contained TagsInline
- Update traces/spans/sessions table columns to use TagsCell
- Delete old tags-list.tsx and tags-trigger.tsx

Note: pre-commit tsc fails on pre-existing playground/google thinkingLevel errors (not from this PR)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: header nits and pre-existing playground type errors

- Guard metadata span with conditional to avoid phantom 28px gap
- Add mt-2 to search container for proper spacing from header row
- Remove thinkingLevel from Google playground (only thinkingBudget exists in SDK)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove duplicate TagsInline from header, minor style nits

- Remove TagsInline block from header (TagsButton is the single button per spec)
- Shorten "Chat with trace" to "Chat"
- Use pl-2 instead of ml-2 for Trace label (matches reference)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: unify span and trace tags to use TagsButton

- Replace TagsInline with TagsButton in span-controls (same simple button)
- Delete tags-inline.tsx (no longer needed)
- Move tags-button.tsx to components/tags/ (shared by header and span)
- Show Tag icon when no tags are applied

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: sessions column id mismatch and null traceTags from LEFT JOIN

- Change sessions-table tags column id from "tags" to "spanTags" to match accessorKey
- Wrap trace_tags select with ifNull() to handle NULL from LEFT JOIN

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: add gray fallback color for tags without a tag_class

TagsButton circles were invisible when tag_class didn't exist for a tag
name. Now falls back to bg-gray-300, matching TagsCell behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: replace TagsContext with prop drilling, add optimistic updates

- Delete tags-context.tsx, tags-button.tsx, manage-tags.tsx, tags-inline.tsx
- Create SpanTagsButton and TraceTagsButton as stateful wrappers with SWR
- Create TagsDropdown as shared dumb dropdown shell
- Refactor PickTag and CreateTag to accept props (no context, no endpoint knowledge)
- Fix: tags without a tag_class now show in picker with gray dot
- Fix: trace mode now uses optimistic updates (was refetch-only)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: show tag name if only one tag selected

* fix: revert RealtimeTrace field name from span_tags back to tags

Keep the Rust field name as `tags` to stay consistent with the source
data (Trace.tags), and use #[serde(rename = "spanTags")] to produce
the correct JSON key for the frontend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert "fix: revert RealtimeTrace field name from span_tags back to tags"

This reverts commit 7fa70ed.

* feat: trace tags column fetches via SWR, syncs with trace view

TraceTagsCell fetches from the same SWR key as TraceTagsButton,
so adding/removing tags in the trace view instantly updates the
traces table column without a page refresh.

* refactor: tags to span tags mapping in frontend not app-server

* fix: address PR review feedback for trace tags

- Remove trace_tags from RealtimeTrace (always empty, handled by SWR)
- Add DEFAULT now64(6) on trace_tags.updated_at, remove client-side timestamp
- Add try/catch with error message extraction to tag button components
- Clean up header pixel values to Tailwind classes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: sync with dev, remove duplicate migration

- Reset playground files, google provider types, and snapshot to dev
- Remove duplicate 35_trace_tags.sql (trace tags migration is 36)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove unused trace_tags accessor, drop backwards compat migration

- Remove accessorFn/accessorKey from trace_tags column (cell fetches via SWR)
- Remove ALTER TABLE and data migration from 36_trace_tags.sql (no prod data)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: replace console.error with toast in span tag class creation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: kolbeyang <kky2806@rit.edu>
Co-authored-by: kolbeyang@gmail.com <kolbeyang@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix: tags overflow handling — scrollable tooltip, capped circles, button text

- Add max-h + overflow-y-auto to tags tooltip in trace table
- Add overflow-y-auto to tags dropdown popover
- Cap visible tag circles at 5 with a Plus overflow indicator (bg-muted)
- Apply to TagsCell, TraceTagsButton, and SpanTagsButton
- Button text: "Tags" (0), tag name (1), "Tags (N)" (2+)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: reorder header items to Chat, Signals, Tags, Metadata

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: scope tag dropdown scroll to tag list, keep search input pinned

Move overflow-y-auto from DropdownMenuContent to a wrapper around the
tag lists inside PickTag, so the search input stays visible when
scrolling through many tags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add color field to signals data model (migration 0080), color picker in
signal create/edit sheet, colored dots in signal cards and traces table,
signal enrichment on trace list queries, and SWR-based trace signal hook.
Also includes app-server signal processing improvements (hash_system_prompt
rename, main_agent_hash fingerprint, simplified summarization).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kolbeyang kolbeyang force-pushed the refactor/trace-view-header-signals branch from 4ef47db to 870e894 Compare April 9, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants