@industry-theme/principal-view-panels 0.12.37 → 0.12.38

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TraceListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/TraceListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,UAAU,CAAC;AAiB/E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAu5C7D,CAAC"}
1
+ {"version":3,"file":"TraceListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/TraceListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,wBAAwB,EAAwB,MAAM,UAAU,CAAC;AAiB/E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA6/C7D,CAAC"}
@@ -101873,6 +101873,73 @@ const TraceListPanel = ({
101873
101873
  });
101874
101874
  return statusMap;
101875
101875
  }, [versionSnapshots, scenarioTraceSet]);
101876
+ const [scenarioVisibilityMap, setScenarioVisibilityMap] = useState({});
101877
+ React__default.useEffect(() => {
101878
+ const initialVisibility = {};
101879
+ versionSnapshots.forEach((snapshot) => {
101880
+ snapshot.storyboards.forEach((storyboard) => {
101881
+ storyboard.workflows.forEach((workflow) => {
101882
+ if ("content" in workflow) {
101883
+ const content2 = workflow.content;
101884
+ if (content2 == null ? void 0 : content2.scenarios) {
101885
+ content2.scenarios.forEach((scenario) => {
101886
+ if (scenario.id) {
101887
+ const key = `${workflow.id}/${scenario.id}`;
101888
+ initialVisibility[key] = !scenario.filterDefault;
101889
+ }
101890
+ });
101891
+ }
101892
+ }
101893
+ });
101894
+ });
101895
+ });
101896
+ setScenarioVisibilityMap(initialVisibility);
101897
+ }, [versionSnapshots]);
101898
+ const handleScenarioVisibilityToggle = React__default.useCallback(
101899
+ async (scenarioKey, isVisible) => {
101900
+ setScenarioVisibilityMap((prev) => ({
101901
+ ...prev,
101902
+ [scenarioKey]: isVisible
101903
+ }));
101904
+ if (actions && "updateScenarioFilterDefault" in actions && typeof actions.updateScenarioFilterDefault === "function") {
101905
+ const [workflowId, scenarioId] = scenarioKey.split("/");
101906
+ let workflowPath;
101907
+ for (const snapshot of versionSnapshots) {
101908
+ for (const storyboard of snapshot.storyboards) {
101909
+ const workflow = storyboard.workflows.find((w) => w.id === workflowId);
101910
+ if (workflow) {
101911
+ workflowPath = workflow.path;
101912
+ break;
101913
+ }
101914
+ }
101915
+ if (workflowPath) break;
101916
+ }
101917
+ if (workflowPath && scenarioId) {
101918
+ try {
101919
+ await actions.updateScenarioFilterDefault(workflowPath, scenarioId, !isVisible);
101920
+ } catch (error) {
101921
+ console.error("[TraceListPanel] Failed to update scenario filterDefault:", error);
101922
+ setScenarioVisibilityMap((prev) => ({
101923
+ ...prev,
101924
+ [scenarioKey]: !isVisible
101925
+ }));
101926
+ }
101927
+ }
101928
+ }
101929
+ },
101930
+ [actions, versionSnapshots]
101931
+ );
101932
+ const filteredTraces = React__default.useMemo(() => {
101933
+ return traces.filter((trace2) => {
101934
+ if (!trace2.scenarioMatches || trace2.scenarioMatches.length === 0) {
101935
+ return true;
101936
+ }
101937
+ return trace2.scenarioMatches.some((match) => {
101938
+ const key = `${match.workflowId}/${match.scenarioId}`;
101939
+ return scenarioVisibilityMap[key] !== false;
101940
+ });
101941
+ });
101942
+ }, [traces, scenarioVisibilityMap]);
101876
101943
  const [resources, setResources] = useState({});
101877
101944
  const [configLoading, setConfigLoading] = useState(false);
101878
101945
  const [configError, setConfigError] = useState(null);
@@ -102531,7 +102598,7 @@ const TraceListPanel = ({
102531
102598
  }
102532
102599
  ),
102533
102600
  activeTab === "traces" ? /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflow: "hidden", display: "flex", flexDirection: "column" }, children: [
102534
- traces.length > 0 && /* @__PURE__ */ jsx(
102601
+ filteredTraces.length > 0 && /* @__PURE__ */ jsx(
102535
102602
  "div",
102536
102603
  {
102537
102604
  style: {
@@ -102544,7 +102611,7 @@ const TraceListPanel = ({
102544
102611
  children: /* @__PURE__ */ jsx(
102545
102612
  TraceTape,
102546
102613
  {
102547
- traces,
102614
+ traces: filteredTraces,
102548
102615
  theme: theme2,
102549
102616
  highlightedSpanId,
102550
102617
  selectedTraceId: Array.from(expandedTraceIds)[0],
@@ -102560,7 +102627,7 @@ const TraceListPanel = ({
102560
102627
  /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(
102561
102628
  TraceList,
102562
102629
  {
102563
- traces,
102630
+ traces: filteredTraces,
102564
102631
  theme: theme2,
102565
102632
  onTraceClick: handleTraceClick,
102566
102633
  onTraceSelect: handleTraceSelect,
@@ -102568,7 +102635,7 @@ const TraceListPanel = ({
102568
102635
  onRemoveTrace: handleRemoveTrace,
102569
102636
  onClearAll: handleClearAll,
102570
102637
  expandedTraceIds,
102571
- emptyMessage: traces.length === 0 ? "No traces received yet. Waiting for telemetry data..." : void 0
102638
+ emptyMessage: traces.length === 0 ? "No traces received yet. Waiting for telemetry data..." : filteredTraces.length === 0 ? "All traces filtered by scenario visibility. Toggle scenarios in Coverage tab." : void 0
102572
102639
  }
102573
102640
  ) })
102574
102641
  ] }) : activeTab === "configuration" && showConfigurationTab ? /* @__PURE__ */ jsx("div", { style: { flex: 1, padding: "16px", overflow: "auto" }, children: configLoading ? /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.body, fontSize: theme2.fontSizes[1], color: theme2.colors.textSecondary }, children: "Loading resources..." }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -102967,6 +103034,8 @@ const TraceListPanel = ({
102967
103034
  traceWorkflowsSet,
102968
103035
  scenarioStatusMap,
102969
103036
  scenarioTraceCounts,
103037
+ scenarioVisibilityMap,
103038
+ onScenarioVisibilityToggle: handleScenarioVisibilityToggle,
102970
103039
  statusBarDisplay: "traces"
102971
103040
  }
102972
103041
  ) })