@parca/profile 0.19.14 → 0.19.16

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,14 @@
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.16](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.15...@parca/profile@0.19.16) (2025-07-08)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.19.15](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.14...@parca/profile@0.19.15) (2025-07-08)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.19.14](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.13...@parca/profile@0.19.14) (2025-07-08)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -1 +1 @@
1
- {"version":3,"file":"useSumBy.d.ts","sourceRoot":"","sources":["../src/useSumBy.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAO,CAAC;AA6BjD,eAAO,MAAM,iBAAiB,gBACf,WAAW,GAAG,SAAS,qBACjB,OAAO,UAClB,MAAM,EAAE,GAAG,SAAS,sBAGzB;IACD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,KACA,CACD,MAAM,EAAE,GAAG,SAAS,EACpB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,EAC1B;IACE,SAAS,EAAE,OAAO,CAAC;CACpB,CAsCF,CAAC;AAEF,eAAO,MAAM,eAAe,gBACb,WAAW,GAAG,SAAS,qBACjB,OAAO,UAClB,MAAM,EAAE,GAAG,SAAS,KAC3B;IAAC,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAMzD,CAAC;AAkBF,eAAO,MAAM,kBAAkB,UAAW,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KAAG,MAAM,EAAE,GAAG,SAMpF,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,EAAE,GAAG,SAAS,KAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAU9E,CAAC"}
1
+ {"version":3,"file":"useSumBy.d.ts","sourceRoot":"","sources":["../src/useSumBy.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAO,CAAC;AA6BjD,eAAO,MAAM,iBAAiB,gBACf,WAAW,GAAG,SAAS,qBACjB,OAAO,UAClB,MAAM,EAAE,GAAG,SAAS,sBAGzB;IACD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,KACA,CACD,MAAM,EAAE,GAAG,SAAS,EACpB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,EAC1B;IACE,SAAS,EAAE,OAAO,CAAC;CACpB,CAgDF,CAAC;AAEF,eAAO,MAAM,eAAe,gBACb,WAAW,GAAG,SAAS,qBACjB,OAAO,UAClB,MAAM,EAAE,GAAG,SAAS,KAC3B;IAAC,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAMzD,CAAC;AAyBF,eAAO,MAAM,kBAAkB,UAAW,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KAAG,MAAM,EAAE,GAAG,SAMpF,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,EAAE,GAAG,SAAS,KAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAU9E,CAAC"}
package/dist/useSumBy.js CHANGED
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { useCallback, useMemo, useState } from 'react';
13
+ import { useCallback, useEffect, useMemo, useState } from 'react';
14
14
  export const DEFAULT_EMPTY_SUM_BY = [];
15
15
  const getDefaultSumBy = (profile, labels) => {
16
16
  if (profile === undefined || labels === undefined) {
@@ -32,6 +32,15 @@ const getDefaultSumBy = (profile, labels) => {
32
32
  };
33
33
  export const useSumBySelection = (profileType, labelNamesLoading, labels, { defaultValue, } = {}) => {
34
34
  const [userSelectedSumBy, setUserSelectedSumBy] = useState(profileType != null ? { [profileType.toString()]: defaultValue } : {});
35
+ // Update userSelectedSumBy when defaultValue changes (e.g., during navigation)
36
+ useEffect(() => {
37
+ if (profileType != null && defaultValue !== undefined) {
38
+ setUserSelectedSumBy(prev => ({
39
+ ...prev,
40
+ [profileType.toString()]: defaultValue,
41
+ }));
42
+ }
43
+ }, [profileType, defaultValue]);
35
44
  const setSumBy = useCallback((sumBy) => {
36
45
  setUserSelectedSumBy(prev => {
37
46
  if (profileType == null) {
@@ -70,6 +79,13 @@ const getSumByFromParam = (param) => {
70
79
  return [];
71
80
  }
72
81
  if (typeof param === 'string') {
82
+ // Handle comma-separated strings (e.g., "comm,node" -> ["comm", "node"])
83
+ if (param.includes(',')) {
84
+ return param
85
+ .split(',')
86
+ .map(s => s.trim())
87
+ .filter(s => s.length > 0);
88
+ }
73
89
  return [param];
74
90
  }
75
91
  return param;
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.19.14",
3
+ "version": "0.19.16",
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
- "@parca/client": "0.17.0",
10
- "@parca/components": "0.16.345",
9
+ "@parca/client": "0.17.1",
10
+ "@parca/components": "0.16.346",
11
11
  "@parca/dynamicsize": "0.16.65",
12
- "@parca/hooks": "0.0.91",
12
+ "@parca/hooks": "0.0.92",
13
13
  "@parca/icons": "0.16.72",
14
14
  "@parca/parser": "0.16.79",
15
- "@parca/store": "0.16.175",
16
- "@parca/utilities": "0.0.100",
15
+ "@parca/store": "0.16.176",
16
+ "@parca/utilities": "0.0.101",
17
17
  "@popperjs/core": "^2.11.8",
18
18
  "@protobuf-ts/runtime-rpc": "^2.5.0",
19
19
  "@storybook/preview-api": "^8.4.3",
@@ -78,5 +78,5 @@
78
78
  "access": "public",
79
79
  "registry": "https://registry.npmjs.org/"
80
80
  },
81
- "gitHead": "2eea9d7d4d02cecf324386b49fa72fbf7529b15b"
81
+ "gitHead": "1aa5b4c5e25f2dcaaad42997e99bf2b5b0089608"
82
82
  }
package/src/useSumBy.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
 
14
- import {useCallback, useMemo, useState} from 'react';
14
+ import {useCallback, useEffect, useMemo, useState} from 'react';
15
15
 
16
16
  import {ProfileType} from '@parca/parser';
17
17
 
@@ -64,6 +64,16 @@ export const useSumBySelection = (
64
64
  profileType != null ? {[profileType.toString()]: defaultValue} : {}
65
65
  );
66
66
 
67
+ // Update userSelectedSumBy when defaultValue changes (e.g., during navigation)
68
+ useEffect(() => {
69
+ if (profileType != null && defaultValue !== undefined) {
70
+ setUserSelectedSumBy(prev => ({
71
+ ...prev,
72
+ [profileType.toString()]: defaultValue,
73
+ }));
74
+ }
75
+ }, [profileType, defaultValue]);
76
+
67
77
  const setSumBy = useCallback(
68
78
  (sumBy: string[]) => {
69
79
  setUserSelectedSumBy(prev => {
@@ -120,6 +130,13 @@ const getSumByFromParam = (param: string | string[] | undefined): string[] | und
120
130
  }
121
131
 
122
132
  if (typeof param === 'string') {
133
+ // Handle comma-separated strings (e.g., "comm,node" -> ["comm", "node"])
134
+ if (param.includes(',')) {
135
+ return param
136
+ .split(',')
137
+ .map(s => s.trim())
138
+ .filter(s => s.length > 0);
139
+ }
123
140
  return [param];
124
141
  }
125
142