Skip to content
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

fix(replays): Memory Chart Tooltip Overflow #38746

Merged
merged 12 commits into from Sep 15, 2022
Merged

fix(replays): Memory Chart Tooltip Overflow #38746

merged 12 commits into from Sep 15, 2022

Conversation

danecando
Copy link
Contributor

@danecando danecando commented Sep 13, 2022

Changes

  • Configures the tooltip to be portalled out of the container
  • Injects global styles that target the portalled tooltip
  • tooltip accepts a new chartId prop to allow the tooltips to calculate position within a chart when portalled with appendToBody

Notes

Portalling the tooltips broke the styles since they were scoped to the chart container. I needed to duplicate and inject those styles in the scope of the portalled tooltip. I'm not an emotion expert so if you know a better way to accomplish that let me know

Closes #37238

Screen Shot 2022-09-13 at 12 21 52 PM

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@danecando danecando requested a review from a team as a code owner September 13, 2022 16:11
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 13, 2022
@danecando danecando requested a review from a team as a code owner September 13, 2022 17:00
@ryan953 ryan953 added the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Sep 13, 2022
trigger: 'axis',
renderMode: 'html',
Copy link
Member

Choose a reason for hiding this comment

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

what does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the type def for the tooltips says the renderMode should be html if using appendToBody

    /**
     * 'auto': use html by default, and use non-html if `document` is not defined
     * 'html': use html for tooltip
     * 'richText': use canvas, svg, and etc. for tooltip
     */
    renderMode?: 'auto' | TooltipRenderMode;
    /**
     * If append popup dom to document.body
     * Only available when renderMode is html
     */
    appendToBody?: boolean;
    /**
     * specified class name of tooltip dom
     * Only available when renderMode is html
     */
    className?: string;
    ```

static/app/components/charts/baseChart.tsx Outdated Show resolved Hide resolved
@ryan953
Copy link
Member

ryan953 commented Sep 13, 2022

I was poking at this for about 2mins and thought it was going to be annoying. I'm happy this is such a tidy looking solution!

@ryan953 ryan953 requested a review from a team September 13, 2022 18:16
@github-actions github-actions bot removed the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Sep 13, 2022
@ryan953
Copy link
Member

ryan953 commented Sep 13, 2022

the tooltip does go off the edge of the page now:
Screen Shot 2022-09-13 at 12 46 43 PM

before there were some checks that kept it within the window bounds and moved the nub to accomodate:

Screen Shot 2022-09-13 at 12 47 39 PM

@ryan953 ryan953 added the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Sep 13, 2022
@github-actions github-actions bot removed the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Sep 13, 2022
@ryan953 ryan953 added the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Sep 13, 2022
@github-actions github-actions bot removed the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Sep 14, 2022
@danecando
Copy link
Contributor Author

Added a new option chartId to the tooltip so that it can get a reference to the chart node when using appendToBody for calculating relative tooltip positions.
Screen Shot 2022-09-14 at 2 46 08 PM

@ryan953 ryan953 added the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Sep 15, 2022
@ryan953
Copy link
Member

ryan953 commented Sep 15, 2022

@danecando update the description to match the code please

@ryan953 ryan953 enabled auto-merge (squash) September 15, 2022 16:20
@ryan953 ryan953 merged commit 81573cd into getsentry:master Sep 15, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2022
@chadwhitacre chadwhitacre removed the Trigger: getsentry tests once code is reviewed: apply label to PR to trigger getsentry tests label Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Tab tooltip gets hidden at the boundaries of the scrollable area
3 participants