Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chart-explorer-auto-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---

feat: Chart Explorer now auto-executes the chart on load when a valid source is configured. Deeplinks render results without requiring a manual click.
1 change: 1 addition & 0 deletions packages/app/src/DBChartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ function DBChartExplorerPage() {
onTimeRangeSearch={onSearch}
onTimeRangeSelect={onTimeRangeSelect}
submitRef={submitRef}
autoRun
/>
</Box>
);
Expand Down
10 changes: 10 additions & 0 deletions packages/app/src/components/DBEditTimeChartForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ export default function EditTimeChartForm({
'data-testid': dataTestId,
submitRef,
isDashboardForm = false,
autoRun = false,
}: {
dashboardId?: string;
chartConfig: SavedChartConfig;
Expand All @@ -562,6 +563,7 @@ export default function EditTimeChartForm({
'data-testid'?: string;
submitRef?: React.MutableRefObject<(() => void) | undefined>;
isDashboardForm?: boolean;
autoRun?: boolean;
}) {
const formValue: ChartEditorFormState = useMemo(
() => convertSavedChartConfigToFormState(chartConfig),
Expand Down Expand Up @@ -827,6 +829,14 @@ export default function EditTimeChartForm({
}
}, [onSubmit, submitRef]);

const autoRunFired = useRef(false);
useEffect(() => {
if (autoRun && !autoRunFired.current && tableSource) {
autoRunFired.current = true;
onSubmit(true);
}
}, [autoRun, tableSource, onSubmit]);

const handleSave = useCallback(
(form: ChartEditorFormState) => {
const errors = validateChartForm(form, tableSource, setError);
Expand Down
Loading