Skip to content

Commit 0812da1

Browse files
authored
feat(issues): Avoid hiding unread indicator (#92088)
Moves the checkbox down below the unread indicator. Breaks the checkbox displaying on focus but fixes an issue where the checkbox would stay visible after unchecking. Fixes https://linear.app/getsentry/issue/RTC-861/separate-selection-ui-from-unread-indicator after ![image](https://github.com/user-attachments/assets/676c1973-4419-4889-a7f0-5a31342f2919)
1 parent beeee4d commit 0812da1

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

static/app/components/eventOrGroupExtraDetails.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ const GroupExtra = styled('div')`
172172
font-size: ${p => p.theme.fontSizeSmall};
173173
white-space: nowrap;
174174
line-height: 1.2;
175+
min-height: ${space(2)};
175176
176177
& > a {
177178
color: ${p => p.theme.subText};

static/app/components/stream/group.tsx

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ function GroupCheckbox({
9595
const {records: selectedGroupMap} = useLegacyStore(SelectedGroupStore);
9696
const isSelected = selectedGroupMap.get(group.id) ?? false;
9797

98-
const onChange = useCallback(
99-
(evt: React.ChangeEvent<HTMLInputElement>) => {
100-
const mouseEvent = evt.nativeEvent as MouseEvent;
101-
102-
if (mouseEvent.shiftKey) {
98+
const handleToggle = useCallback(
99+
(isShiftClick: boolean) => {
100+
if (isShiftClick) {
103101
SelectedGroupStore.shiftToggleItems(group.id);
104102
} else {
105103
SelectedGroupStore.toggleSelect(group.id);
@@ -108,8 +106,28 @@ function GroupCheckbox({
108106
[group.id]
109107
);
110108

109+
const onChange = useCallback(
110+
(evt: React.ChangeEvent<HTMLInputElement>) => {
111+
const mouseEvent = evt.nativeEvent as MouseEvent;
112+
handleToggle(mouseEvent.shiftKey);
113+
},
114+
[handleToggle]
115+
);
116+
111117
return (
112118
<GroupCheckBoxWrapper>
119+
{!group.hasSeen && (
120+
<Tooltip title={t('Unread')} skipWrapper>
121+
<UnreadIndicator
122+
data-test-id="unread-issue-indicator"
123+
onClick={(e: React.MouseEvent) => {
124+
// Toggle checkbox on unread indicator misclick
125+
e.stopPropagation();
126+
handleToggle(e.shiftKey);
127+
}}
128+
/>
129+
</Tooltip>
130+
)}
113131
<CheckboxLabel>
114132
<CheckboxWithBackground
115133
id={group.id}
@@ -119,11 +137,6 @@ function GroupCheckbox({
119137
onChange={onChange}
120138
/>
121139
</CheckboxLabel>
122-
{group.hasSeen ? null : (
123-
<Tooltip title={t('Unread')} skipWrapper>
124-
<UnreadIndicator data-test-id="unread-issue-indicator" />
125-
</Tooltip>
126-
)}
127140
</GroupCheckBoxWrapper>
128141
);
129142
}
@@ -646,23 +659,26 @@ export default StreamGroup;
646659

647660
const CheckboxLabel = styled('label')`
648661
position: absolute;
649-
top: 0;
662+
top: -1px;
650663
left: 0;
651664
bottom: 0;
652665
height: 100%;
653666
width: 32px;
654667
padding-left: ${space(2)};
655-
padding-top: 14px;
656668
margin: 0;
669+
margin-top: -1px;
670+
display: flex;
671+
align-items: center;
657672
`;
658673

659674
const UnreadIndicator = styled('div')`
660675
width: 8px;
661676
height: 8px;
662677
background-color: ${p => p.theme.purple400};
663678
border-radius: 50%;
664-
margin-left: ${space(3)};
665-
margin-top: 10px;
679+
margin-top: 1px;
680+
margin-left: ${space(2)};
681+
z-index: 1;
666682
`;
667683

668684
// Position for wrapper is relative for overlay actions
@@ -675,19 +691,12 @@ const Wrapper = styled(PanelItem)<{
675691
padding: ${space(1)} 0;
676692
min-height: 82px;
677693
678-
&:not(:has(:hover)):not(:focus-within):not(:has(input:checked)) {
694+
&:not(:hover):not(:has(input:checked)) {
679695
${CheckboxLabel} {
680696
${p => p.theme.visuallyHidden};
681697
}
682698
}
683699
684-
&:hover,
685-
&:focus-within {
686-
${UnreadIndicator} {
687-
${p => p.theme.visuallyHidden};
688-
}
689-
}
690-
691700
[data-issue-title-link] {
692701
&::before {
693702
content: '';
@@ -757,7 +766,10 @@ const GroupCheckBoxWrapper = styled('div')`
757766
align-self: flex-start;
758767
width: 32px;
759768
display: flex;
769+
flex-direction: column;
760770
align-items: center;
771+
justify-content: center;
772+
padding-top: ${space(1)};
761773
z-index: 1;
762774
`;
763775

0 commit comments

Comments
 (0)