@parca/profile 0.16.484 → 0.16.486

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.16.486](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.485...@parca/profile@0.16.486) (2025-03-12)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
10
+ ## [0.16.485](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.484...@parca/profile@0.16.485) (2025-03-05)
11
+
12
+ **Note:** Version bump only for package @parca/profile
13
+
6
14
  ## [0.16.484](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.483...@parca/profile@0.16.484) (2025-03-05)
7
15
 
8
16
  **Note:** Version bump only for package @parca/profile
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAK1E,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAK9C,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,mBAAmB,+DAI7B,wBAAwB,KAAG,GAAG,CAAC,OAoPjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ProfileViewWithData.d.ts","sourceRoot":"","sources":["../src/ProfileViewWithData.tsx"],"names":[],"mappings":"AAeA,OAAO,EAA0B,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAK1E,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAK9C,UAAU,wBAAwB;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,mBAAmB,+DAI7B,wBAAwB,KAAG,GAAG,CAAC,OAmPjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -59,7 +59,7 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
59
59
  invertCallStack,
60
60
  binaryFrameFilter,
61
61
  });
62
- const { isLoading: profileMetadataLoading, response: profileMetadataResponse } = useQuery(queryClient, profileSource, QueryRequest_ReportType.PROFILE_METADATA, {
62
+ const { isLoading: profileMetadataLoading, response: profileMetadataResponse, error: profileMetadataError, } = useQuery(queryClient, profileSource, QueryRequest_ReportType.PROFILE_METADATA, {
63
63
  nodeTrimThreshold,
64
64
  groupBy,
65
65
  });
@@ -150,7 +150,7 @@ export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizat
150
150
  : undefined,
151
151
  total: BigInt(flamegraphResponse?.total ?? '0'),
152
152
  filtered: BigInt(flamegraphResponse?.filtered ?? '0'),
153
- error: flamegraphError,
153
+ error: flamegraphError ?? profileMetadataError,
154
154
  metadataMappingFiles: profileMetadataResponse?.report.oneofKind === 'profileMetadata'
155
155
  ? profileMetadataResponse?.report?.profileMetadata?.mappingFiles
156
156
  : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/SimpleMatchers/Select.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAOzD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,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CAAC;IAChC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8Q7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -14,6 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
14
14
  import { useEffect, useRef, useState } from 'react';
15
15
  import { Icon } from '@iconify/react';
16
16
  import cx from 'classnames';
17
+ import levenshtein from 'fast-levenshtein';
17
18
  import { Button, useParcaContext } from '@parca/components';
18
19
  const CustomSelect = ({ items, selectedKey, onSelection, placeholder = 'Select an item', width, className = '', loading, primary = false, disabled = false, icon, id, optionsClassname = '', searchable = false, onButtonClick, editable = false, }) => {
19
20
  const { loader } = useParcaContext();
@@ -25,10 +26,17 @@ const CustomSelect = ({ items, selectedKey, onSelection, placeholder = 'Select a
25
26
  const searchInputRef = useRef(null);
26
27
  const optionRefs = useRef([]);
27
28
  const filteredItems = searchable
28
- ? items.filter(item => item.element.active.props.children
29
+ ? items
30
+ .filter(item => item.element.active.props.children
29
31
  .toString()
30
32
  .toLowerCase()
31
33
  .includes(searchTerm.toLowerCase()))
34
+ .sort((a, b) => {
35
+ if (searchTerm === '') {
36
+ return a.key.localeCompare(b.key);
37
+ }
38
+ return levenshtein.get(a.key, searchTerm) - levenshtein.get(b.key, searchTerm);
39
+ })
32
40
  : items;
33
41
  const selection = editable ? selectedKey : items.find(v => v.key === selectedKey);
34
42
  useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.484",
3
+ "version": "0.16.486",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@headlessui/react": "^1.7.19",
@@ -22,6 +22,7 @@
22
22
  "@types/d3": "^7.4.3",
23
23
  "@types/d3-scale": "^4.0.8",
24
24
  "@types/d3-selection": "^3.0.10",
25
+ "@types/fast-levenshtein": "^0.0.4",
25
26
  "@types/react-beautiful-dnd": "^13.1.8",
26
27
  "apache-arrow": "^12.0.1",
27
28
  "classnames": "^2.3.1",
@@ -33,6 +34,7 @@
33
34
  "d3-selection": "3.0.0",
34
35
  "d3-shape": "^3.2.0",
35
36
  "fast-deep-equal": "^3.1.3",
37
+ "fast-levenshtein": "^3.0.0",
36
38
  "framer-motion": "6.5.1",
37
39
  "graphviz-wasm": "3.0.2",
38
40
  "lodash.throttle": "^4.1.1",
@@ -75,5 +77,5 @@
75
77
  "access": "public",
76
78
  "registry": "https://registry.npmjs.org/"
77
79
  },
78
- "gitHead": "bb8afa0ff715bed74d870f709b5f93289f268f7c"
80
+ "gitHead": "f970fa2046e730608d9591d04d39f17ed714aa54"
79
81
  }
@@ -90,15 +90,14 @@ export const ProfileViewWithData = ({
90
90
  binaryFrameFilter,
91
91
  });
92
92
 
93
- const {isLoading: profileMetadataLoading, response: profileMetadataResponse} = useQuery(
94
- queryClient,
95
- profileSource,
96
- QueryRequest_ReportType.PROFILE_METADATA,
97
- {
98
- nodeTrimThreshold,
99
- groupBy,
100
- }
101
- );
93
+ const {
94
+ isLoading: profileMetadataLoading,
95
+ response: profileMetadataResponse,
96
+ error: profileMetadataError,
97
+ } = useQuery(queryClient, profileSource, QueryRequest_ReportType.PROFILE_METADATA, {
98
+ nodeTrimThreshold,
99
+ groupBy,
100
+ });
102
101
 
103
102
  const {perf} = useParcaContext();
104
103
 
@@ -213,7 +212,7 @@ export const ProfileViewWithData = ({
213
212
  : undefined,
214
213
  total: BigInt(flamegraphResponse?.total ?? '0'),
215
214
  filtered: BigInt(flamegraphResponse?.filtered ?? '0'),
216
- error: flamegraphError,
215
+ error: flamegraphError ?? profileMetadataError,
217
216
  metadataMappingFiles:
218
217
  profileMetadataResponse?.report.oneofKind === 'profileMetadata'
219
218
  ? profileMetadataResponse?.report?.profileMetadata?.mappingFiles
@@ -15,6 +15,7 @@ import React, {useEffect, useRef, useState} from 'react';
15
15
 
16
16
  import {Icon} from '@iconify/react';
17
17
  import cx from 'classnames';
18
+ import levenshtein from 'fast-levenshtein';
18
19
 
19
20
  import {Button, useParcaContext} from '@parca/components';
20
21
 
@@ -74,12 +75,19 @@ const CustomSelect: React.FC<CustomSelectProps> = ({
74
75
  const optionRefs = useRef<Array<HTMLElement | null>>([]);
75
76
 
76
77
  const filteredItems = searchable
77
- ? items.filter(item =>
78
- item.element.active.props.children
79
- .toString()
80
- .toLowerCase()
81
- .includes(searchTerm.toLowerCase())
82
- )
78
+ ? items
79
+ .filter(item =>
80
+ item.element.active.props.children
81
+ .toString()
82
+ .toLowerCase()
83
+ .includes(searchTerm.toLowerCase())
84
+ )
85
+ .sort((a, b) => {
86
+ if (searchTerm === '') {
87
+ return a.key.localeCompare(b.key);
88
+ }
89
+ return levenshtein.get(a.key, searchTerm) - levenshtein.get(b.key, searchTerm);
90
+ })
83
91
  : items;
84
92
 
85
93
  const selection = editable ? selectedKey : items.find(v => v.key === selectedKey);