Skip to content

ref(traces): Remove hiddenAttributes prop from AttributeTree #94817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 3, 2025

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Jul 2, 2025

Small refactor to simplify some upcoming changes. AttributeTree accepts an attributes prop, and a hiddenAttributes prop. Any attribute whose name is included in hiddenAttributes is visually filtered out. This seems strange:

  1. It's strange that the tree component has to iterate all the attributes and then decide which ones to hide one-by-one. It's much more efficient to just omit those attributes from the component, so it only iterates attributes that actually show up
  2. The hidden attributes are redundant. The AttributeTree in the trace view, for example, both passes HIDDEN_ATTRIBUTES and manually omits those fields from attributes, I'm not sure why
  3. The logic that hides attributes is very deep inside AttributeTree, so it's not clear from looking at the component why some things are missing
  4. In the near future, we'll need to omit attributes by some dynamic property (e.g., omit anything that starts with "__sentry" but not for Staff users), which cannot be expressed via hiddenAttributes

It seems easier and more consistent to remove the hiddenAttributes prop, and ensure that the parent component only passes whichever attributes should be omitted.

Am I missing something?

Changes

  • Add test case for hidden attributes
  • Stop passing hiddenAttributes
  • Remove unused hidden attributes prop

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 2, 2025
@gggritso
Copy link
Member Author

gggritso commented Jul 2, 2025

@k-fish @Abdkhan14 what do you think of this one?

@gggritso gggritso marked this pull request as ready for review July 2, 2025 20:28
@gggritso gggritso requested review from a team as code owners July 2, 2025 20:28
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@Abdkhan14 Abdkhan14 left a comment

Choose a reason for hiding this comment

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

On board 🚢

Copy link
Member

@k-fish k-fish left a comment

Choose a reason for hiding this comment

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

Aside from mentioned doc updates offline, looks good to me.

@gggritso gggritso merged commit c04feb3 into master Jul 3, 2025
46 checks passed
@gggritso gggritso deleted the ref/traces/lift-up-hidden-attributes branch July 3, 2025 17:33
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.

3 participants