Skip to content

Commit e78960f

Browse files
authored
style: Fix style inconsistencies (#1536)
# Summary This PR fixes various minor style issues and inconsistencies throughout the app. ## Changes | Consistent ... Button Size in DBEditTimeChart | | | ----------- | ------ | | Before | <img width="708" height="74" alt="Screenshot 2025-12-30 at 8 23 01 AM" src="https://github.com/user-attachments/assets/6d6a967d-d5d6-474c-8ff8-4983b0560c5a" /> | | After | <img width="708" height="88" alt="Screenshot 2025-12-30 at 8 19 09 AM" src="https://github.com/user-attachments/assets/78cc0ca6-ab2e-4ac3-8c9e-5cd7bbd1bb58" /> | | Add gap between DBEditTimeChart buttons | | | ----------- | ------ | | Before | <img width="415" height="63" alt="Screenshot 2025-12-30 at 8 25 54 AM" src="https://github.com/user-attachments/assets/10ee3481-5753-438d-8685-dc7174afc00c" /> | | After | <img width="443" height="58" alt="Screenshot 2025-12-30 at 8 25 23 AM" src="https://github.com/user-attachments/assets/6fe6321f-1dc6-4655-9945-495864847881" />| | Replace spinner-border with working loading indicators | | | ----------- | ------ | | Before (loading indicators missing) | <img width="455" height="324" alt="Screenshot 2025-12-30 at 8 32 34 AM" src="https://github.com/user-attachments/assets/9556cd76-dc2c-40cb-8115-2f0ac21ce120" /> | | After | <img width="448" height="242" alt="Screenshot 2025-12-30 at 8 32 46 AM" src="https://github.com/user-attachments/assets/e496abe8-81b6-4d9c-b2f5-c6b4346c3966" /> <img width="236" height="51" alt="Screenshot 2025-12-30 at 8 43 25 AM" src="https://github.com/user-attachments/assets/cbaccd4a-53df-4cd4-a9a6-80a77cdd4e98" /> <img width="206" height="68" alt="Screenshot 2025-12-30 at 8 43 30 AM" src="https://github.com/user-attachments/assets/9db4bb86-52e8-4dc5-ac08-a2efb941a5e5" /> | | Make histogram display switch consistent with other charts | | | ----------- | ------ | | Before | <img width="755" height="474" alt="Screenshot 2025-12-30 at 8 54 57 AM" src="https://github.com/user-attachments/assets/ccb739b3-45c4-4310-8599-79596c05ae6f" /> | | After | <img width="377" height="224" alt="Screenshot 2025-12-30 at 8 54 24 AM" src="https://github.com/user-attachments/assets/b767801c-d8cd-4dbf-86db-ba5d97cde7ba" /> | | Make dashboard toolbar gaps consistent | | | ----------- | ------ | | Before | <img width="889" height="63" alt="Screenshot 2025-12-30 at 9 00 22 AM" src="https://github.com/user-attachments/assets/2c210a00-18cf-41d3-8ded-61d061e1be93" /> | | After | <img width="884" height="56" alt="Screenshot 2025-12-30 at 8 59 16 AM" src="https://github.com/user-attachments/assets/0d90238e-74b9-4692-8a8e-ac8bbdd3d8d9" /> | | Make DBEditTimeChart play button margin consistent | | | ----------- | ------ | | Before | <img width="670" height="146" alt="Screenshot 2025-12-30 at 9 04 44 AM" src="https://github.com/user-attachments/assets/4705083b-8308-41d0-987d-9d2fa6eefc80" /> | | After | <img width="671" height="173" alt="Screenshot 2025-12-30 at 9 03 31 AM" src="https://github.com/user-attachments/assets/10da8177-480f-4bb5-b54d-1f4e69e89a47" /> |
1 parent 4889205 commit e78960f

File tree

7 files changed

+50
-63
lines changed

7 files changed

+50
-63
lines changed

.changeset/silver-dragons-drive.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+
style: Fix style inconsistencies

packages/app/src/DBDashboardPage.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,6 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
10951095
>
10961096
<Button
10971097
onClick={() => setIsLive(prev => !prev)}
1098-
mr={6}
10991098
size="sm"
11001099
variant={isLive ? 'filled' : 'default'}
11011100
title={isLive ? 'Disable auto-refresh' : 'Enable auto-refresh'}
@@ -1108,7 +1107,6 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
11081107
onClick={refresh}
11091108
loading={manualRefreshCooloff}
11101109
disabled={manualRefreshCooloff}
1111-
mr={6}
11121110
variant="default"
11131111
title="Refresh dashboard"
11141112
px="xs"
@@ -1121,7 +1119,6 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
11211119
<Button
11221120
variant="default"
11231121
px="xs"
1124-
mr={6}
11251122
onClick={() => setShowFiltersModal(true)}
11261123
>
11271124
<IconFilterEdit strokeWidth={1} />

packages/app/src/DOMPlayer.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import cx from 'classnames';
33
import throttle from 'lodash/throttle';
44
import { useHotkeys } from 'react-hotkeys-hook';
55
import { Replayer } from 'rrweb';
6-
import { ActionIcon, CopyButton, HoverCard } from '@mantine/core';
6+
import { ActionIcon, CopyButton, Group, HoverCard } from '@mantine/core';
77
import {
88
IconArrowsMaximize,
99
IconCheck,
1010
IconCopy,
1111
IconGlobe,
1212
IconLink,
1313
IconList,
14+
IconRefresh,
1415
} from '@tabler/icons-react';
1516

1617
import { useRRWebEventStream } from '@/sessions';
@@ -507,12 +508,10 @@ export default function DOMPlayer({
507508

508509
<div className={styles.playerContainer}>
509510
{isLoading || isBuffering ? (
510-
<div className="text-center">
511-
<div className="spinner-border" role="status" />
512-
<div className="mt-2">
513-
{isBuffering ? 'Buffering to time...' : 'Loading replay...'}
514-
</div>
515-
</div>
511+
<Group align="center" justify="center" gap="xs">
512+
<IconRefresh className="spin-animate" size={14} />
513+
{isBuffering ? 'Buffering to time...' : 'Loading replay...'}
514+
</Group>
516515
) : isReplayFullyLoaded && replayer.current == null ? (
517516
<div className="text-center">
518517
No replay available for this session, most likely due to this

packages/app/src/ServicesDashboardPage.tsx

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useCallback, useEffect, useMemo, useState } from 'react';
22
import dynamic from 'next/dynamic';
3+
import cx from 'classnames';
34
import { pick } from 'lodash';
45
import {
56
parseAsString,
@@ -21,6 +22,7 @@ import {
2122
TSource,
2223
} from '@hyperdx/common-utils/dist/types';
2324
import {
25+
ActionIcon,
2426
Box,
2527
Button,
2628
Grid,
@@ -216,29 +218,34 @@ export function EndpointLatencyChart({
216218
<ChartBox style={{ height: 350 }}>
217219
<Group justify="space-between" align="center" mb="sm">
218220
<Text size="sm">Request Latency</Text>
219-
<Box>
220-
<Button.Group>
221-
<Button
222-
variant="subtle"
223-
color={latencyChartType === 'line' ? 'green' : 'gray'}
221+
<div className="bg-muted px-2 py-1 rounded fs-8">
222+
<Tooltip label="Display as Line Chart">
223+
<ActionIcon
224224
size="xs"
225-
title="Line Chart"
225+
me={2}
226+
className={cx({
227+
'text-success': latencyChartType === 'line',
228+
'text-muted-hover': latencyChartType !== 'line',
229+
})}
226230
onClick={() => setLatencyChartType('line')}
227231
>
228-
<IconChartLine size={14} />
229-
</Button>
232+
<IconChartLine />
233+
</ActionIcon>
234+
</Tooltip>
230235

231-
<Button
232-
variant="subtle"
233-
color={latencyChartType === 'histogram' ? 'green' : 'gray'}
236+
<Tooltip label="Display as Histogram">
237+
<ActionIcon
234238
size="xs"
235-
title="Histogram"
239+
className={cx({
240+
'text-success': latencyChartType === 'histogram',
241+
'text-muted-hover': latencyChartType !== 'histogram',
242+
})}
236243
onClick={() => setLatencyChartType('histogram')}
237244
>
238-
<IconChartHistogram size={14} />
239-
</Button>
240-
</Button.Group>
241-
</Box>
245+
<IconChartHistogram />
246+
</ActionIcon>
247+
</Tooltip>
248+
</div>
242249
</Group>
243250
{source &&
244251
expressions &&

packages/app/src/SessionsPage.tsx

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,36 @@
11
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
22
import Head from 'next/head';
33
import { sub } from 'date-fns';
4-
import {
5-
parseAsString,
6-
parseAsStringEnum,
7-
useQueryState,
8-
useQueryStates,
9-
} from 'nuqs';
4+
import { parseAsString, parseAsStringEnum, useQueryStates } from 'nuqs';
105
import { useForm, useWatch } from 'react-hook-form';
116
import { NumberParam } from 'serialize-query-params';
12-
import {
13-
StringParam,
14-
useQueryParam,
15-
useQueryParams,
16-
withDefault,
17-
} from 'use-query-params';
7+
import { StringParam, useQueryParams, withDefault } from 'use-query-params';
188
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
199
import {
20-
DateRange,
2110
SearchCondition,
2211
SearchConditionLanguage,
2312
SourceKind,
24-
TSource,
2513
} from '@hyperdx/common-utils/dist/types';
2614
import {
2715
Alert,
2816
Box,
2917
Button,
18+
Center,
3019
Flex,
31-
Grid,
3220
Group,
33-
SegmentedControl,
3421
Stack,
35-
Tabs,
3622
Text,
3723
} from '@mantine/core';
38-
import { notifications } from '@mantine/notifications';
3924
import {
4025
IconDeviceLaptop,
4126
IconInfoCircleFilled,
4227
IconPlayerPlay,
28+
IconRefresh,
4329
} from '@tabler/icons-react';
4430
import { useVirtualizer } from '@tanstack/react-virtual';
4531

4632
import { SourceSelectControlled } from '@/components/SourceSelect';
4733
import { TimePicker } from '@/components/TimePicker';
48-
import { getMetadata } from '@/metadata';
4934
import { parseTimeQuery, useNewTimeQuery } from '@/timeQuery';
5035

5136
import { SQLInlineEditorControlled } from './components/SQLInlineEditor';
@@ -137,14 +122,10 @@ function SessionCardList({
137122
return (
138123
<>
139124
{isSessionLoading === true && (
140-
<div className="text-center mt-8">
141-
<div
142-
className="spinner-border me-2"
143-
role="status"
144-
style={{ width: 14, height: 14 }}
145-
/>
125+
<Group mt="md" align="center" justify="center" gap="xs">
126+
<IconRefresh className="spin-animate" size={14} />
146127
Searching sessions...
147-
</div>
128+
</Group>
148129
)}
149130
{!isSessionLoading && sessions.length === 0 && (
150131
<div className="text-center align-items-center justify-content-center my-3">
@@ -503,14 +484,10 @@ export default function SessionsPage() {
503484
</form>
504485

505486
{isSessionsLoading || isSessionSourceLoading ? (
506-
<div className="text-center mt-8">
507-
<div
508-
className="spinner-border me-2"
509-
role="status"
510-
style={{ width: 14, height: 14 }}
511-
/>
487+
<Group mt="md" align="center" justify="center" gap="xs">
488+
<IconRefresh className="spin-animate" size={14} />
512489
{isSessionSourceLoading ? 'Loading...' : 'Searching sessions...'}
513-
</div>
490+
</Group>
514491
) : (
515492
<>
516493
{sessionSource && sessionSource.kind !== SourceKind.Session && (

packages/app/src/components/DBEditTimeChartForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ export default function EditTimeChartForm({
919919
)}
920920
<Divider mt="md" mb="sm" />
921921
<Flex mt={4} align="center" justify="space-between">
922-
<Group gap={0}>
922+
<Group gap="xs">
923923
{displayType !== DisplayType.Number && (
924924
<Button
925925
variant="subtle"
@@ -1105,7 +1105,7 @@ export default function EditTimeChartForm({
11051105
</Button>
11061106
)}
11071107
</Flex>
1108-
<Flex gap="sm" my="sm" align="center" justify="end">
1108+
<Flex gap="sm" mb="sm" align="center" justify="end">
11091109
{activeTab === 'table' && (
11101110
<div style={{ minWidth: 300 }}>
11111111
<SQLInlineEditorControlled
@@ -1152,7 +1152,7 @@ export default function EditTimeChartForm({
11521152
{!IS_LOCAL_MODE && !dashboardId && (
11531153
<Menu width={250}>
11541154
<Menu.Target>
1155-
<Button variant="outline" color="gray" px="xs" size="xs">
1155+
<Button variant="outline" color="gray" px="xs" size="sm">
11561156
<IconDotsVertical size={14} />
11571157
</Button>
11581158
</Menu.Target>

packages/app/src/components/DBSearchPageFilters.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ export const FilterGroup = ({
630630
role="checkbox"
631631
>
632632
{isFetchingDistribution ? (
633-
<span className="spinner-border spinner-border-sm" />
633+
<Center>
634+
<IconRefresh className="spin-animate" size={12} />
635+
</Center>
634636
) : showDistributions ? (
635637
<IconChartBarOff size={14} />
636638
) : (

0 commit comments

Comments
 (0)