Repository navigation
feat(replays): Display component name in selector when available - #68840
Conversation
Bundle ReportChanges will increase total bundle size by 2.67kB ⬆️
|
| }} | ||
| > | ||
| <TextOverflow>{value}</TextOverflow> | ||
| <TextOverflow>{display}</TextOverflow> |
There was a problem hiding this comment.
i'm wondering if it's confusing that this display doesn't match the value above in the code snippet (the one that shows up on hover). i know the full selector is needed for search to work though, and logically the code snippet is supposed to be copy-able for search. but it might be weird that the display & the hover look different. what do you think?
There was a problem hiding this comment.
yea I do think it's weird that display and value don't match, but I'm not sure what a good solution for this is. We want to surface the react component name when possible in place of the classes, but our search and aggregation still includes the classes so I'm not sure what the best solution is
There was a problem hiding this comment.
i'm thinking maybe we should have the hover tooltip match what's displayed in the widget. i think the original intent of the tooltip was show the full selector when it's overflowed, so let's make them match
There was a problem hiding this comment.
ok! we don't need display selector anymore then!!
| fullComponentName; | ||
| const selector = | ||
| tag + id + classes + role + ariaLabel + testId + alt + title + componentName; | ||
| const displaySelector = componentName |
There was a problem hiding this comment.
is there a reason we keep the id here for displaySelector if there's a component name? (might've missed something while i was out)
There was a problem hiding this comment.
the id can still provide some useful context! We want to replace the tag and classes tho since we don't think those are as useful
michellewzhang
left a comment
There was a problem hiding this comment.
looks good! thanks for making all the changes!
Adds a display selector so the selector is more readable if there's a component name.

Related to #64673