Skip to content

Commit 80117eb

Browse files
minor design tweaks to the search page filters UI. (#1490)
Suggestions courtesy of @elizabetdev - ellipsis on filter names - make clear button an icon - add tooltip to icons Before: <img width="216" height="190" alt="Screenshot 2025-12-15 at 4 32 57 PM" src="https://github.com/user-attachments/assets/e9e911b1-c6a3-4d10-be64-f08d107cdea3" /> After: <img width="295" height="173" alt="Screenshot 2025-12-15 at 4 30 40 PM" src="https://github.com/user-attachments/assets/a4766210-0f58-4aa1-bff0-09923a80beb4" /> Fixes HDX-2366
1 parent 28dd5ce commit 80117eb

File tree

2 files changed

+80
-41
lines changed

2 files changed

+80
-41
lines changed

.changeset/kind-flies-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
Minor UI Improvements in Search Filters UI

packages/app/src/components/DBSearchPageFilters.tsx

Lines changed: 75 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
IconChevronDown,
3636
IconChevronRight,
3737
IconChevronUp,
38+
IconFilterOff,
3839
IconPin,
3940
IconPinFilled,
4041
IconRefresh,
@@ -199,7 +200,7 @@ export const FilterCheckbox = ({
199200
gap="xs"
200201
wrap="nowrap"
201202
justify="space-between"
202-
pe={'11px'}
203+
pe={'4px'}
203204
miw={0}
204205
>
205206
<Text
@@ -239,16 +240,23 @@ export const FilterCheckbox = ({
239240
data-testid={`filter-exclude-${label}`}
240241
/>
241242
)}
242-
<TextButton
243+
<ActionIcon
243244
onClick={onClickPin}
244-
label={pinned ? <IconPinFilled size={14} /> : <IconPin size={14} />}
245+
size="xs"
246+
variant="subtle"
247+
color="gray"
248+
aria-label={pinned ? 'Unpin field' : 'Pin field'}
249+
role="checkbox"
250+
aria-checked={pinned}
245251
data-testid={`filter-pin-${label}`}
246-
/>
252+
>
253+
{pinned ? <IconPinFilled size={12} /> : <IconPin size={12} />}
254+
</ActionIcon>
247255
</div>
248256
{pinned && (
249-
<Text size="xxs">
257+
<Center me="1px">
250258
<IconPinFilled size={12} />
251-
</Text>
259+
</Center>
252260
)}
253261
</div>
254262
);
@@ -578,6 +586,7 @@ export const FilterGroup = ({
578586
p="0"
579587
pr="xxxs"
580588
data-testid="filter-group-control"
589+
style={{ overflow: 'hidden' }}
581590
classNames={{
582591
chevron: 'm-0',
583592
label: 'p-0',
@@ -592,62 +601,87 @@ export const FilterGroup = ({
592601
fz="xxs"
593602
color="gray"
594603
>
595-
<Text size="xs" fw="500">
604+
<Text size="xs" fw="500" truncate="end">
596605
{name}
597606
</Text>
598607
</Tooltip>
599608
</Accordion.Control>
600-
<Group gap="xxxs" wrap="nowrap">
609+
<Group gap={0} wrap="nowrap">
601610
{!hasRange && (
602611
<>
603-
<ActionIcon
604-
size="xs"
605-
variant="subtle"
606-
color="gray"
607-
onClick={toggleShowDistributions}
608-
title={
612+
<Tooltip
613+
label={
609614
showDistributions
610-
? 'Hide distribution'
611-
: 'Show distribution'
615+
? 'Hide Distribution'
616+
: 'Show Distribution'
612617
}
613-
data-testid={`toggle-distribution-button-${name}`}
614-
aria-checked={showDistributions}
615-
role="checkbox"
618+
position="top"
619+
withArrow
620+
fz="xxs"
621+
color="gray"
616622
>
617-
{isFetchingDistribution ? (
618-
<span className="spinner-border spinner-border-sm" />
619-
) : showDistributions ? (
620-
<IconChartBar size={14} />
621-
) : (
622-
<IconChartBarOff size={14} />
623-
)}
624-
</ActionIcon>
625-
{onFieldPinClick && (
626623
<ActionIcon
627624
size="xs"
628625
variant="subtle"
629626
color="gray"
630-
onClick={onFieldPinClick}
631-
title={isFieldPinned ? 'Unpin field' : 'Pin field'}
632-
me={'4px'}
627+
onClick={toggleShowDistributions}
628+
data-testid={`toggle-distribution-button-${name}`}
629+
aria-checked={showDistributions}
630+
role="checkbox"
633631
>
634-
{isFieldPinned ? (
635-
<IconPinFilled size={14} />
632+
{isFetchingDistribution ? (
633+
<span className="spinner-border spinner-border-sm" />
634+
) : showDistributions ? (
635+
<IconChartBarOff size={14} />
636636
) : (
637-
<IconPin size={14} />
637+
<IconChartBar size={14} />
638638
)}
639639
</ActionIcon>
640+
</Tooltip>
641+
{onFieldPinClick && (
642+
<Tooltip
643+
label={isFieldPinned ? 'Unpin Field' : 'Pin Field'}
644+
position="top"
645+
withArrow
646+
fz="xxs"
647+
color="gray"
648+
>
649+
<ActionIcon
650+
size="xs"
651+
variant="subtle"
652+
color="gray"
653+
onClick={onFieldPinClick}
654+
>
655+
{isFieldPinned ? (
656+
<IconPinFilled size={14} />
657+
) : (
658+
<IconPin size={14} />
659+
)}
660+
</ActionIcon>
661+
</Tooltip>
640662
)}
641663
</>
642664
)}
643665
{totalAppliedFiltersSize > 0 && (
644-
<TextButton
645-
label="Clear"
646-
onClick={() => {
647-
onClearClick();
648-
setSearch('');
649-
}}
650-
/>
666+
<Tooltip
667+
label="Clear Filters"
668+
position="top"
669+
withArrow
670+
fz="xxs"
671+
color="gray"
672+
>
673+
<ActionIcon
674+
size="xs"
675+
variant="subtle"
676+
color="gray"
677+
onClick={() => {
678+
onClearClick();
679+
setSearch('');
680+
}}
681+
>
682+
<IconFilterOff size={14} />
683+
</ActionIcon>
684+
</Tooltip>
651685
)}
652686
</Group>
653687
</Center>

0 commit comments

Comments
 (0)