Skip to content

Commit 54aa7ce

Browse files
authored
ref(issues): Tags & Flags flyout underline only when a link is wrapping (#87204)
small refactor of some stuff related to linkable distribution cards inside the Tags & Flags flyout. Fixed the :focus outline for cards... the whole card is clickable but it wasn't visually obvious before. Also switched the key to use the flag name instead of index. With searching the index of an item can change, and react needs to re-render things properly. Finally, I tied the underlining of the `h5` to the link itself. As of right not the Flags view doens't have a link, but the flag-name was incorrectly being underlined. No longer. **Before** ![tags+flags flyout focus - before](https://github.com/user-attachments/assets/80e79b20-9f05-4e69-911b-cf9390553fb0) **After** ![tags+flags flyout focus - after](https://github.com/user-attachments/assets/6dd7f873-af5c-401c-bcf7-3d4bf51c0eb6)
1 parent e63b542 commit 54aa7ce

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

static/app/views/issueDetails/groupTags/groupTagsDrawer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ export function GroupTagsDrawer({
278278
) : (
279279
<Wrapper>
280280
<Container>
281-
{displayTags.map((tag, tagIdx) => (
282-
<div key={tagIdx}>
281+
{displayTags.map(tag => (
282+
<div key={tag.name}>
283283
<TagDetailsLink tag={tag} groupId={group.id}>
284284
<TagDistribution tag={tag} />
285285
</TagDetailsLink>

static/app/views/issueDetails/groupTags/tagDetailsLink.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {useEffect, useRef, useState} from 'react';
2+
import styled from '@emotion/styled';
23

34
import Link from 'sentry/components/links/link';
45
import {useLocation} from 'sentry/utils/useLocation';
@@ -44,7 +45,7 @@ export default function TagDetailsLink({
4445
}, []);
4546

4647
return (
47-
<Link
48+
<StyledLink
4849
to={{
4950
pathname: `${location.pathname}${tag.key}/`,
5051
query: location.query,
@@ -53,6 +54,15 @@ export default function TagDetailsLink({
5354
onMouseLeave={handleMouseLeave}
5455
>
5556
{children}
56-
</Link>
57+
</StyledLink>
5758
);
5859
}
60+
61+
const StyledLink = styled(Link)`
62+
border-radius: ${p => p.theme.borderRadius};
63+
display: block;
64+
65+
&:hover h5 {
66+
text-decoration: underline;
67+
}
68+
`;

static/app/views/issueDetails/groupTags/tagDistribution.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ const TagPanel = styled('div')`
101101
border-radius: ${p => p.theme.borderRadius};
102102
border: 1px solid ${p => p.theme.border};
103103
padding: ${space(1)};
104-
105-
&:hover > h5 {
106-
text-decoration: underline;
107-
}
108104
`;
109105

110106
const TagHeader = styled('h5')`

0 commit comments

Comments
 (0)