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(dashboards): Tooltip for all teams with access in access selector #83681

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

nikkikapadia
Copy link
Member

There was a request to have a tooltip displaying all teams that have access to a dashboard in this slack thread. Now hovering over the +(a number) bubble in the avatar list will give a tooltip of all the teams (some of them are scrollable due to the large amount of teams).

Here's what it looks like:
image

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 17, 2025
@nikkikapadia nikkikapadia marked this pull request as ready for review January 17, 2025 21:44
@nikkikapadia nikkikapadia requested a review from a team as a code owner January 17, 2025 21:44
Comment on lines 116 to 129
<Tooltip
title={collapsedAvatarTooltip ?? `${numCollapsedAvatars} other ${typeAvatars}`}
skipWrapper={!collapsedAvatarTooltip}
isHoverable={!!collapsedAvatarTooltip}
overlayStyle={collapsedAvatarTooltipStyle}
>
<CollapsedAvatars
size={avatarSize}
data-test-id="avatarList-collapsedavatars"
collapsedAvatarActions={collapsedAvatarActions}
>
{numCollapsedAvatars < 99 && <Plus>+</Plus>}
{numCollapsedAvatars}
</CollapsedAvatars>
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little hesitant to add these kinds of changes because they're very specific to our use case right now with how we're assigning collapsedAvatarActions. Do you think it's possible to add a function that renders a different output for the collapsed avatars and in our code have the specific implementation we need with the hovering?

e.g. a custom renderer called renderCollapsedAvatars which would be used something like:

{
    renderCollapsedAvatars?.(... whatever props would be necessary for collapsed avatars) ??
    <the default stuff here>
}

Just trying to keep the interface generic but a bit easier to understand 🤔 let me know what you think

Copy link
Member Author

Choose a reason for hiding this comment

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

yup agreed! good point. I just pushed the changes for that :)

Copy link

codecov bot commented Jan 20, 2025

Bundle Report

Changes will increase total bundle size by 237.4kB (0.76%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
app-webpack-bundle-array-push 31.53MB 237.4kB (0.76%) ⬆️

Copy link
Member

@narsaynorath narsaynorath left a comment

Choose a reason for hiding this comment

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

Just a few comments that need to be addressed, but after that it looks good to me!

Comment on lines 53 to 54
onMouseEnter={() => collapsedAvatarActions?.onMouseEnter?.()}
onMouseLeave={() => collapsedAvatarActions?.onMouseLeave?.()}
Copy link
Member

Choose a reason for hiding this comment

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

We can drop a bunch of these changes now, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

we can't drop this because i use them to detect tooltip conflicts, however i'm open to other suggestions 👀


const CollapsedAvatarTooltip = styled('div')`
max-height: 200px;
overflow-y: scroll;
Copy link
Member

Choose a reason for hiding this comment

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

I think we want something like overflow-y: auto because if you use scroll, the scroll bar is always visible even if there isn't any scrolling to do, e.g.
Screenshot 2025-01-20 at 11 02 29 AM

@nikkikapadia nikkikapadia enabled auto-merge (squash) January 20, 2025 16:43
@nikkikapadia nikkikapadia merged commit d32f220 into master Jan 20, 2025
41 checks passed
@nikkikapadia nikkikapadia deleted the nikki/fix/edit-access-show-all-teams branch January 20, 2025 16:53
andrewshie-sentry pushed a commit that referenced this pull request Jan 22, 2025
…#83681)

There was a request to have a tooltip displaying all teams that have
access to a dashboard in [this slack
thread](https://sentry.slack.com/archives/C072KUA8R1U/p1736457766301069).
Now hovering over the +(a number) bubble in the avatar list will give a
tooltip of all the teams (some of them are scrollable due to the large
amount of teams).

Here's what it looks like:
<img width="778" alt="image"
src="https://github.com/user-attachments/assets/40086f9c-9562-40a6-ab11-a1195ebf6471"
/>
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2025
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.

2 participants