Skip to content

Commit 8ea3bfc

Browse files
committed
feat(chart): always auto-run on load instead of requiring ?run=true
Per review feedback, simplify to always auto-run when the Chart Explorer loads with a valid source, rather than gating behind a ?run=true query param. The tableSource check serves as the non-empty guard. Validation errors are suppressed on the initial auto-run so users landing with an incomplete config don't see an error toast. Addresses #1961 (comment)
1 parent 6e3da8d commit 8ea3bfc

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

.changeset/chart-explorer-auto-run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"@hyperdx/app": patch
33
---
44

5-
feat: support `?run=true` query param on Chart Explorer to auto-execute the chart on load. Enables deeplinks that render results without requiring a manual click.
5+
feat: Chart Explorer now auto-executes the chart on load when a valid source is configured. Deeplinks render results without requiring a manual click.

packages/app/src/DBChartPage.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useRef, useState } from 'react';
22
import dynamic from 'next/dynamic';
33
import Head from 'next/head';
4-
import { parseAsBoolean, parseAsJson, useQueryState } from 'nuqs';
4+
import { parseAsJson, useQueryState } from 'nuqs';
55
import { useForm } from 'react-hook-form';
66
import { useHotkeys } from 'react-hotkeys-hook';
77
import { SavedChartConfig, SourceKind } from '@hyperdx/common-utils/dist/types';
@@ -230,8 +230,6 @@ function DBChartExplorerPage() {
230230
}),
231231
);
232232

233-
const [autoRun] = useQueryState('run', parseAsBoolean.withDefault(false));
234-
235233
return (
236234
<Box data-testid="chart-explorer-page" p="sm">
237235
<Head>
@@ -255,7 +253,7 @@ function DBChartExplorerPage() {
255253
onTimeRangeSearch={onSearch}
256254
onTimeRangeSelect={onTimeRangeSelect}
257255
submitRef={submitRef}
258-
autoRun={autoRun}
256+
autoRun
259257
/>
260258
</Box>
261259
);

packages/app/src/components/DBEditTimeChartForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ export default function EditTimeChartForm({
833833
useEffect(() => {
834834
if (autoRun && !autoRunFired.current && tableSource) {
835835
autoRunFired.current = true;
836-
onSubmit();
836+
onSubmit(true);
837837
}
838838
}, [autoRun, tableSource, onSubmit]);
839839

0 commit comments

Comments
 (0)