@parca/profile 0.19.157 → 0.19.158

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 CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.19.158](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.157...@parca/profile@0.19.158) (2026-06-24)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.19.157](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.156...@parca/profile@0.19.157) (2026-06-23)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -1 +1 @@
1
- {"version":3,"file":"useQueryState.d.ts","sourceRoot":"","sources":["../../src/hooks/useQueryState.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,gBAAgB,EAA8B,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAM7F,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,UAAU,mBAAmB;IAE3B,cAAc,EAAE,cAAc,CAAC;IAG/B,cAAc,EAAE,cAAc,CAAC;IAG/B,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,E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AK,IAAI,CAAC;IAGhF,YAAY,EAAE,OAAO,CAAC;IAGtB,gBAAgB,EAAE,KAAK,GAAG,IAAI,CAAC;IAG/B,WAAW,EAAE,KAAK,GAAG,IAAI,CAAC;IAE1B,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,aAAa,GAAI,UAAS,oBAAyB,KAAG,mBAwdlE,CAAC"}
@@ -36,7 +36,8 @@ export var useQueryState = function useQueryState() {
36
36
  var _queryParams$expressi, _queryParams$from, _queryParams$to, _queryParams$time_sel, _ref, _ref2;
37
37
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
38
38
  var _useParcaContext = useParcaContext(),
39
- queryClient = _useParcaContext.queryServiceClient;
39
+ queryClient = _useParcaContext.queryServiceClient,
40
+ externalProfilerComponent = _useParcaContext.externalProfilerComponent;
40
41
  var _options$suffix = options.suffix,
41
42
  suffix = _options$suffix === void 0 ? '' : _options$suffix,
42
43
  _options$defaultExpre = options.defaultExpression,
@@ -109,6 +110,12 @@ export var useQueryState = function useQueryState() {
109
110
  // Parse sumBy from URL parameter format
110
111
  var sumBy = useSumByFromParams(sumByParam !== null && sumByParam !== void 0 ? sumByParam : undefined);
111
112
 
113
+ // Fall back to the externally-provided sumBy default when the URL carries no
114
+ // sum_by, so the materialized value reflects it instead of the empty __none__
115
+ // sentinel (an explicit __none__ from the URL is left untouched).
116
+ var externalSumBy = externalProfilerComponent === null || externalProfilerComponent === void 0 ? void 0 : externalProfilerComponent.defaultSumBy;
117
+ var sumByWithViewDefault = sumBy !== null && sumBy !== void 0 ? sumBy : externalSumBy != null && externalSumBy.length > 0 ? externalSumBy : undefined;
118
+
112
119
  // Draft state management
113
120
  var _useState = useState(expression !== null && expression !== void 0 ? expression : defaultExpression),
114
121
  _useState2 = _slicedToArray(_useState, 2),
@@ -164,7 +171,7 @@ export var useQueryState = function useQueryState() {
164
171
  return DateTimeRange.fromRangeKey(draftTimeSelection !== null && draftTimeSelection !== void 0 ? draftTimeSelection : defaultTimeSelection, draftFrom !== '' ? parseInt(draftFrom) : defaultFrom, draftTo !== '' ? parseInt(draftTo) : defaultTo);
165
172
  }, [draftTimeSelection, draftFrom, draftTo, defaultTimeSelection, defaultFrom, defaultTo]);
166
173
  // Use combined sumBy hook for fetching labels and computing defaults (based on committed state)
167
- var _useSumBy = useSumBy(queryClient, (profileType === null || profileType === void 0 ? void 0 : profileType.profileName) !== '' ? profileType : draftProfileType, draftTimeRange, draftProfileType, draftTimeRange, sumBy),
174
+ var _useSumBy = useSumBy(queryClient, (profileType === null || profileType === void 0 ? void 0 : profileType.profileName) !== '' ? profileType : draftProfileType, draftTimeRange, draftProfileType, draftTimeRange, sumByWithViewDefault),
168
175
  computedSumByFromURL = _useSumBy.sumBy,
169
176
  sumBySelectionLoading = _useSumBy.isLoading,
170
177
  draftSumBy = _useSumBy.draftSumBy,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.19.157",
3
+ "version": "0.19.158",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@floating-ui/react": "^0.27.12",
7
7
  "@headlessui/react": "^1.7.19",
8
8
  "@iconify/react": "^4.0.0",
9
9
  "@parca/client": "0.17.24",
10
- "@parca/components": "0.16.421",
10
+ "@parca/components": "0.16.422",
11
11
  "@parca/dynamicsize": "0.16.75",
12
12
  "@parca/hooks": "0.0.128",
13
13
  "@parca/icons": "0.16.83",
@@ -89,5 +89,5 @@
89
89
  "access": "public",
90
90
  "registry": "https://registry.npmjs.org/"
91
91
  },
92
- "gitHead": "e84502e97f82660256ff814e12867002751930c6"
92
+ "gitHead": "8f6bee48fed3dd9197eb9696b5e3bfe8d92e34cf"
93
93
  }
@@ -79,7 +79,7 @@ interface UseQueryStateReturn {
79
79
  }
80
80
 
81
81
  export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryStateReturn => {
82
- const {queryServiceClient: queryClient} = useParcaContext();
82
+ const {queryServiceClient: queryClient, externalProfilerComponent} = useParcaContext();
83
83
  const {
84
84
  suffix = '',
85
85
  defaultExpression = '',
@@ -153,6 +153,13 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
153
153
  // Parse sumBy from URL parameter format
154
154
  const sumBy = useSumByFromParams(sumByParam ?? undefined);
155
155
 
156
+ // Fall back to the externally-provided sumBy default when the URL carries no
157
+ // sum_by, so the materialized value reflects it instead of the empty __none__
158
+ // sentinel (an explicit __none__ from the URL is left untouched).
159
+ const externalSumBy = externalProfilerComponent?.defaultSumBy;
160
+ const sumByWithViewDefault =
161
+ sumBy ?? (externalSumBy != null && externalSumBy.length > 0 ? externalSumBy : undefined);
162
+
156
163
  // Draft state management
157
164
  const [draftExpression, setDraftExpression] = useState<string>(expression ?? defaultExpression);
158
165
  const [draftFrom, setDraftFrom] = useState<string>(from ?? defaultFrom?.toString() ?? '');
@@ -209,7 +216,7 @@ export const useQueryState = (options: UseQueryStateOptions = {}): UseQueryState
209
216
  draftTimeRange,
210
217
  draftProfileType,
211
218
  draftTimeRange,
212
- sumBy
219
+ sumByWithViewDefault
213
220
  );
214
221
 
215
222
  // Sync draft state with URL state when URL changes externally