@parca/profile 0.19.139 → 0.19.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +11 -13
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +4 -9
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.js +13 -19
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +8 -8
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +4 -3
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.js +6 -4
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +4 -6
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +5 -10
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +27 -25
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +5 -5
- package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileView/components/ColorStackLegend.js +2 -3
- package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
- package/dist/ProfileView/components/InvertCallStack/index.js +5 -4
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +1 -2
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +14 -16
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +84 -170
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +16 -20
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +4 -5
- package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +1 -1
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +8 -14
- package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
- package/dist/ProfileView/context/DashboardContext.js +6 -6
- package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetFlameGraphState.js +5 -4
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +25 -26
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +13 -8
- package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
- package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.js +35 -51
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +19 -28
- package/dist/Sandwich/index.d.ts.map +1 -1
- package/dist/Sandwich/index.js +4 -3
- package/dist/SourceView/index.d.ts.map +1 -1
- package/dist/SourceView/index.js +4 -2
- package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
- package/dist/SourceView/useSelectedLineRange.js +21 -16
- package/dist/Table/MoreDropdown.d.ts.map +1 -1
- package/dist/Table/MoreDropdown.js +8 -11
- package/dist/Table/TableContextMenu.d.ts.map +1 -1
- package/dist/Table/TableContextMenu.js +10 -13
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +3 -4
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +11 -9
- package/dist/TopTable/index.d.ts.map +1 -1
- package/dist/TopTable/index.js +3 -4
- package/dist/hooks/urlParsers.d.ts +18 -0
- package/dist/hooks/urlParsers.d.ts.map +1 -0
- package/dist/hooks/urlParsers.js +32 -0
- package/dist/hooks/useColorBy.d.ts +5 -0
- package/dist/hooks/useColorBy.d.ts.map +1 -0
- package/dist/hooks/useColorBy.js +26 -0
- package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
- package/dist/hooks/useCompareModeMeta.js +55 -86
- package/dist/hooks/useDashboardItems.d.ts +5 -0
- package/dist/hooks/useDashboardItems.d.ts.map +1 -0
- package/dist/hooks/useDashboardItems.js +27 -0
- package/dist/hooks/useQueryState.d.ts +3 -3
- package/dist/hooks/useQueryState.d.ts.map +1 -1
- package/dist/hooks/useQueryState.js +105 -105
- package/dist/hooks/useQueryState.test.js +186 -302
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -12
- package/dist/useSumBy.d.ts +1 -1
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/useSumBy.js +2 -2
- package/package.json +8 -7
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +11 -13
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +4 -9
- package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
- package/src/ProfileFlameChart/index.tsx +21 -28
- package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +10 -9
- package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +5 -3
- package/src/ProfileFlameGraph/index.tsx +6 -9
- package/src/ProfileMetricsGraph/index.tsx +6 -8
- package/src/ProfileSelector/MetricsGraphSection.tsx +5 -10
- package/src/ProfileSelector/index.tsx +32 -31
- package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +10 -6
- package/src/ProfileView/components/ColorStackLegend.tsx +2 -4
- package/src/ProfileView/components/InvertCallStack/index.tsx +5 -4
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +94 -192
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +24 -25
- package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +4 -5
- package/src/ProfileView/components/Toolbars/index.tsx +3 -3
- package/src/ProfileView/components/ViewSelector/index.tsx +9 -16
- package/src/ProfileView/context/DashboardContext.tsx +6 -6
- package/src/ProfileView/hooks/useResetFlameGraphState.ts +6 -4
- package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +24 -26
- package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +16 -8
- package/src/ProfileView/hooks/useVisualizationState.ts +61 -69
- package/src/ProfileViewWithData.tsx +29 -35
- package/src/Sandwich/index.tsx +4 -3
- package/src/SourceView/index.tsx +4 -2
- package/src/SourceView/useSelectedLineRange.ts +34 -19
- package/src/Table/MoreDropdown.tsx +9 -11
- package/src/Table/TableContextMenu.tsx +10 -13
- package/src/Table/hooks/useTableConfiguration.tsx +3 -4
- package/src/Table/index.tsx +12 -21
- package/src/TopTable/index.tsx +3 -4
- package/src/hooks/urlParsers.ts +38 -0
- package/src/hooks/useColorBy.ts +42 -0
- package/src/hooks/useCompareModeMeta.ts +61 -91
- package/src/hooks/useDashboardItems.ts +46 -0
- package/src/hooks/useQueryState.test.tsx +275 -345
- package/src/hooks/useQueryState.ts +136 -118
- package/src/index.tsx +16 -15
- package/src/useSumBy.ts +3 -3
|
@@ -11,42 +11,60 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { useQueryState as useNuqsQueryState, useQueryStates } from 'nuqs';
|
|
15
|
+
import { DateTimeRange, useParcaContext } from '@parca/components';
|
|
15
16
|
import { Query } from '@parca/parser';
|
|
16
17
|
import { ProfileSelectionFromParams } from '../ProfileSource';
|
|
17
18
|
import { useResetFlameGraphState } from '../ProfileView/hooks/useResetFlameGraphState';
|
|
18
19
|
import { useResetStateOnProfileTypeChange } from '../ProfileView/hooks/useResetStateOnProfileTypeChange';
|
|
19
20
|
import { DEFAULT_EMPTY_SUM_BY, sumByToParam, useSumBy, useSumByFromParams } from '../useSumBy';
|
|
21
|
+
import { commaArrayParam, stringParam } from './urlParsers';
|
|
20
22
|
export const useQueryState = (options = {}) => {
|
|
21
23
|
const { queryServiceClient: queryClient } = useParcaContext();
|
|
22
24
|
const { suffix = '', defaultExpression = '', defaultTimeSelection = 'relative:minute|15', // Default to 15 minutes relative
|
|
23
25
|
defaultFrom, defaultTo, comparing = false, onProfileTypeChange, } = options;
|
|
24
|
-
const batchUpdates = useURLStateBatch();
|
|
25
26
|
const resetFlameGraphState = useResetFlameGraphState();
|
|
26
27
|
const resetStateOnProfileTypeChange = useResetStateOnProfileTypeChange();
|
|
27
|
-
// URL state hooks with appropriate suffixes
|
|
28
|
-
const [
|
|
29
|
-
|
|
28
|
+
// URL state hooks with appropriate suffixes via useQueryStates
|
|
29
|
+
const [queryParams, setQueryParams] = useQueryStates({
|
|
30
|
+
expression: stringParam,
|
|
31
|
+
from: stringParam,
|
|
32
|
+
to: stringParam,
|
|
33
|
+
time_selection: stringParam,
|
|
34
|
+
sum_by: stringParam,
|
|
35
|
+
merge_from: stringParam,
|
|
36
|
+
merge_to: stringParam,
|
|
37
|
+
selection: stringParam,
|
|
38
|
+
}, {
|
|
39
|
+
history: 'replace',
|
|
40
|
+
urlKeys: {
|
|
41
|
+
expression: `expression${suffix}`,
|
|
42
|
+
from: `from${suffix}`,
|
|
43
|
+
to: `to${suffix}`,
|
|
44
|
+
time_selection: `time_selection${suffix}`,
|
|
45
|
+
sum_by: `sum_by${suffix}`,
|
|
46
|
+
merge_from: `merge_from${suffix}`,
|
|
47
|
+
merge_to: `merge_to${suffix}`,
|
|
48
|
+
selection: `selection${suffix}`,
|
|
49
|
+
},
|
|
30
50
|
});
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// ProfileSelection URL state hooks - reuses merge_from/merge_to but adds selection
|
|
47
|
-
const [selectionParam, setSelectionParam] = useURLState(`selection${suffix}`);
|
|
51
|
+
const expression = queryParams.expression ?? defaultExpression;
|
|
52
|
+
const from = queryParams.from ?? defaultFrom?.toString();
|
|
53
|
+
const to = queryParams.to ?? defaultTo?.toString();
|
|
54
|
+
const timeSelection = queryParams.time_selection ?? defaultTimeSelection;
|
|
55
|
+
const sumByParam = queryParams.sum_by;
|
|
56
|
+
const mergeFrom = queryParams.merge_from;
|
|
57
|
+
const mergeTo = queryParams.merge_to;
|
|
58
|
+
const selectionParam = queryParams.selection;
|
|
59
|
+
// Individual setters for direct access
|
|
60
|
+
const setExpressionState = useCallback((val) => void setQueryParams({ expression: val }), [setQueryParams]);
|
|
61
|
+
const setSumByParam = useCallback((val) => void setQueryParams({ sum_by: val }), [setQueryParams]);
|
|
62
|
+
const [, setRawGroupByParam] = useNuqsQueryState('group_by', commaArrayParam);
|
|
63
|
+
const setGroupByParam = useCallback((val) => {
|
|
64
|
+
void setRawGroupByParam(val);
|
|
65
|
+
}, [setRawGroupByParam]);
|
|
48
66
|
// Parse sumBy from URL parameter format
|
|
49
|
-
const sumBy = useSumByFromParams(sumByParam);
|
|
67
|
+
const sumBy = useSumByFromParams(sumByParam ?? undefined);
|
|
50
68
|
// Draft state management
|
|
51
69
|
const [draftExpression, setDraftExpression] = useState(expression ?? defaultExpression);
|
|
52
70
|
const [draftFrom, setDraftFrom] = useState(from ?? defaultFrom?.toString() ?? '');
|
|
@@ -105,20 +123,20 @@ export const useQueryState = (options = {}) => {
|
|
|
105
123
|
// Sync computed sumBy to URL if URL doesn't already have a value
|
|
106
124
|
// to ensure the shared URL can always pick it up.
|
|
107
125
|
useEffect(() => {
|
|
108
|
-
if (sumByParam ===
|
|
109
|
-
setSumByParam(sumByToParam(computedSumByFromURL));
|
|
126
|
+
if (sumByParam === null && computedSumByFromURL !== undefined && !sumBySelectionLoading) {
|
|
127
|
+
void setSumByParam(sumByToParam(computedSumByFromURL));
|
|
110
128
|
}
|
|
111
129
|
}, [sumByParam, computedSumByFromURL, sumBySelectionLoading, setSumByParam]);
|
|
112
130
|
// Construct the QuerySelection object (committed state from URL)
|
|
113
131
|
const querySelection = useMemo(() => {
|
|
114
|
-
const range = DateTimeRange.fromRangeKey(timeSelection ?? defaultTimeSelection, from
|
|
132
|
+
const range = DateTimeRange.fromRangeKey(timeSelection ?? defaultTimeSelection, from != null && from !== '' ? parseInt(from) : defaultFrom, to != null && to !== '' ? parseInt(to) : defaultTo);
|
|
115
133
|
return {
|
|
116
134
|
expression: expression ?? defaultExpression,
|
|
117
135
|
from: range.getFromMs(),
|
|
118
136
|
to: range.getToMs(),
|
|
119
137
|
timeSelection: range.getRangeKey(),
|
|
120
138
|
sumBy: computedSumByFromURL,
|
|
121
|
-
...(mergeFrom
|
|
139
|
+
...(mergeFrom != null && mergeFrom !== '' && mergeTo != null && mergeTo !== ''
|
|
122
140
|
? { mergeFrom, mergeTo }
|
|
123
141
|
: {}),
|
|
124
142
|
};
|
|
@@ -168,7 +186,7 @@ export const useQueryState = (options = {}) => {
|
|
|
168
186
|
]);
|
|
169
187
|
// Compute ProfileSelection from URL params
|
|
170
188
|
const profileSelection = useMemo(() => {
|
|
171
|
-
return ProfileSelectionFromParams(mergeFrom, mergeTo, selectionParam);
|
|
189
|
+
return ProfileSelectionFromParams(mergeFrom ?? undefined, mergeTo ?? undefined, selectionParam ?? undefined);
|
|
172
190
|
}, [mergeFrom, mergeTo, selectionParam]);
|
|
173
191
|
// Compute ProfileSource from ProfileSelection
|
|
174
192
|
const profileSource = useMemo(() => {
|
|
@@ -181,73 +199,62 @@ export const useQueryState = (options = {}) => {
|
|
|
181
199
|
// to the current moment when the Search button is clicked
|
|
182
200
|
// Optional expression parameter allows updating the expression before committing
|
|
183
201
|
const commitDraft = useCallback((refreshedTimeRange, expression) => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
if (isDelta && finalFrom !== '' && finalTo !== '') {
|
|
222
|
-
const fromMs = parseInt(finalFrom);
|
|
223
|
-
const toMs = parseInt(finalTo);
|
|
224
|
-
setMergeFromState((BigInt(fromMs) * 1000000n).toString());
|
|
225
|
-
setMergeToState((BigInt(toMs) * 1000000n).toString());
|
|
226
|
-
// Auto-select the time range for delta profiles (but not in compare mode)
|
|
227
|
-
// This applies both on initial load AND when Search is clicked
|
|
228
|
-
// The selection will use the final expression and the updated time range
|
|
229
|
-
if (!comparing) {
|
|
230
|
-
setSelectionParam(finalExpression);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
setSelectionParam(undefined);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
setMergeFromState(undefined);
|
|
238
|
-
setMergeToState(undefined);
|
|
239
|
-
// Clear ProfileSelection for non-delta profiles
|
|
240
|
-
setSelectionParam(undefined);
|
|
241
|
-
}
|
|
242
|
-
resetFlameGraphState();
|
|
243
|
-
if (draftProfileType.toString() !==
|
|
244
|
-
Query.parse(querySelection.expression).profileType().toString()) {
|
|
245
|
-
resetStateOnProfileTypeChange();
|
|
246
|
-
onProfileTypeChange?.();
|
|
202
|
+
// Use provided expression or current draft expression
|
|
203
|
+
const finalExpression = expression ?? draftExpression;
|
|
204
|
+
// Update draft state with new expression if provided
|
|
205
|
+
if (expression !== undefined) {
|
|
206
|
+
setDraftExpression(expression);
|
|
207
|
+
}
|
|
208
|
+
// Calculate the actual from/to values from draftSelection if not provided
|
|
209
|
+
const calculatedFrom = draftSelection.from.toString();
|
|
210
|
+
const calculatedTo = draftSelection.to.toString();
|
|
211
|
+
const finalFrom = refreshedTimeRange?.from?.toString() ?? (draftFrom !== '' ? draftFrom : calculatedFrom);
|
|
212
|
+
const finalTo = refreshedTimeRange?.to?.toString() ?? (draftTo !== '' ? draftTo : calculatedTo);
|
|
213
|
+
const finalTimeSelection = refreshedTimeRange?.timeSelection ?? draftTimeSelection;
|
|
214
|
+
// Update draft state with refreshed time range if provided
|
|
215
|
+
if (refreshedTimeRange?.from !== undefined) {
|
|
216
|
+
setDraftFrom(finalFrom);
|
|
217
|
+
}
|
|
218
|
+
if (refreshedTimeRange?.to !== undefined) {
|
|
219
|
+
setDraftTo(finalTo);
|
|
220
|
+
}
|
|
221
|
+
if (refreshedTimeRange?.timeSelection !== undefined) {
|
|
222
|
+
setDraftTimeSelection(finalTimeSelection);
|
|
223
|
+
}
|
|
224
|
+
// Auto-calculate merge parameters for delta profiles
|
|
225
|
+
const finalQuery = Query.parse(finalExpression);
|
|
226
|
+
const isDelta = finalQuery.profileType().delta;
|
|
227
|
+
const sumByValue = isDelta ? sumByToParam(draftSumBy) : sumByToParam(DEFAULT_EMPTY_SUM_BY);
|
|
228
|
+
let mergeFromValue = null;
|
|
229
|
+
let mergeToValue = null;
|
|
230
|
+
let selectionValue = null;
|
|
231
|
+
if (isDelta && finalFrom !== '' && finalTo !== '') {
|
|
232
|
+
const fromMs = parseInt(finalFrom);
|
|
233
|
+
const toMs = parseInt(finalTo);
|
|
234
|
+
mergeFromValue = (BigInt(fromMs) * 1000000n).toString();
|
|
235
|
+
mergeToValue = (BigInt(toMs) * 1000000n).toString();
|
|
236
|
+
if (!comparing) {
|
|
237
|
+
selectionValue = finalExpression;
|
|
247
238
|
}
|
|
239
|
+
}
|
|
240
|
+
// Atomic URL update with all params at once
|
|
241
|
+
void setQueryParams({
|
|
242
|
+
expression: finalExpression,
|
|
243
|
+
from: finalFrom,
|
|
244
|
+
to: finalTo,
|
|
245
|
+
time_selection: finalTimeSelection,
|
|
246
|
+
sum_by: sumByValue,
|
|
247
|
+
merge_from: mergeFromValue,
|
|
248
|
+
merge_to: mergeToValue,
|
|
249
|
+
selection: selectionValue,
|
|
248
250
|
});
|
|
251
|
+
resetFlameGraphState();
|
|
252
|
+
if (draftProfileType.toString() !==
|
|
253
|
+
Query.parse(querySelection.expression).profileType().toString()) {
|
|
254
|
+
resetStateOnProfileTypeChange();
|
|
255
|
+
onProfileTypeChange?.();
|
|
256
|
+
}
|
|
249
257
|
}, [
|
|
250
|
-
batchUpdates,
|
|
251
258
|
draftExpression,
|
|
252
259
|
draftFrom,
|
|
253
260
|
draftTo,
|
|
@@ -256,14 +263,7 @@ export const useQueryState = (options = {}) => {
|
|
|
256
263
|
draftSelection.from,
|
|
257
264
|
draftSelection.to,
|
|
258
265
|
comparing,
|
|
259
|
-
|
|
260
|
-
setFromState,
|
|
261
|
-
setToState,
|
|
262
|
-
setTimeSelectionState,
|
|
263
|
-
setSumByParam,
|
|
264
|
-
setMergeFromState,
|
|
265
|
-
setMergeToState,
|
|
266
|
-
setSelectionParam,
|
|
266
|
+
setQueryParams,
|
|
267
267
|
resetFlameGraphState,
|
|
268
268
|
resetStateOnProfileTypeChange,
|
|
269
269
|
onProfileTypeChange,
|
|
@@ -293,12 +293,12 @@ export const useQueryState = (options = {}) => {
|
|
|
293
293
|
}, [draftProfileName]);
|
|
294
294
|
// Set ProfileSelection (auto-commits to URL immediately)
|
|
295
295
|
const setProfileSelection = useCallback((mergeFrom, mergeTo, query) => {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
void setQueryParams({
|
|
297
|
+
selection: query.toString(),
|
|
298
|
+
merge_from: mergeFrom.toString(),
|
|
299
|
+
merge_to: mergeTo.toString(),
|
|
300
300
|
});
|
|
301
|
-
}, [
|
|
301
|
+
}, [setQueryParams]);
|
|
302
302
|
const draftParsedQuery = useMemo(() => {
|
|
303
303
|
try {
|
|
304
304
|
return Query.parse(draftSelection.expression ?? '');
|