Skip to content

chore(explore): Remove TraceItemAttributeContext provider pattern#108552

Draft
nsdeschenes wants to merge 10 commits intomasterfrom
nd/EXP-727/chore-remove-trace-item-attribute-context
Draft

chore(explore): Remove TraceItemAttributeContext provider pattern#108552
nsdeschenes wants to merge 10 commits intomasterfrom
nd/EXP-727/chore-remove-trace-item-attribute-context

Conversation

@nsdeschenes
Copy link
Contributor

@nsdeschenes nsdeschenes commented Feb 19, 2026

Summary

Migrates all consumers of TraceItemAttributeProvider context to pass config directly to useTraceItemAttributes / useTraceItemTags, then removes the deprecated provider infrastructure entirely.

This is the follow-up to #108019 (EXP-726) which added config-based overloads. This PR (EXP-727) completes the migration.

Highly recommend review with whitespace hidden.

Ticket: EXP-727

@linear
Copy link

linear bot commented Feb 19, 2026

@nsdeschenes
Copy link
Contributor Author

@sentry review

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 19, 2026
@nsdeschenes
Copy link
Contributor Author

@cursor review

nsdeschenes and others added 9 commits February 19, 2026 15:44
…eItemAttributes

Rename deprecated useTraceItemAttributesWithConfig calls to
useTraceItemAttributes in all consumers and remove the deprecated export.
These callers already pass config objects directly.
… directly

Migrate callers that relied on TraceItemAttributeProvider context to pass
TraceItemAttributeConfig directly. Move search state into toolbar components.
Remove provider wrappers that only existed to serve these callers.
…plore callers

Update spanTagsContext's useTraceItemTags to accept a TraceItemAttributeConfig
as the first argument. Migrate all explore callers to pass config directly
instead of relying on the context provider.

Key changes:
- spanTagsContext.tsx: require config param, pass through to useTraceItemAttributes
- useSortByFields.tsx: accept config param, callers pass it
- toolbar components (visualize, groupBy): move search state into component,
  remove TraceItemAttributeProvider wrapper
- spansTabSearchSection.tsx: pass config to all useTraceItemTags calls,
  remove provider wrapper for cross-event search bars
- tables, multiquery, and other explore callers: pass spansConfig
Create useWidgetBuilderTraceItemConfig helper hook that extracts the
dataset → TraceItemAttributeConfig mapping logic from
TraceItemAttributeProviderFromDataset. Migrate all widget builder
consumers (visualize, groupBySelector, sortBySelector, xAxisSelector,
exploreArithmeticBuilder) to use the new hook and pass config to
useTraceItemTags.
…ecated code

All consumers have been migrated to pass config directly. This commit:
- Removes TraceItemAttributeProvider, TraceItemAttributeContext, and
  overload resolution helpers from traceItemAttributeContext.tsx
- Simplifies useTraceItemAttributes to only accept (config, type?, hiddenKeys?)
- Removes provider wrappers from spans/content.tsx, logs/content.tsx,
  multiQueryMode/content.tsx, newWidgetBuilder.tsx
- Deletes InsightsSpanTagProvider and removes it from 6 insights consumers
- Removes provider wrappers from 8 additional insights pages and
  metricsSection.tsx
…ppers

Remove TraceItemAttributeProvider from test wrappers across all spec
files. Tests already mock the /trace-items/attributes/ API endpoint,
so the components' internal useTraceItemAttributes calls with config
will hit those mocks directly.

Also update useTraceItemTags mock signatures to match the new
(config, type?, hiddenKeys?) signature.
- Add back TraceItemDataset import to logsTab.tsx (needed for config)
- Add config param to useSortByFields.spec.tsx test calls
Pass the selected alert project into EAPField and include it in trace item
attribute config so aggregate options stay scoped to the alert project.
Also remove the now-unnecessary EAPField wrapper export.

Co-authored-by: Cursor <cursoragent@cursor.com>
Clean up unnecessary React Fragment wrappers in metric rule conditions and
multi-query mode tests to simplify render trees without behavior changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nsdeschenes nsdeschenes force-pushed the nd/EXP-727/chore-remove-trace-item-attribute-context branch from 5a7161c to cb432a9 Compare February 19, 2026 19:52
@nsdeschenes
Copy link
Contributor Author

@sentry review

@nsdeschenes
Copy link
Contributor Author

@cursor review

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments