Skip to content

Apply React Component Names to Replay Surface Areas #64673

Closed

Description

@jas-kas

Apply React Component Names to....

  • Selector Widgets and Selector Index Page
  • Replay Details - Breadcrumbs
  • Rage Click Issues

FYI

  • Documentation on how to set this up via bundler plugin is here
  • It is GA'ed
  • Replay search works already - reference

Rage click issues example, with only selector
image

Activity

  1. changed the title [-]Apply React Component Names to Selector Widgets and Selector Index Page When Set Up[/-] [+][Replay Index] Apply React Component Names to Selector Widgets and Selector Index Page When Set Up[/+] on Feb 6, 2024
  2. getsantry commented on Feb 6, 2024

    @getsantry
    Contributor

    Routing to @getsentry/product-owners-replays for triage ⏲️

  3. jas-kas commented on Feb 6, 2024

    @jas-kas
    ContributorAuthor
  4. bruno-garcia commented on Feb 6, 2024

    @bruno-garcia
    Member

    Click and other DOM-related crumbs could also show the React Component name instead of the raw HTML blocks:

    image

  5. changed the title [-][Replay Index] Apply React Component Names to Selector Widgets and Selector Index Page When Set Up[/-] [+][Replay Index] Apply React Component Names to Selector Widgets and Selector Index Page && [Replay Details] Breadcrumbs When Set Up [/+] on Feb 6, 2024
  6. bruno-garcia commented on Feb 6, 2024

    @bruno-garcia
    Member

    @Jesse-Box we talked to @0Calories who is going to help Replay leverage the React Component names feature he added.

    We need some help with designs, on where to put the component names in the UI when available.
    He's take was:

    I can make some preliminary UI changes, but I think for showing the component name in a Replay breadcrumb, I need design specs. I don’t think we should outright replace the whole HTML block with the component name, since a lot of valuable data is available in the HTML itself. We should show the component name as supplementary data

  7. jas-kas commented on Feb 20, 2024

    @jas-kas
    ContributorAuthor

    Design Update for Breadcrumbs: #65093 (comment)

  8. changed the title [-][Replay Index] Apply React Component Names to Selector Widgets and Selector Index Page && [Replay Details] Breadcrumbs When Set Up [/-] [+][Replay Index] Apply React Component Names to Replay Surface Areas[/+] on Mar 4, 2024
  9. changed the title [-][Replay Index] Apply React Component Names to Replay Surface Areas[/-] [+]Apply React Component Names to Replay Surface Areas[/+] on Mar 13, 2024
  10. michellewzhang commented on Mar 13, 2024

    @michellewzhang
    Contributor

    Did a bit of research into what needs to be done for each of the 3 surfaces:

    Effort / changes required

    1. Replay Breadcrumbs:

    • We have designs already for this
    • GOAL: replace the full selector string on relevant breadcrumbs to be the React component name "tree"
    • GOAL: click on component name searches by this component --> filters index page search by this component
    • Good sources of more information on this topic: @ryan953 & @cmanallen
    • Overall estimation of effort: medium

    Steps:

    • The selector is currently rendered here:
      <Description title={description} showOnlyOnOverflow isHoverable>
    • The selector info currently comes directly from the raw breadcrumb frame. Luckily, the raw breadcrumb frames also contain the data-sentry-component which is exactly what we need to show the component name! There are a couple frontend files to edit here, as well as potential type changes to surface the component name, but we already have this data already so it shouldn't be too difficult.
    • The data we have:
    SCR-20240313-kcks
    • Relevant file:
      export default function hydrateBreadcrumbs(
    • One thing to note is that the data-sentry-component attribute appears ONLY if it exists. So if it's a click on something without a component name, this attribute won't show up
    • The more complicated next step is figuring out how to show the entire component "tree". We'll need to trace the selector all the way back up to the root, remembering that not every element has a component name. We should get the most useful thing to display (whether it's the component name, or the id, class, etc.)

    From Figma:
    SCR-20240313-knfh

    • Another question we'll need to consider is how far down we want to show the tree -- e.g. do we want to show things that are further down the tree as well? If so --> small SDK change needed to propagate component down
      • In this case, would also need to disambiguate which one is our current component
    • Implementing search should not be difficult since we already have the search capabilities

    2. Rage Click Issues

    • Design input needed
    • GOAL: add the React component name to the issue details
    • Good source of more information on this topic: @JoshFerge
    • Overall estimation of effort: low

    Steps:

    3. Selector Widgets and Selector Index Page

    • Design input needed
    • GOAL: replace all instances of the selectors with React component names instead
    • GOAL: when the component name is clicked in the widget/table, update the search to search for the component instead of selector
    • Good source of more information on this topic: @cmanallen & @michellewzhang
    • Overall estimation of effort: medium

    Steps

    • Update the selector endpoint to return an additional data point -- the component name if it exists
    • Something like
    {
      "data": [
        {
          "count_dead_clicks": 2,
          "count_rage_clicks": 1,
          "dom_element": "div#myid.class1.class2",
          "element": {
            "alt": "",
            "aria_label": "",
            "class": ["class1", "class2"],
            "id": "myid",
            "role": "",
            "tag": "div",
            "testid": "",
            "title": ""
          },
          "project_id": "1",
          "component_name": "blahblah",
        }
      ]
    }
    
    • "We'd just have to group by the component name and add it to the select statement in the query" -- Colton (seems like not a huge effort)
    • From there, can directly translate selector name to component name in the frontend. Probably need to change a good amount of files, but nothing too difficult

    Overall considerations

    • Everywhere we're making these changes, we should update wording to say "components" instead of "selector" (e.g. docs, in Sentry, etc.)
    • We should also consider what to show when there’s no component name available! [design input]

    Proposed Timeline

    1. [0.5 weeks] Get design input for Rage Click Issues & Selector Widgets, as well as what to render when no component name is available - @Jesse-Box
    2. [0.5 weeks] Sync w/ appropriate team members on necessary prep work that needs to be done (ex. endpoint changes)
    3. [1.5 weeks + 0.5 week + 1.5 weeks = 3.5 weeks] The changes needed for the 3 surfaces appear to be pretty unrelated, so they could be done in parallel or in any order
    4. [0.5 weeks] Consider whether we need to update docs, strings/other wording throughout Sentry to say "component" instead of "selector"
  11. 1 remaining item

  12. self-assigned this
    on Mar 26, 2024
  13. c298lee commented on Apr 18, 2024

    @c298lee
    Contributor

    All three areas and the docs have been updated with component names!

  14. locked and limited conversation to collaborators on May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions