Skip to content

Commit bd940f3

Browse files
style: Improve dashboard filter modal UX (#1215)
Closes HDX-2502 # Summary This PR improves the Dashboard Filter Modal UX. ## Before https://github.com/user-attachments/assets/39a6f17e-fc76-42fc-a288-8a1c2d1949fa ## After https://github.com/user-attachments/assets/8d6f0183-9de9-4401-be99-902293b86878 Co-authored-by: Elizabet Oliveira <[email protected]>
1 parent 730325a commit bd940f3

File tree

6 files changed

+448
-294
lines changed

6 files changed

+448
-294
lines changed

.changeset/lucky-pugs-turn.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: Improve dashboard filter modal UX

packages/app/src/DBDashboardPage.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import { DEFAULT_CHART_CONFIG } from './ChartUtils';
7171
import { IS_LOCAL_MODE } from './config';
7272
import { useDashboard } from './dashboard';
7373
import DashboardFilters from './DashboardFilters';
74-
import DashboardFiltersEditModal from './DashboardFiltersEditModal';
74+
import DashboardFiltersModal from './DashboardFiltersModal';
7575
import { GranularityPickerControlled } from './GranularityPicker';
7676
import HDXMarkdownChart from './HDXMarkdownChart';
7777
import { withAppNav } from './layout';
@@ -517,6 +517,8 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
517517
dashboardHash,
518518
isLocalDashboard,
519519
isLocalDashboardEmpty,
520+
isFetching: isFetchingDashboard,
521+
isSetting: isSavingDashboard,
520522
} = useDashboard({
521523
dashboardId: dashboardId as string | undefined,
522524
presetConfig,
@@ -562,7 +564,7 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
562564
parseAsString.withDefault('lucene'),
563565
);
564566

565-
const [showVariablesModal, setShowVariablesModal] = useState(false);
567+
const [showFiltersModal, setShowFiltersModal] = useState(false);
566568

567569
const filters = dashboard?.filters ?? [];
568570
const { filterValues, setFilterValue, filterQueries } =
@@ -1084,7 +1086,7 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
10841086
color="gray"
10851087
px="xs"
10861088
mr={6}
1087-
onClick={() => setShowVariablesModal(true)}
1089+
onClick={() => setShowFiltersModal(true)}
10881090
>
10891091
<IconFilterEdit strokeWidth={1} />
10901092
</Button>
@@ -1161,12 +1163,13 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
11611163
>
11621164
+ Add New Tile
11631165
</Button>
1164-
<DashboardFiltersEditModal
1165-
opened={showVariablesModal}
1166-
onClose={() => setShowVariablesModal(false)}
1166+
<DashboardFiltersModal
1167+
opened={showFiltersModal}
1168+
onClose={() => setShowFiltersModal(false)}
11671169
filters={filters}
11681170
onSaveFilter={handleSaveFilter}
11691171
onRemoveFilter={handleRemoveFilter}
1172+
isLoading={isSavingDashboard || isFetchingDashboard}
11701173
/>
11711174
</Box>
11721175
);

packages/app/src/DashboardFiltersEditModal.tsx

Lines changed: 0 additions & 277 deletions
This file was deleted.

0 commit comments

Comments
 (0)