@parca/profile 0.16.427 → 0.16.428

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.16.428](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.427...@parca/profile@0.16.428) (2024-08-21)
7
+
8
+ **Note:** Version bump only for package @parca/profile
9
+
6
10
  ## [0.16.427](https://github.com/parca-dev/parca/compare/@parca/profile@0.16.426...@parca/profile@0.16.427) (2024-08-19)
7
11
 
8
12
  **Note:** Version bump only for package @parca/profile
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SimpleMatchers/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAMpC,UAAU,KAAK;IACb,WAAW,EAAE,kBAAkB,CAAC;IAChC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAClD;AAiED,QAAA,MAAM,cAAc,oFAOjB,KAAK,KAAG,GAAG,CAAC,OA6Od,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SimpleMatchers/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAMpC,UAAU,KAAK;IACb,WAAW,EAAE,kBAAkB,CAAC;IAChC,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAClD;AAiED,QAAA,MAAM,cAAc,oFAOjB,KAAK,KAAG,GAAG,CAAC,OAsPd,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -77,6 +77,12 @@ currentQuery, profileType, queryBrowserRef, }) => {
77
77
  const hiddenRowsCount = queryRows.length - 3;
78
78
  const maxWidthInPixels = `max-w-[${queryBrowserRef.current?.offsetWidth.toString()}px]`;
79
79
  const currentMatchers = currentQuery.matchersString();
80
+ const labelNameFromMatchers = useMemo(() => {
81
+ if (currentQuery === undefined)
82
+ return [];
83
+ const matchers = currentQuery.matchers;
84
+ return matchers.map(matcher => matcher.key);
85
+ }, [currentQuery]);
80
86
  const fetchLabelValues = useCallback(async (labelName) => {
81
87
  try {
82
88
  const response = await queryClient.values({ labelName, match: [], profileType }, { meta: metadata }).response;
@@ -130,8 +136,9 @@ currentQuery, profileType, queryBrowserRef, }) => {
130
136
  : [];
131
137
  }, [labelNamesError, labelNamesResponse]);
132
138
  const labelNameOptions = useMemo(() => {
133
- return transformLabelsForSelect(labelNames);
134
- }, [labelNames]);
139
+ const uniqueLabelNames = Array.from(new Set([...labelNames, ...labelNameFromMatchers]));
140
+ return transformLabelsForSelect(uniqueLabelNames);
141
+ }, [labelNames, labelNameFromMatchers]);
135
142
  const updateRow = useCallback(async (index, field, value) => {
136
143
  const updatedRows = [...queryRows];
137
144
  const prevLabelName = updatedRows[index].labelName;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/VisualisationToolbar/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,YAAY,EAAE,k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b,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,GAAG,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,oBAAoB,qLAavB,KAAK,KAAG,GAAG,CAAC,OAsGd,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -27,7 +27,6 @@ const VisualisationToolbar = ({ hasProfileSource, profileSource, queryClient, on
27
27
  alwaysReturnArray: true,
28
28
  });
29
29
  const { profileViewExternalMainActions, profileViewExternalSubActions, preferencesModal } = useParcaContext();
30
- console.log('🚀 ~ preferencesModal:', preferencesModal);
31
30
  const [groupBy, setStoreGroupBy] = useURLState('group_by', {
32
31
  defaultValue: [FIELD_FUNCTION_NAME],
33
32
  alwaysReturnArray: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parca/profile",
3
- "version": "0.16.427",
3
+ "version": "0.16.428",
4
4
  "description": "Profile viewing libraries",
5
5
  "dependencies": {
6
6
  "@headlessui/react": "^1.7.19",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "registry": "https://registry.npmjs.org/"
75
75
  },
76
- "gitHead": "4fbdfde6aad0b428176d5aff5f7ce33ec222a73f"
76
+ "gitHead": "9cdacf967d8b5b23a622175c5b5ae767a914a0ec"
77
77
  }
@@ -120,6 +120,14 @@ const SimpleMatchers = ({
120
120
 
121
121
  const currentMatchers = currentQuery.matchersString();
122
122
 
123
+ const labelNameFromMatchers = useMemo(() => {
124
+ if (currentQuery === undefined) return [];
125
+
126
+ const matchers = currentQuery.matchers;
127
+
128
+ return matchers.map(matcher => matcher.key);
129
+ }, [currentQuery]);
130
+
123
131
  const fetchLabelValues = useCallback(
124
132
  async (labelName: string): Promise<string[]> => {
125
133
  try {
@@ -192,8 +200,9 @@ const SimpleMatchers = ({
192
200
  }, [labelNamesError, labelNamesResponse]);
193
201
 
194
202
  const labelNameOptions = useMemo(() => {
195
- return transformLabelsForSelect(labelNames);
196
- }, [labelNames]);
203
+ const uniqueLabelNames = Array.from(new Set([...labelNames, ...labelNameFromMatchers]));
204
+ return transformLabelsForSelect(uniqueLabelNames);
205
+ }, [labelNames, labelNameFromMatchers]);
197
206
 
198
207
  const updateRow = useCallback(
199
208
  async (index: number, field: keyof QueryRow, value: string): Promise<void> => {
@@ -69,8 +69,6 @@ const VisualisationToolbar = ({
69
69
  const {profileViewExternalMainActions, profileViewExternalSubActions, preferencesModal} =
70
70
  useParcaContext();
71
71
 
72
- console.log('🚀 ~ preferencesModal:', preferencesModal);
73
-
74
72
  const [groupBy, setStoreGroupBy] = useURLState<string[]>('group_by', {
75
73
  defaultValue: [FIELD_FUNCTION_NAME],
76
74
  alwaysReturnArray: true,