@parca/profile 0.19.142 → 0.19.144

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
  3. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +22 -28
  4. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  5. package/dist/ProfileExplorer/ProfileExplorerCompare.js +72 -73
  6. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
  7. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
  8. package/dist/ProfileFlameChart/index.d.ts.map +1 -1
  9. package/dist/ProfileFlameChart/index.js +20 -24
  10. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
  11. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +13 -14
  12. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  13. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +6 -5
  14. package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
  15. package/dist/ProfileFlameGraph/index.js +8 -7
  16. package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
  17. package/dist/ProfileMetricsGraph/index.js +6 -8
  18. package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
  19. package/dist/ProfileSelector/MetricsGraphSection.js +48 -55
  20. package/dist/ProfileSelector/index.d.ts +1 -1
  21. package/dist/ProfileSelector/index.d.ts.map +1 -1
  22. package/dist/ProfileSelector/index.js +216 -210
  23. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  24. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  25. package/dist/ProfileSelector/useAutoQuerySelector.js +133 -104
  26. package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
  27. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +24 -25
  28. package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
  29. package/dist/ProfileView/components/ColorStackLegend.js +3 -5
  30. package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
  31. package/dist/ProfileView/components/InvertCallStack/index.js +47 -47
  32. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +1 -2
  33. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
  34. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +37 -34
  35. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  36. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +282 -294
  37. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
  38. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +7 -8
  39. package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
  40. package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
  41. package/dist/ProfileView/components/Toolbars/index.js +1 -1
  42. package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
  43. package/dist/ProfileView/components/ViewSelector/index.js +53 -75
  44. package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
  45. package/dist/ProfileView/context/DashboardContext.js +36 -44
  46. package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
  47. package/dist/ProfileView/hooks/useResetFlameGraphState.js +8 -7
  48. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
  49. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +59 -59
  50. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
  51. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +37 -22
  52. package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
  53. package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
  54. package/dist/ProfileView/hooks/useVisualizationState.js +116 -147
  55. package/dist/ProfileViewWithData.d.ts.map +1 -1
  56. package/dist/ProfileViewWithData.js +35 -45
  57. package/dist/Sandwich/index.d.ts.map +1 -1
  58. package/dist/Sandwich/index.js +6 -5
  59. package/dist/SourceView/index.d.ts.map +1 -1
  60. package/dist/SourceView/index.js +6 -4
  61. package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
  62. package/dist/SourceView/useSelectedLineRange.js +52 -76
  63. package/dist/Table/MoreDropdown.d.ts.map +1 -1
  64. package/dist/Table/MoreDropdown.js +42 -53
  65. package/dist/Table/TableContextMenu.d.ts.map +1 -1
  66. package/dist/Table/TableContextMenu.js +15 -19
  67. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  68. package/dist/Table/hooks/useTableConfiguration.js +107 -115
  69. package/dist/Table/index.d.ts.map +1 -1
  70. package/dist/Table/index.js +16 -16
  71. package/dist/TopTable/index.d.ts.map +1 -1
  72. package/dist/TopTable/index.js +112 -127
  73. package/dist/hooks/urlParsers.d.ts +18 -0
  74. package/dist/hooks/urlParsers.d.ts.map +1 -0
  75. package/dist/hooks/urlParsers.js +44 -0
  76. package/dist/hooks/useColorBy.d.ts +5 -0
  77. package/dist/hooks/useColorBy.d.ts.map +1 -0
  78. package/dist/hooks/useColorBy.js +63 -0
  79. package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
  80. package/dist/hooks/useCompareModeMeta.js +94 -138
  81. package/dist/hooks/useDashboardItems.d.ts +5 -0
  82. package/dist/hooks/useDashboardItems.d.ts.map +1 -0
  83. package/dist/hooks/useDashboardItems.js +68 -0
  84. package/dist/hooks/useQueryState.d.ts +4 -4
  85. package/dist/hooks/useQueryState.d.ts.map +1 -1
  86. package/dist/hooks/useQueryState.js +127 -122
  87. package/dist/index.d.ts +3 -2
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +3 -12
  90. package/dist/useQuery.js +2 -1
  91. package/dist/useSumBy.d.ts +1 -1
  92. package/dist/useSumBy.d.ts.map +1 -1
  93. package/dist/useSumBy.js +2 -2
  94. package/package.json +4 -3
  95. package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +11 -13
  96. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +11 -9
  97. package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
  98. package/src/ProfileFlameChart/index.tsx +21 -28
  99. package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +10 -9
  100. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +5 -3
  101. package/src/ProfileFlameGraph/index.tsx +6 -9
  102. package/src/ProfileMetricsGraph/index.tsx +6 -8
  103. package/src/ProfileSelector/MetricsGraphSection.tsx +5 -10
  104. package/src/ProfileSelector/index.tsx +33 -33
  105. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  106. package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +10 -6
  107. package/src/ProfileView/components/ColorStackLegend.tsx +2 -4
  108. package/src/ProfileView/components/InvertCallStack/index.tsx +5 -4
  109. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +94 -192
  110. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
  111. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +24 -25
  112. package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +4 -5
  113. package/src/ProfileView/components/Toolbars/index.tsx +3 -3
  114. package/src/ProfileView/components/ViewSelector/index.tsx +9 -16
  115. package/src/ProfileView/context/DashboardContext.tsx +6 -6
  116. package/src/ProfileView/hooks/useResetFlameGraphState.ts +6 -4
  117. package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +24 -26
  118. package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +16 -8
  119. package/src/ProfileView/hooks/useVisualizationState.ts +61 -69
  120. package/src/ProfileViewWithData.tsx +29 -35
  121. package/src/Sandwich/index.tsx +4 -3
  122. package/src/SourceView/index.tsx +4 -2
  123. package/src/SourceView/useSelectedLineRange.ts +34 -19
  124. package/src/Table/MoreDropdown.tsx +9 -11
  125. package/src/Table/TableContextMenu.tsx +10 -13
  126. package/src/Table/hooks/useTableConfiguration.tsx +3 -4
  127. package/src/Table/index.tsx +12 -21
  128. package/src/TopTable/index.tsx +3 -4
  129. package/src/hooks/urlParsers.ts +38 -0
  130. package/src/hooks/useColorBy.ts +42 -0
  131. package/src/hooks/useCompareModeMeta.ts +61 -91
  132. package/src/hooks/useDashboardItems.ts +46 -0
  133. package/src/hooks/useQueryState.test.tsx +275 -345
  134. package/src/hooks/useQueryState.ts +153 -120
  135. package/src/index.tsx +16 -15
  136. package/src/useQuery.tsx +1 -1
  137. package/src/useSumBy.ts +3 -3
@@ -2,7 +2,7 @@ import { CurrentPathFrame } from '../../ProfileFlameGraph/FlameGraphArrow/utils'
2
2
  export declare const useVisualizationState: () => {
3
3
  curPathArrow: CurrentPathFrame[];
4
4
  setCurPathArrow: (path: CurrentPathFrame[]) => void;
5
- colorStackLegend: string | undefined;
5
+ colorStackLegend: string | null;
6
6
  colorBy: string;
7
7
  setColorBy: (colorBy: string) => void;
8
8
  groupBy: string[];
@@ -11,8 +11,8 @@ export declare const useVisualizationState: () => {
11
11
  setGroupByLabels: (labels: string[]) => void;
12
12
  flamechartDimension: string[];
13
13
  setFlamechartDimension: (labels: string[]) => void;
14
- sandwichFunctionName: string | undefined;
15
- setSandwichFunctionName: (sandwichFunctionName: string | undefined) => void;
14
+ sandwichFunctionName: string | null;
15
+ setSandwichFunctionName: (sandwichFunctionName: string | null) => void;
16
16
  resetSandwichFunctionName: () => void;
17
17
  alignFunctionName: string;
18
18
  setAlignFunctionName: (align: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useVisualizationState.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useVisualizationState.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAC,gBAAgB,EAAC,MAAM,+CAA+C,CAAC;AAG/E,eAAO,MAAM,qBAAqB,QAAO;IACvC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IACpD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,uBAAuB,EAAE,CAAC,oBAAoB,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5E,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAgI/C,CAAC"}
1
+ {"version":3,"file":"useVisualizationState.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useVisualizationState.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAC,gBAAgB,EAAC,MAAM,+CAA+C,CAAC;AAU/E,eAAO,MAAM,qBAAqB,QAAO;IACvC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,eAAe,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IACpD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,uBAAuB,EAAE,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvE,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAsH/C,CAAC"}
@@ -23,100 +23,90 @@ import { c as _c } from "react-compiler-runtime";
23
23
  // limitations under the License.
24
24
 
25
25
  import { useCallback, useMemo } from 'react';
26
- import { JSONParser, JSONSerializer, useURLState, useURLStateBatch, useURLStateCustom } from '@parca/components';
26
+ import { useQueryState } from 'nuqs';
27
27
  import { USER_PREFERENCES, useUserPreference } from '@parca/hooks';
28
28
  import { FIELD_FUNCTION_FILE_NAME, FIELD_FUNCTION_NAME, FIELD_LABELS, FIELD_LOCATION_ADDRESS, FIELD_MAPPING_FILE } from '../../ProfileFlameGraph/FlameGraphArrow';
29
+ import { flamechartDimensionParser, groupByParser, jsonParser, stringParam } from '../../hooks/urlParsers';
30
+ import { useColorBy } from '../../hooks/useColorBy';
29
31
  import { useResetFlameGraphState } from './useResetFlameGraphState';
30
32
  export var useVisualizationState = function useVisualizationState() {
31
- var _ref, _ref2;
32
- var $ = _c(47);
33
- var _useUserPreference = useUserPreference(USER_PREFERENCES.COLOR_BY.key),
33
+ var _ref;
34
+ var $ = _c(42);
35
+ var _useUserPreference = useUserPreference(USER_PREFERENCES.ALIGN_FUNCTION_NAME.key),
34
36
  _useUserPreference2 = _slicedToArray(_useUserPreference, 2),
35
- colorByPreference = _useUserPreference2[0],
36
- setColorByPreference = _useUserPreference2[1];
37
- var _useUserPreference3 = useUserPreference(USER_PREFERENCES.ALIGN_FUNCTION_NAME.key),
38
- _useUserPreference4 = _slicedToArray(_useUserPreference3, 2),
39
- alignFunctionNamePreference = _useUserPreference4[0],
40
- setAlignFunctionNamePreference = _useUserPreference4[1];
37
+ alignFunctionNamePreference = _useUserPreference2[0],
38
+ setAlignFunctionNamePreference = _useUserPreference2[1];
41
39
  var t0;
42
40
  if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
43
- t0 = {
44
- parse: JSONParser,
45
- stringify: JSONSerializer,
46
- defaultValue: "[]"
47
- };
41
+ t0 = jsonParser().withDefault([]);
48
42
  $[0] = t0;
49
43
  } else {
50
44
  t0 = $[0];
51
45
  }
52
- var _useURLStateCustom = useURLStateCustom("cur_path", t0),
53
- _useURLStateCustom2 = _slicedToArray(_useURLStateCustom, 2),
54
- curPathArrow = _useURLStateCustom2[0],
55
- setCurPathArrow = _useURLStateCustom2[1];
56
- var _useURLState = useURLState("color_stack_legend"),
57
- _useURLState2 = _slicedToArray(_useURLState, 1),
58
- colorStackLegend = _useURLState2[0];
46
+ var _useQueryState = useQueryState("cur_path", t0),
47
+ _useQueryState2 = _slicedToArray(_useQueryState, 2),
48
+ curPathArrow = _useQueryState2[0],
49
+ setRawCurPathArrow = _useQueryState2[1];
59
50
  var t1;
60
- if ($[1] !== colorByPreference) {
61
- t1 = {
62
- defaultValue: colorByPreference
51
+ if ($[1] !== setRawCurPathArrow) {
52
+ t1 = function t1(path) {
53
+ setRawCurPathArrow(path);
63
54
  };
64
- $[1] = colorByPreference;
55
+ $[1] = setRawCurPathArrow;
65
56
  $[2] = t1;
66
57
  } else {
67
58
  t1 = $[2];
68
59
  }
69
- var _useURLState3 = useURLState("color_by", t1),
70
- _useURLState4 = _slicedToArray(_useURLState3, 2),
71
- colorBy = _useURLState4[0],
72
- setStoreColorBy = _useURLState4[1];
60
+ var setCurPathArrow = t1;
61
+ var _useQueryState3 = useQueryState("color_stack_legend", stringParam),
62
+ _useQueryState4 = _slicedToArray(_useQueryState3, 1),
63
+ colorStackLegend = _useQueryState4[0];
64
+ var _useColorBy = useColorBy(),
65
+ colorBy = _useColorBy.colorBy,
66
+ setColorBy = _useColorBy.setColorBy;
67
+ var _useQueryState5 = useQueryState("align_function_name", stringParam),
68
+ _useQueryState6 = _slicedToArray(_useQueryState5, 2),
69
+ alignFunctionNameRaw = _useQueryState6[0],
70
+ setStoreAlignFunctionName = _useQueryState6[1];
71
+ var alignFunctionName = (_ref = alignFunctionNameRaw !== null && alignFunctionNameRaw !== void 0 ? alignFunctionNameRaw : alignFunctionNamePreference) !== null && _ref !== void 0 ? _ref : "left";
73
72
  var t2;
74
- if ($[3] !== alignFunctionNamePreference) {
75
- t2 = {
76
- defaultValue: alignFunctionNamePreference
77
- };
78
- $[3] = alignFunctionNamePreference;
79
- $[4] = t2;
73
+ if ($[3] === Symbol["for"]("react.memo_cache_sentinel")) {
74
+ t2 = groupByParser.withDefault([FIELD_FUNCTION_NAME]);
75
+ $[3] = t2;
80
76
  } else {
81
- t2 = $[4];
77
+ t2 = $[3];
82
78
  }
83
- var _useURLState5 = useURLState("align_function_name", t2),
84
- _useURLState6 = _slicedToArray(_useURLState5, 2),
85
- alignFunctionName = _useURLState6[0],
86
- setStoreAlignFunctionName = _useURLState6[1];
79
+ var _useQueryState7 = useQueryState("group_by", t2),
80
+ _useQueryState8 = _slicedToArray(_useQueryState7, 2),
81
+ groupBy = _useQueryState8[0],
82
+ setStoreGroupBy = _useQueryState8[1];
83
+ var _useQueryState9 = useQueryState("sandwich_function_name", stringParam),
84
+ _useQueryState0 = _slicedToArray(_useQueryState9, 2),
85
+ sandwichFunctionName = _useQueryState0[0],
86
+ setRawSandwichFunctionName = _useQueryState0[1];
87
87
  var t3;
88
- if ($[5] === Symbol["for"]("react.memo_cache_sentinel")) {
89
- t3 = {
90
- defaultValue: [FIELD_FUNCTION_NAME],
91
- alwaysReturnArray: true
88
+ if ($[4] !== setRawSandwichFunctionName) {
89
+ t3 = function t3(name) {
90
+ setRawSandwichFunctionName(name);
92
91
  };
92
+ $[4] = setRawSandwichFunctionName;
93
93
  $[5] = t3;
94
94
  } else {
95
95
  t3 = $[5];
96
96
  }
97
- var _useURLState7 = useURLState("group_by", t3),
98
- _useURLState8 = _slicedToArray(_useURLState7, 2),
99
- groupBy = _useURLState8[0],
100
- setStoreGroupBy = _useURLState8[1];
101
- var _useURLState9 = useURLState("sandwich_function_name"),
102
- _useURLState0 = _slicedToArray(_useURLState9, 2),
103
- sandwichFunctionName = _useURLState0[0],
104
- setSandwichFunctionName = _useURLState0[1];
97
+ var setSandwichFunctionName = t3;
105
98
  var t4;
106
99
  if ($[6] === Symbol["for"]("react.memo_cache_sentinel")) {
107
- t4 = {
108
- alwaysReturnArray: true
109
- };
100
+ t4 = flamechartDimensionParser.withDefault([]);
110
101
  $[6] = t4;
111
102
  } else {
112
103
  t4 = $[6];
113
104
  }
114
- var _useURLState1 = useURLState("flamechart_dimension", t4),
115
- _useURLState10 = _slicedToArray(_useURLState1, 2),
116
- flamechartDimension = _useURLState10[0],
117
- setStoreFlamechartDimension = _useURLState10[1];
105
+ var _useQueryState1 = useQueryState("flamechart_dimension", t4),
106
+ _useQueryState10 = _slicedToArray(_useQueryState1, 2),
107
+ flamechartDimension = _useQueryState10[0],
108
+ setStoreFlamechartDimension = _useQueryState10[1];
118
109
  var resetFlameGraphState = useResetFlameGraphState();
119
- var batchUpdates = useURLStateBatch();
120
110
  var t5;
121
111
  if ($[7] === Symbol["for"]("react.memo_cache_sentinel")) {
122
112
  t5 = [FIELD_FUNCTION_NAME, FIELD_FUNCTION_FILE_NAME, FIELD_LOCATION_ADDRESS, FIELD_MAPPING_FILE];
@@ -137,105 +127,84 @@ export var useVisualizationState = function useVisualizationState() {
137
127
  }
138
128
  var setGroupBy = t6;
139
129
  var t7;
140
- if ($[10] !== batchUpdates || $[11] !== groupBy || $[12] !== resetFlameGraphState || $[13] !== setGroupBy) {
130
+ if ($[10] !== groupBy || $[11] !== resetFlameGraphState || $[12] !== setGroupBy) {
141
131
  t7 = function t7(key) {
142
- batchUpdates(function () {
143
- if (groupBy.includes(key)) {
144
- setGroupBy(groupBy.filter(function (v) {
145
- return v !== key;
146
- }));
147
- } else {
148
- var filteredGroupBy = groupBy.filter(function (item) {
149
- return !levelsOfProfiling.includes(item);
150
- });
151
- setGroupBy([].concat(_toConsumableArray(filteredGroupBy), [key]));
152
- }
153
- resetFlameGraphState();
154
- });
132
+ if (groupBy.includes(key)) {
133
+ setGroupBy(groupBy.filter(function (v) {
134
+ return v !== key;
135
+ }));
136
+ } else {
137
+ var filteredGroupBy = groupBy.filter(function (item) {
138
+ return !levelsOfProfiling.includes(item);
139
+ });
140
+ setGroupBy([].concat(_toConsumableArray(filteredGroupBy), [key]));
141
+ }
142
+ resetFlameGraphState();
155
143
  };
156
- $[10] = batchUpdates;
157
- $[11] = groupBy;
158
- $[12] = resetFlameGraphState;
159
- $[13] = setGroupBy;
160
- $[14] = t7;
144
+ $[10] = groupBy;
145
+ $[11] = resetFlameGraphState;
146
+ $[12] = setGroupBy;
147
+ $[13] = t7;
161
148
  } else {
162
- t7 = $[14];
149
+ t7 = $[13];
163
150
  }
164
151
  var toggleGroupBy = t7;
165
152
  var t8;
166
- if ($[15] !== batchUpdates || $[16] !== groupBy || $[17] !== resetFlameGraphState || $[18] !== setGroupBy) {
153
+ if ($[14] !== groupBy || $[15] !== resetFlameGraphState || $[16] !== setGroupBy) {
167
154
  t8 = function t8(labels) {
168
- batchUpdates(function () {
169
- setGroupBy(groupBy.filter(_temp).concat(labels));
170
- resetFlameGraphState();
171
- });
155
+ setGroupBy(groupBy.filter(_temp).concat(labels));
156
+ resetFlameGraphState();
172
157
  };
173
- $[15] = batchUpdates;
174
- $[16] = groupBy;
175
- $[17] = resetFlameGraphState;
176
- $[18] = setGroupBy;
177
- $[19] = t8;
158
+ $[14] = groupBy;
159
+ $[15] = resetFlameGraphState;
160
+ $[16] = setGroupBy;
161
+ $[17] = t8;
178
162
  } else {
179
- t8 = $[19];
163
+ t8 = $[17];
180
164
  }
181
165
  var setGroupByLabels = t8;
182
166
  var t9;
183
- if ($[20] !== setStoreFlamechartDimension) {
167
+ if ($[18] !== setStoreFlamechartDimension) {
184
168
  t9 = function t9(labels_0) {
185
169
  setStoreFlamechartDimension(labels_0.filter(_temp2));
186
170
  };
187
- $[20] = setStoreFlamechartDimension;
188
- $[21] = t9;
171
+ $[18] = setStoreFlamechartDimension;
172
+ $[19] = t9;
189
173
  } else {
190
- t9 = $[21];
174
+ t9 = $[19];
191
175
  }
192
176
  var setFlamechartDimension = t9;
193
177
  var t10;
194
- if ($[22] !== setSandwichFunctionName) {
178
+ if ($[20] !== setSandwichFunctionName) {
195
179
  t10 = function t10() {
196
- setSandwichFunctionName(undefined);
180
+ setSandwichFunctionName(null);
197
181
  };
198
- $[22] = setSandwichFunctionName;
199
- $[23] = t10;
182
+ $[20] = setSandwichFunctionName;
183
+ $[21] = t10;
200
184
  } else {
201
- t10 = $[23];
185
+ t10 = $[21];
202
186
  }
203
187
  var resetSandwichFunctionName = t10;
204
188
  var t11;
205
- if ($[24] !== setColorByPreference || $[25] !== setStoreColorBy) {
189
+ if ($[22] !== setAlignFunctionNamePreference || $[23] !== setStoreAlignFunctionName) {
206
190
  t11 = function t11(value) {
207
- setStoreColorBy(value);
208
- setColorByPreference(value);
191
+ setStoreAlignFunctionName(value);
192
+ setAlignFunctionNamePreference(value);
209
193
  };
210
- $[24] = setColorByPreference;
211
- $[25] = setStoreColorBy;
212
- $[26] = t11;
194
+ $[22] = setAlignFunctionNamePreference;
195
+ $[23] = setStoreAlignFunctionName;
196
+ $[24] = t11;
213
197
  } else {
214
- t11 = $[26];
198
+ t11 = $[24];
215
199
  }
216
- var setColorBy = t11;
200
+ var setAlignFunctionName = t11;
217
201
  var t12;
218
- if ($[27] !== setAlignFunctionNamePreference || $[28] !== setStoreAlignFunctionName) {
219
- t12 = function t12(value_0) {
220
- setStoreAlignFunctionName(value_0);
221
- setAlignFunctionNamePreference(value_0);
222
- };
223
- $[27] = setAlignFunctionNamePreference;
224
- $[28] = setStoreAlignFunctionName;
225
- $[29] = t12;
226
- } else {
227
- t12 = $[29];
228
- }
229
- var setAlignFunctionName = t12;
230
- var t13 = (_ref = colorBy) !== null && _ref !== void 0 ? _ref : "";
231
- var t14 = (_ref2 = alignFunctionName) !== null && _ref2 !== void 0 ? _ref2 : "left";
232
- var t15;
233
- if ($[30] !== colorStackLegend || $[31] !== curPathArrow || $[32] !== flamechartDimension || $[33] !== groupBy || $[34] !== resetSandwichFunctionName || $[35] !== sandwichFunctionName || $[36] !== setAlignFunctionName || $[37] !== setColorBy || $[38] !== setCurPathArrow || $[39] !== setFlamechartDimension || $[40] !== setGroupBy || $[41] !== setGroupByLabels || $[42] !== setSandwichFunctionName || $[43] !== t13 || $[44] !== t14 || $[45] !== toggleGroupBy) {
234
- t15 = {
202
+ if ($[25] !== alignFunctionName || $[26] !== colorBy || $[27] !== colorStackLegend || $[28] !== curPathArrow || $[29] !== flamechartDimension || $[30] !== groupBy || $[31] !== resetSandwichFunctionName || $[32] !== sandwichFunctionName || $[33] !== setAlignFunctionName || $[34] !== setColorBy || $[35] !== setCurPathArrow || $[36] !== setFlamechartDimension || $[37] !== setGroupBy || $[38] !== setGroupByLabels || $[39] !== setSandwichFunctionName || $[40] !== toggleGroupBy) {
203
+ t12 = {
235
204
  curPathArrow: curPathArrow,
236
205
  setCurPathArrow: setCurPathArrow,
237
206
  colorStackLegend: colorStackLegend,
238
- colorBy: t13,
207
+ colorBy: colorBy,
239
208
  setColorBy: setColorBy,
240
209
  groupBy: groupBy,
241
210
  setGroupBy: setGroupBy,
@@ -246,30 +215,30 @@ export var useVisualizationState = function useVisualizationState() {
246
215
  sandwichFunctionName: sandwichFunctionName,
247
216
  setSandwichFunctionName: setSandwichFunctionName,
248
217
  resetSandwichFunctionName: resetSandwichFunctionName,
249
- alignFunctionName: t14,
218
+ alignFunctionName: alignFunctionName,
250
219
  setAlignFunctionName: setAlignFunctionName
251
220
  };
252
- $[30] = colorStackLegend;
253
- $[31] = curPathArrow;
254
- $[32] = flamechartDimension;
255
- $[33] = groupBy;
256
- $[34] = resetSandwichFunctionName;
257
- $[35] = sandwichFunctionName;
258
- $[36] = setAlignFunctionName;
259
- $[37] = setColorBy;
260
- $[38] = setCurPathArrow;
261
- $[39] = setFlamechartDimension;
262
- $[40] = setGroupBy;
263
- $[41] = setGroupByLabels;
264
- $[42] = setSandwichFunctionName;
265
- $[43] = t13;
266
- $[44] = t14;
267
- $[45] = toggleGroupBy;
268
- $[46] = t15;
221
+ $[25] = alignFunctionName;
222
+ $[26] = colorBy;
223
+ $[27] = colorStackLegend;
224
+ $[28] = curPathArrow;
225
+ $[29] = flamechartDimension;
226
+ $[30] = groupBy;
227
+ $[31] = resetSandwichFunctionName;
228
+ $[32] = sandwichFunctionName;
229
+ $[33] = setAlignFunctionName;
230
+ $[34] = setColorBy;
231
+ $[35] = setCurPathArrow;
232
+ $[36] = setFlamechartDimension;
233
+ $[37] = setGroupBy;
234
+ $[38] = setGroupByLabels;
235
+ $[39] = setSandwichFunctionName;
236
+ $[40] = toggleGroupBy;
237
+ $[41] = t12;
269
238
  } else {
270
- t15 = $[46];
239
+ t12 = $[41];
271
240
  }
272
- return t15;
241
+ return t12;
273
242
  };
274
243
  function _temp(l) {
275
244
  return !l.startsWith("".concat(FIELD_LABELS, "."));
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAkB1E,OAAO,EAAsB,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAOnE,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,mBAAmB,GAAI,sFAKjC,wBAAwB,KAAG,GAAG,CAAC,OA4UjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAW1E,OAAO,EAAsB,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAenE,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,mBAAmB,GAAI,sFAKjC,wBAAwB,KAAG,GAAG,CAAC,OAmUjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -22,8 +22,9 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
22
22
  // limitations under the License.
23
23
 
24
24
  import { useEffect, useMemo, useState } from 'react';
25
+ import { useQueryState } from 'nuqs';
25
26
  import { QueryRequest_ReportType } from '@parca/client';
26
- import { NumberParser, NumberSerializer, useGrpcMetadata, useParcaContext, useURLState, useURLStateCustom } from '@parca/components';
27
+ import { useGrpcMetadata, useParcaContext } from '@parca/components';
27
28
  import { saveAsBlob } from '@parca/utilities';
28
29
  import { validateFlameChartQuery } from './ProfileFlameGraph';
29
30
  import { FIELD_FUNCTION_NAME } from './ProfileFlameGraph/FlameGraphArrow';
@@ -31,6 +32,8 @@ import { boundsFromProfileSource } from './ProfileFlameGraph/FlameGraphArrow/uti
31
32
  import { getStepCountFromScreenWidth, useQueryRange } from './ProfileMetricsGraph/hooks/useQueryRange';
32
33
  import { ProfileView } from './ProfileView';
33
34
  import { useProfileFilters } from './ProfileView/components/ProfileFilters/useProfileFilters';
35
+ import { flamechartDimensionParser, groupByParser, intParam, invertCallStackParser, stringParam } from './hooks/urlParsers';
36
+ import { useDashboardItems } from './hooks/useDashboardItems';
34
37
  import { useQuery } from './useQuery';
35
38
  import { downloadPprof } from './utils';
36
39
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -41,36 +44,27 @@ export var ProfileViewWithData = function ProfileViewWithData(_ref) {
41
44
  showVisualizationSelector = _ref.showVisualizationSelector,
42
45
  onSwitchToFifteenMinutes = _ref.onSwitchToFifteenMinutes;
43
46
  var metadata = useGrpcMetadata();
44
- var _useURLState = useURLState('dashboard_items', {
45
- alwaysReturnArray: true
46
- }),
47
- _useURLState2 = _slicedToArray(_useURLState, 2),
48
- dashboardItems = _useURLState2[0],
49
- setDashboardItems = _useURLState2[1];
50
- var _useURLState3 = useURLState('source_buildid'),
51
- _useURLState4 = _slicedToArray(_useURLState3, 1),
52
- sourceBuildID = _useURLState4[0];
53
- var _useURLState5 = useURLState('source_filename'),
54
- _useURLState6 = _slicedToArray(_useURLState5, 1),
55
- sourceFilename = _useURLState6[0];
56
- var _useURLState7 = useURLState('group_by', {
57
- defaultValue: [FIELD_FUNCTION_NAME],
58
- alwaysReturnArray: true
59
- }),
60
- _useURLState8 = _slicedToArray(_useURLState7, 1),
61
- groupBy = _useURLState8[0];
62
- var _useURLState9 = useURLState('sandwich_function_name'),
63
- _useURLState0 = _slicedToArray(_useURLState9, 1),
64
- sandwichFunctionName = _useURLState0[0];
65
- var _useURLState1 = useURLState('flamechart_dimension', {
66
- alwaysReturnArray: true
67
- }),
68
- _useURLState10 = _slicedToArray(_useURLState1, 1),
69
- flamechartDimension = _useURLState10[0];
70
- var _useURLState11 = useURLState('invert_call_stack'),
71
- _useURLState12 = _slicedToArray(_useURLState11, 1),
72
- invertStack = _useURLState12[0];
73
- var invertCallStack = invertStack === 'true';
47
+ var _useDashboardItems = useDashboardItems(),
48
+ dashboardItems = _useDashboardItems.dashboardItems,
49
+ setDashboardItems = _useDashboardItems.setDashboardItems;
50
+ var _useQueryState = useQueryState('source_buildid', stringParam),
51
+ _useQueryState2 = _slicedToArray(_useQueryState, 1),
52
+ sourceBuildID = _useQueryState2[0];
53
+ var _useQueryState3 = useQueryState('source_filename', stringParam),
54
+ _useQueryState4 = _slicedToArray(_useQueryState3, 1),
55
+ sourceFilename = _useQueryState4[0];
56
+ var _useQueryState5 = useQueryState('group_by', groupByParser.withDefault([FIELD_FUNCTION_NAME])),
57
+ _useQueryState6 = _slicedToArray(_useQueryState5, 1),
58
+ groupBy = _useQueryState6[0];
59
+ var _useQueryState7 = useQueryState('sandwich_function_name', stringParam),
60
+ _useQueryState8 = _slicedToArray(_useQueryState7, 1),
61
+ sandwichFunctionName = _useQueryState8[0];
62
+ var _useQueryState9 = useQueryState('flamechart_dimension', flamechartDimensionParser),
63
+ _useQueryState0 = _slicedToArray(_useQueryState9, 1),
64
+ flamechartDimension = _useQueryState0[0];
65
+ var _useQueryState1 = useQueryState('invert_call_stack', invertCallStackParser),
66
+ _useQueryState10 = _slicedToArray(_useQueryState1, 1),
67
+ invertCallStack = _useQueryState10[0];
74
68
  var _useState = useState(false),
75
69
  _useState2 = _slicedToArray(_useState, 2),
76
70
  pprofDownloading = _useState2[0],
@@ -109,7 +103,7 @@ export var ProfileViewWithData = function ProfileViewWithData(_ref) {
109
103
  skip: !dashboardItems.includes('flamegraph'),
110
104
  nodeTrimThreshold: nodeTrimThreshold,
111
105
  groupBy: groupBy,
112
- invertCallStack: invertCallStack,
106
+ invertCallStack: invertCallStack !== null && invertCallStack !== void 0 ? invertCallStack : false,
113
107
  protoFilters: protoFilters
114
108
  }),
115
109
  flamegraphLoading = _useQuery.isLoading,
@@ -130,13 +124,9 @@ export var ProfileViewWithData = function ProfileViewWithData(_ref) {
130
124
  }, [flamechartDimension]);
131
125
 
132
126
  // Samples step count: 2px per data point for finer granularity in strips
133
- var _useURLStateCustom = useURLStateCustom('samples_step_count', {
134
- defaultValue: String(getStepCountFromScreenWidth(2)),
135
- parse: NumberParser,
136
- stringify: NumberSerializer
137
- }),
138
- _useURLStateCustom2 = _slicedToArray(_useURLStateCustom, 1),
139
- samplesStepCount = _useURLStateCustom2[0];
127
+ var _useQueryState11 = useQueryState('samples_step_count', intParam.withDefault(getStepCountFromScreenWidth(2))),
128
+ _useQueryState12 = _slicedToArray(_useQueryState11, 1),
129
+ samplesStepCount = _useQueryState12[0];
140
130
  var _useQueryRange = useQueryRange(queryClient, samplesEnabled ? profileSource.query.toString() : '', samplesFromMs, samplesToMs, samplesSumBy, samplesStepCount, !samplesEnabled),
141
131
  samplesLoading = _useQueryRange.isLoading,
142
132
  samplesRangeResponse = _useQueryRange.response,
@@ -202,8 +192,8 @@ export var ProfileViewWithData = function ProfileViewWithData(_ref) {
202
192
  tableError = _useQuery3.error;
203
193
  var _useQuery4 = useQuery(queryClient, profileSource, QueryRequest_ReportType.SOURCE, {
204
194
  skip: !dashboardItems.includes('source'),
205
- sourceBuildID: sourceBuildID,
206
- sourceFilename: sourceFilename,
195
+ sourceBuildID: sourceBuildID !== null && sourceBuildID !== void 0 ? sourceBuildID : undefined,
196
+ sourceFilename: sourceFilename !== null && sourceFilename !== void 0 ? sourceFilename : undefined,
207
197
  protoFilters: protoFilters
208
198
  }),
209
199
  sourceLoading = _useQuery4.isLoading,
@@ -213,8 +203,8 @@ export var ProfileViewWithData = function ProfileViewWithData(_ref) {
213
203
  nodeTrimThreshold: nodeTrimThreshold,
214
204
  groupBy: [FIELD_FUNCTION_NAME],
215
205
  invertCallStack: true,
216
- sandwichByFunction: sandwichFunctionName,
217
- skip: sandwichFunctionName === undefined && !dashboardItems.includes('sandwich'),
206
+ sandwichByFunction: sandwichFunctionName !== null && sandwichFunctionName !== void 0 ? sandwichFunctionName : undefined,
207
+ skip: sandwichFunctionName == null && !dashboardItems.includes('sandwich'),
218
208
  protoFilters: protoFilters
219
209
  }),
220
210
  callersFlamegraphLoading = _useQuery5.isLoading,
@@ -224,8 +214,8 @@ export var ProfileViewWithData = function ProfileViewWithData(_ref) {
224
214
  nodeTrimThreshold: nodeTrimThreshold,
225
215
  groupBy: [FIELD_FUNCTION_NAME],
226
216
  invertCallStack: false,
227
- sandwichByFunction: sandwichFunctionName,
228
- skip: sandwichFunctionName === undefined && !dashboardItems.includes('sandwich'),
217
+ sandwichByFunction: sandwichFunctionName !== null && sandwichFunctionName !== void 0 ? sandwichFunctionName : undefined,
218
+ skip: sandwichFunctionName == null && !dashboardItems.includes('sandwich'),
229
219
  protoFilters: protoFilters
230
220
  }),
231
221
  calleesFlamegraphLoading = _useQuery6.isLoading,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Sandwich/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAO9C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAC,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAIhE,UAAU,KAAK;IACb,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,QAAA,MAAM,QAAQ,mCAuEZ,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Sandwich/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAO9C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAC,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAKhE,UAAU,KAAK;IACb,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,QAAA,MAAM,QAAQ,mCAuEZ,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -26,10 +26,11 @@ import { c as _c } from "react-compiler-runtime";
26
26
 
27
27
  import React, { useRef, useState } from 'react';
28
28
  import { AnimatePresence, motion } from 'framer-motion';
29
- import { useURLState } from '@parca/components';
29
+ import { useQueryState } from 'nuqs';
30
30
  import { TEST_IDS, testId } from '@parca/test-utils';
31
31
  import { useDashboard } from '../ProfileView/context/DashboardContext';
32
32
  import { useVisualizationState } from '../ProfileView/hooks/useVisualizationState';
33
+ import { stringParam } from '../hooks/urlParsers';
33
34
  import { CalleesSection } from './components/CalleesSection';
34
35
  import { CallersSection } from './components/CallersSection';
35
36
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -39,9 +40,9 @@ var Sandwich = /*#__PURE__*/React.memo(function Sandwich(t0) {
39
40
  profileSource = t0.profileSource;
40
41
  var _useDashboard = useDashboard(),
41
42
  dashboardItems = _useDashboard.dashboardItems;
42
- var _useURLState = useURLState("sandwich_function_name"),
43
- _useURLState2 = _slicedToArray(_useURLState, 1),
44
- sandwichFunctionName = _useURLState2[0];
43
+ var _useQueryState = useQueryState("sandwich_function_name", stringParam),
44
+ _useQueryState2 = _slicedToArray(_useQueryState, 1),
45
+ sandwichFunctionName = _useQueryState2[0];
45
46
  var callersRef = React.useRef(null);
46
47
  var calleesRef = React.useRef(null);
47
48
  var _useState = useState(false),
@@ -95,7 +96,7 @@ var Sandwich = /*#__PURE__*/React.memo(function Sandwich(t0) {
95
96
  transition: t4,
96
97
  children: /*#__PURE__*/_jsx("div", {
97
98
  className: "relative flex flex-row",
98
- children: sandwichFunctionName !== undefined ? /*#__PURE__*/_jsxs("div", {
99
+ children: sandwichFunctionName != null ? /*#__PURE__*/_jsxs("div", {
99
100
  className: "w-full flex flex-col",
100
101
  ref: callersCalleesContainerRef,
101
102
  children: [/*#__PURE__*/_jsx(CallersSection, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SourceView/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAM7D,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAQrC,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;CACnD;AAID,eAAO,MAAM,UAAU,6CAqKrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SourceView/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAO7D,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AASrC,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;CACnD;AAID,eAAO,MAAM,UAAU,6CAqKrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -24,9 +24,11 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
24
24
  import React, { useCallback, useEffect, useMemo } from 'react';
25
25
  import { tableFromIPC } from '@uwdata/flechette';
26
26
  import { AnimatePresence, motion } from 'framer-motion';
27
+ import { useQueryState } from 'nuqs';
27
28
  import { Item, Menu, useContextMenu } from 'react-contexify';
28
- import { SourceSkeleton, useParcaContext, useURLState } from '@parca/components';
29
+ import { SourceSkeleton, useParcaContext } from '@parca/components';
29
30
  import { ExpandOnHover } from '../GraphTooltipArrow/ExpandOnHoverValue';
31
+ import { stringParam } from '../hooks/urlParsers';
30
32
  import { alignedUint8Array, truncateStringReverse } from '../utils';
31
33
  import { Highlighter, profileAwareRenderer } from './Highlighter';
32
34
  import useLineRange from './useSelectedLineRange';
@@ -38,9 +40,9 @@ export var SourceView = /*#__PURE__*/React.memo(function SourceView(_ref) {
38
40
  total = _ref.total,
39
41
  filtered = _ref.filtered,
40
42
  setActionButtons = _ref.setActionButtons;
41
- var _useURLState = useURLState('source_filename'),
42
- _useURLState2 = _slicedToArray(_useURLState, 1),
43
- sourceFileName = _useURLState2[0];
43
+ var _useQueryState = useQueryState('source_filename', stringParam),
44
+ _useQueryState2 = _slicedToArray(_useQueryState, 1),
45
+ sourceFileName = _useQueryState2[0];
44
46
  var _useParcaContext = useParcaContext(),
45
47
  isDarkMode = _useParcaContext.isDarkMode,
46
48
  _useParcaContext$sour = _useParcaContext.sourceViewContextMenuItems,
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectedLineRange.d.ts","sourceRoot":"","sources":["../../src/SourceView/useSelectedLineRange.ts"],"names":[],"mappings":"AAiBA,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,QAAA,MAAM,YAAY,QAAO,SAmBxB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"useSelectedLineRange.d.ts","sourceRoot":"","sources":["../../src/SourceView/useSelectedLineRange.ts"],"names":[],"mappings":"AAiCA,UAAU,SAAS;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,QAAA,MAAM,YAAY,QAAO,SAkBxB,CAAC;AAEF,eAAe,YAAY,CAAC"}