@parca/profile 0.19.3 → 0.19.5

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.5](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.4...@parca/profile@0.19.5) (2025-06-20)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.19.4](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.3...@parca/profile@0.19.4) (2025-06-19)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.19.3](https://github.com/parca-dev/parca/compare/@parca/profile@0.19.2...@parca/profile@0.19.3) (2025-06-19)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAMnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAO1C,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,qIAad,gBAAgB,KAAG,GAAG,CAAC,OA6MzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/ProfileIcicleGraph/IcicleGraphArrow/ContextMenu.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAMnC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAO1C,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,qIAad,gBAAgB,KAAG,GAAG,CAAC,OA+MzB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -22,7 +22,7 @@ import { useGraphTooltipMetaInfo } from '../../GraphTooltipArrow/useGraphTooltip
22
22
  import { hexifyAddress, truncateString } from '../../utils';
23
23
  const ContextMenu = ({ menuId, table, total, totalUnfiltered, row, compareAbsolute, hideMenu, profileType, unit, hideBinary, resetPath, isSandwich = false, }) => {
24
24
  const { isDarkMode } = useParcaContext();
25
- const { enableSourcesView, checkDebuginfoStatusHandler } = useParcaContext();
25
+ const { enableSourcesView, enableSandwichView, checkDebuginfoStatusHandler } = useParcaContext();
26
26
  const [isGraphTooltipDocked, setIsDocked] = useUserPreference(USER_PREFERENCES.GRAPH_METAINFO_DOCKED.key);
27
27
  const contextMenuData = useGraphTooltip({
28
28
  table,
@@ -91,9 +91,9 @@ const ContextMenu = ({ menuId, table, total, totalUnfiltered, row, compareAbsolu
91
91
  else {
92
92
  setDashboardItems([...dashboardItems, 'table']);
93
93
  }
94
- }, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:table" }), _jsx("div", { children: "Show in table" })] }) }), _jsx(Item, { id: "show-in-sandwich", onClick: () => {
94
+ }, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:table" }), _jsx("div", { children: "Show in table" })] }) }), enableSandwichView === true && (_jsx(Item, { id: "show-in-sandwich", onClick: () => {
95
95
  setSandwichFunctionName(functionName);
96
96
  setDashboardItems(['sandwich']);
97
- }, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "tdesign:sandwich-filled" }), _jsx("div", { children: "Show in sandwich" })] }) }), _jsx(Item, { id: "reset-view", onClick: handleResetView, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "system-uicons:reset" }), _jsx("div", { children: "Reset graph" })] }) }), _jsxs(Item, { id: "hide-binary", onClick: () => hideBinary(getLastItem(mappingFile)), disabled: mappingFile === null || mappingFile === '', children: [_jsx("div", { "data-tooltip-id": "hide-binary-help", "data-tooltip-content": "Hide all frames for this binary", children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:bxs-hide" }), _jsxs("div", { children: ["Hide binary ", mappingFile !== null && `(${getLastItem(mappingFile)})`] })] }) }), _jsx(Tooltip, { place: "left", id: "hide-binary-help" })] }), _jsx(Submenu, { label: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:copy" }), _jsx("div", { children: "Copy" })] }), children: _jsx("div", { className: "max-h-[300px] overflow-scroll", children: nonEmptyValuesToCopy.map(({ id, value }) => (_jsx(Item, { id: id, onClick: () => handleCopyItem(value), className: "dark:bg-gray-800", children: _jsxs("div", { className: "flex flex-col dark:text-gray-300 hover:dark:text-gray-100", children: [_jsx("div", { className: "text-sm", children: id }), _jsx("div", { className: "text-xs", children: truncateString(value, 30) })] }) }, id))) }) }), checkDebuginfoStatusHandler !== undefined ? (_jsx(Item, { id: "check-debuginfo-status", onClick: () => checkDebuginfoStatusHandler(mappingBuildID), disabled: !isMappingBuildIDAvailable, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:bx-info-circle" }), _jsx("div", { className: "relative pr-4", children: "Check debuginfo status" })] }) })) : null, _jsx(Separator, {}), _jsx(Item, { id: "dock-tooltip", onClick: handleDockTooltip, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:dock-bottom" }), isGraphTooltipDocked ? 'Undock tooltip' : 'Dock tooltip'] }) })] }));
97
+ }, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "tdesign:sandwich-filled" }), _jsx("div", { children: "Show in sandwich" })] }) })), _jsx(Item, { id: "reset-view", onClick: handleResetView, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "system-uicons:reset" }), _jsx("div", { children: "Reset graph" })] }) }), _jsxs(Item, { id: "hide-binary", onClick: () => hideBinary(getLastItem(mappingFile)), disabled: mappingFile === null || mappingFile === '', children: [_jsx("div", { "data-tooltip-id": "hide-binary-help", "data-tooltip-content": "Hide all frames for this binary", children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:bxs-hide" }), _jsxs("div", { children: ["Hide binary ", mappingFile !== null && `(${getLastItem(mappingFile)})`] })] }) }), _jsx(Tooltip, { place: "left", id: "hide-binary-help" })] }), _jsx(Submenu, { label: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "ph:copy" }), _jsx("div", { children: "Copy" })] }), children: _jsx("div", { className: "max-h-[300px] overflow-scroll", children: nonEmptyValuesToCopy.map(({ id, value }) => (_jsx(Item, { id: id, onClick: () => handleCopyItem(value), className: "dark:bg-gray-800", children: _jsxs("div", { className: "flex flex-col dark:text-gray-300 hover:dark:text-gray-100", children: [_jsx("div", { className: "text-sm", children: id }), _jsx("div", { className: "text-xs", children: truncateString(value, 30) })] }) }, id))) }) }), checkDebuginfoStatusHandler !== undefined ? (_jsx(Item, { id: "check-debuginfo-status", onClick: () => checkDebuginfoStatusHandler(mappingBuildID), disabled: !isMappingBuildIDAvailable, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:bx-info-circle" }), _jsx("div", { className: "relative pr-4", children: "Check debuginfo status" })] }) })) : null, _jsx(Separator, {}), _jsx(Item, { id: "dock-tooltip", onClick: handleDockTooltip, children: _jsxs("div", { className: "flex w-full items-center gap-2", children: [_jsx(Icon, { icon: "bx:dock-bottom" }), isGraphTooltipDocked ? 'Undock tooltip' : 'Dock tooltip'] }) })] }));
98
98
  };
99
99
  export default ContextMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAGrD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,YAAY,sBAAqB,KAAK,KAAG,GAAG,CAAC,OAmIlD,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAGrD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,YAAY,sBAAqB,KAAK,KAAG,GAAG,CAAC,OA0IlD,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -6,13 +6,19 @@ const ViewSelector = ({ profileSource }) => {
6
6
  const [dashboardItems = ['icicle'], setDashboardItems] = useURLState('dashboard_items', {
7
7
  alwaysReturnArray: true,
8
8
  });
9
- const { enableSourcesView } = useParcaContext();
9
+ const { enableSourcesView, enableSandwichView } = useParcaContext();
10
10
  const [enableicicleCharts] = useUserPreference(USER_PREFERENCES.ENABLE_ICICLECHARTS.key);
11
11
  const allItems = [
12
12
  { key: 'table', label: 'Table', canBeSelected: !dashboardItems.includes('table') },
13
13
  { key: 'icicle', label: 'icicle', canBeSelected: !dashboardItems.includes('icicle') },
14
- { key: 'sandwich', label: 'sandwich', canBeSelected: !dashboardItems.includes('sandwich') },
15
14
  ];
15
+ if (enableSandwichView === true) {
16
+ allItems.push({
17
+ key: 'sandwich',
18
+ label: 'sandwich',
19
+ canBeSelected: !dashboardItems.includes('sandwich'),
20
+ });
21
+ }
16
22
  if (enableicicleCharts) {
17
23
  allItems.push({
18
24
  key: 'iciclechart',
@@ -1,5 +1,5 @@
1
1
  declare const MoreDropdown: ({ functionName }: {
2
2
  functionName: string;
3
- }) => React.JSX.Element;
3
+ }) => React.JSX.Element | null;
4
4
  export default MoreDropdown;
5
5
  //# sourceMappingURL=MoreDropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MoreDropdown.d.ts","sourceRoot":"","sources":["../../src/Table/MoreDropdown.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,YAAY,qBAAoB;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAsDxE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"MoreDropdown.d.ts","sourceRoot":"","sources":["../../src/Table/MoreDropdown.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,YAAY,qBAAoB;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IA6DlF,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -13,23 +13,28 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
13
13
  // limitations under the License.
14
14
  import { Menu } from '@headlessui/react';
15
15
  import { Icon } from '@iconify/react';
16
- import { useURLState } from '@parca/components';
16
+ import { useParcaContext, useURLState } from '@parca/components';
17
17
  const MoreDropdown = ({ functionName }) => {
18
18
  const [_, setSandwichFunctionName] = useURLState('sandwich_function_name');
19
19
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
20
20
  const [dashboardItems, setDashboardItems] = useURLState('dashboard_items', {
21
21
  alwaysReturnArray: true,
22
22
  });
23
+ const { enableSandwichView } = useParcaContext();
23
24
  const onSandwichViewSelect = () => {
24
25
  setSandwichFunctionName(functionName.trim());
25
26
  setDashboardItems(['sandwich']);
26
27
  };
27
- const menuItems = [
28
- {
28
+ const menuItems = [];
29
+ if (enableSandwichView === true) {
30
+ menuItems.push({
29
31
  label: 'Show in Sandwich view',
30
32
  action: () => onSandwichViewSelect(),
31
- },
32
- ];
33
+ });
34
+ }
35
+ if (menuItems.length === 0) {
36
+ return null;
37
+ }
33
38
  return (_jsx("div", { className: "relative", children: _jsx(Menu, { children: ({ open, close }) => (_jsxs(_Fragment, { children: [_jsx(Menu.Button, { onClick: () => {
34
39
  if (open) {
35
40
  close();
@@ -1 +1 @@
1
- {"version":3,"file":"useTableConfiguration.d.ts","sourceRoot":"","sources":["../../../src/Table/hooks/useTableConfiguration.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAqB,KAAK,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAKxE,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,IAAI,CAAC;AAG5B,OAAO,EAA2B,KAAK,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE7E,UAAU,0BAA0B;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,cAAc,EAAE,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IACnD,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;CAC/C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAS,EACT,KAAK,EACL,QAAQ,EACR,WAAW,GACZ,EAAE,0BAA0B,GAAG,kBAAkB,CAgMjD"}
1
+ {"version":3,"file":"useTableConfiguration.d.ts","sourceRoot":"","sources":["../../../src/Table/hooks/useTableConfiguration.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAqB,KAAK,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAKxE,OAAO,EAAC,KAAK,GAAG,EAAC,MAAM,IAAI,CAAC;AAG5B,OAAO,EAA2B,KAAK,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAE7E,UAAU,0BAA0B;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,cAAc,EAAE,KAAK,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IACnD,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;CAC/C;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAS,EACT,KAAK,EACL,QAAQ,EACR,WAAW,GACZ,EAAE,0BAA0B,GAAG,kBAAkB,CAqMjD"}
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  // limitations under the License.
14
14
  import { useEffect, useMemo, useState } from 'react';
15
15
  import { createColumnHelper } from '@tanstack/table-core';
16
- import { useURLState } from '@parca/components';
16
+ import { useParcaContext, useURLState } from '@parca/components';
17
17
  import { valueFormatter } from '@parca/utilities';
18
18
  import { ColorCell } from '../ColorCell';
19
19
  import MoreDropdown from '../MoreDropdown';
@@ -26,6 +26,7 @@ export function useTableConfiguration({ unit = '', total, filtered, compareMode,
26
26
  const [dashboardItems] = useURLState('dashboard_items', {
27
27
  alwaysReturnArray: true,
28
28
  });
29
+ const { enableSandwichView } = useParcaContext();
29
30
  const [columnVisibility, setColumnVisibility] = useState(() => {
30
31
  return {
31
32
  color: true,
@@ -175,7 +176,9 @@ export function useTableConfiguration({ unit = '', total, filtered, compareMode,
175
176
  cell: info => info.getValue(),
176
177
  }),
177
178
  ];
178
- if (dashboardItems.length === 1 && dashboardItems[0] === 'table') {
179
+ if (dashboardItems.length === 1 &&
180
+ dashboardItems[0] === 'table' &&
181
+ enableSandwichView === true) {
179
182
  baseColumns.unshift(columnHelper.accessor('moreActions', {
180
183
  id: 'moreActions',
181
184
  header: '',
@@ -187,7 +190,7 @@ export function useTableConfiguration({ unit = '', total, filtered, compareMode,
187
190
  }));
188
191
  }
189
192
  return baseColumns;
190
- }, [unit, total, filtered, columnHelper, dashboardItems]);
193
+ }, [unit, total, filtered, columnHelper, dashboardItems, enableSandwichView]);
191
194
  const initialSorting = useMemo(() => {
192
195
  return [
193
196
  {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.19.3",
3
+ "version": "0.19.5",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@headlessui/react": "^1.7.19",
7
7
  "@iconify/react": "^4.0.0",
8
8
  "@parca/client": "0.17.0",
9
- "@parca/components": "0.16.342",
9
+ "@parca/components": "0.16.344",
10
10
  "@parca/dynamicsize": "0.16.65",
11
11
  "@parca/hooks": "0.0.91",
12
12
  "@parca/icons": "0.16.72",
@@ -77,5 +77,5 @@
77
77
  "access": "public",
78
78
  "registry": "https://registry.npmjs.org/"
79
79
  },
80
- "gitHead": "20c7f506dd35795cbc417a5d94c75d72b4128b97"
80
+ "gitHead": "013082ba69d29715e161da70208afe7cfc23f058"
81
81
  }
@@ -55,7 +55,7 @@ const ContextMenu = ({
55
55
  isSandwich = false,
56
56
  }: ContextMenuProps): JSX.Element => {
57
57
  const {isDarkMode} = useParcaContext();
58
- const {enableSourcesView, checkDebuginfoStatusHandler} = useParcaContext();
58
+ const {enableSourcesView, enableSandwichView, checkDebuginfoStatusHandler} = useParcaContext();
59
59
  const [isGraphTooltipDocked, setIsDocked] = useUserPreference<boolean>(
60
60
  USER_PREFERENCES.GRAPH_METAINFO_DOCKED.key
61
61
  );
@@ -177,18 +177,20 @@ const ContextMenu = ({
177
177
  <div>Show in table</div>
178
178
  </div>
179
179
  </Item>
180
- <Item
181
- id="show-in-sandwich"
182
- onClick={() => {
183
- setSandwichFunctionName(functionName);
184
- setDashboardItems(['sandwich']);
185
- }}
186
- >
187
- <div className="flex w-full items-center gap-2">
188
- <Icon icon="tdesign:sandwich-filled" />
189
- <div>Show in sandwich</div>
190
- </div>
191
- </Item>
180
+ {enableSandwichView === true && (
181
+ <Item
182
+ id="show-in-sandwich"
183
+ onClick={() => {
184
+ setSandwichFunctionName(functionName);
185
+ setDashboardItems(['sandwich']);
186
+ }}
187
+ >
188
+ <div className="flex w-full items-center gap-2">
189
+ <Icon icon="tdesign:sandwich-filled" />
190
+ <div>Show in sandwich</div>
191
+ </div>
192
+ </Item>
193
+ )}
192
194
  <Item id="reset-view" onClick={handleResetView}>
193
195
  <div className="flex w-full items-center gap-2">
194
196
  <Icon icon="system-uicons:reset" />
@@ -30,7 +30,7 @@ const ViewSelector = ({profileSource}: Props): JSX.Element => {
30
30
  alwaysReturnArray: true,
31
31
  }
32
32
  );
33
- const {enableSourcesView} = useParcaContext();
33
+ const {enableSourcesView, enableSandwichView} = useParcaContext();
34
34
 
35
35
  const [enableicicleCharts] = useUserPreference<boolean>(USER_PREFERENCES.ENABLE_ICICLECHARTS.key);
36
36
 
@@ -43,8 +43,15 @@ const ViewSelector = ({profileSource}: Props): JSX.Element => {
43
43
  }> = [
44
44
  {key: 'table', label: 'Table', canBeSelected: !dashboardItems.includes('table')},
45
45
  {key: 'icicle', label: 'icicle', canBeSelected: !dashboardItems.includes('icicle')},
46
- {key: 'sandwich', label: 'sandwich', canBeSelected: !dashboardItems.includes('sandwich')},
47
46
  ];
47
+
48
+ if (enableSandwichView === true) {
49
+ allItems.push({
50
+ key: 'sandwich',
51
+ label: 'sandwich',
52
+ canBeSelected: !dashboardItems.includes('sandwich'),
53
+ });
54
+ }
48
55
  if (enableicicleCharts) {
49
56
  allItems.push({
50
57
  key: 'iciclechart',
@@ -14,26 +14,33 @@
14
14
  import {Menu} from '@headlessui/react';
15
15
  import {Icon} from '@iconify/react';
16
16
 
17
- import {useURLState} from '@parca/components';
17
+ import {useParcaContext, useURLState} from '@parca/components';
18
18
 
19
- const MoreDropdown = ({functionName}: {functionName: string}): React.JSX.Element => {
19
+ const MoreDropdown = ({functionName}: {functionName: string}): React.JSX.Element | null => {
20
20
  const [_, setSandwichFunctionName] = useURLState<string | undefined>('sandwich_function_name');
21
21
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
22
  const [dashboardItems, setDashboardItems] = useURLState<string[]>('dashboard_items', {
23
23
  alwaysReturnArray: true,
24
24
  });
25
+ const {enableSandwichView} = useParcaContext();
25
26
 
26
27
  const onSandwichViewSelect = (): void => {
27
28
  setSandwichFunctionName(functionName.trim());
28
29
  setDashboardItems(['sandwich']);
29
30
  };
30
31
 
31
- const menuItems = [
32
- {
32
+ const menuItems: Array<{label: string; action: () => void}> = [];
33
+
34
+ if (enableSandwichView === true) {
35
+ menuItems.push({
33
36
  label: 'Show in Sandwich view',
34
37
  action: () => onSandwichViewSelect(),
35
- },
36
- ];
38
+ });
39
+ }
40
+
41
+ if (menuItems.length === 0) {
42
+ return null;
43
+ }
37
44
 
38
45
  return (
39
46
  <div className="relative">
@@ -15,7 +15,7 @@ import {useEffect, useMemo, useState} from 'react';
15
15
 
16
16
  import {createColumnHelper, type ColumnDef} from '@tanstack/table-core';
17
17
 
18
- import {useURLState} from '@parca/components';
18
+ import {useParcaContext, useURLState} from '@parca/components';
19
19
  import {valueFormatter} from '@parca/utilities';
20
20
 
21
21
  import {type Row} from '..';
@@ -50,6 +50,7 @@ export function useTableConfiguration({
50
50
  const [dashboardItems] = useURLState<string[]>('dashboard_items', {
51
51
  alwaysReturnArray: true,
52
52
  });
53
+ const {enableSandwichView} = useParcaContext();
53
54
 
54
55
  const [columnVisibility, setColumnVisibility] = useState(() => {
55
56
  return {
@@ -203,7 +204,11 @@ export function useTableConfiguration({
203
204
  }),
204
205
  ];
205
206
 
206
- if (dashboardItems.length === 1 && dashboardItems[0] === 'table') {
207
+ if (
208
+ dashboardItems.length === 1 &&
209
+ dashboardItems[0] === 'table' &&
210
+ enableSandwichView === true
211
+ ) {
207
212
  baseColumns.unshift(
208
213
  columnHelper.accessor('moreActions', {
209
214
  id: 'moreActions',
@@ -218,7 +223,7 @@ export function useTableConfiguration({
218
223
  }
219
224
 
220
225
  return baseColumns;
221
- }, [unit, total, filtered, columnHelper, dashboardItems]);
226
+ }, [unit, total, filtered, columnHelper, dashboardItems, enableSandwichView]);
222
227
 
223
228
  const initialSorting = useMemo(() => {
224
229
  return [