@industry-theme/principal-view-panels 0.1.49 → 0.1.50

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":"ExecutionViewerPanel.d.ts","sourceRoot":"","sources":["../../src/panels/ExecutionViewerPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AA8B/E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgmB9D,CAAC"}
1
+ {"version":3,"file":"ExecutionViewerPanel.d.ts","sourceRoot":"","sources":["../../src/panels/ExecutionViewerPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAkI/E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6qB9D,CAAC"}
@@ -56032,6 +56032,93 @@ function buildEventToNodeMap(canvas) {
56032
56032
  }
56033
56033
  return map2;
56034
56034
  }
56035
+ const TestEventPanelWrapper = ({ spans, currentSpanIndex, currentEventIndex, onSpanIndexChange }) => {
56036
+ const isSingleSpan = spans.length === 1;
56037
+ const wrapperId = "event-panel-" + (isSingleSpan ? "single" : "multi");
56038
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
56039
+ /* @__PURE__ */ jsx("style", { children: `
56040
+ /* Reorder elements in TestEventPanel */
56041
+ #${wrapperId} > div > div:first-child {
56042
+ display: flex;
56043
+ flex-direction: column;
56044
+ }
56045
+
56046
+ /* Test name/description - move to top (order 1) */
56047
+ #${wrapperId} > div > div:first-child > div:first-child {
56048
+ order: 1;
56049
+ }
56050
+
56051
+ /* Filter buttons (All, Events, Logs) - move below test name (order 2) */
56052
+ #${wrapperId} > div > div:first-child > div:nth-child(2) {
56053
+ order: 2;
56054
+ }
56055
+
56056
+ /* Timeline/content - keep at bottom (order 3) */
56057
+ #${wrapperId} > div > div:first-child > div:nth-child(3) {
56058
+ order: 3;
56059
+ }
56060
+
56061
+ ${isSingleSpan ? `
56062
+ /* Hide navigation for single span */
56063
+ #${wrapperId} button:disabled {
56064
+ display: none;
56065
+ }
56066
+ #${wrapperId} div:has(> button:disabled) {
56067
+ display: none;
56068
+ }
56069
+
56070
+ /* Hide "Execution Timeline" title */
56071
+ #${wrapperId} h3,
56072
+ #${wrapperId} h2,
56073
+ #${wrapperId} div[style*="fontSize: 16px"] {
56074
+ display: none !important;
56075
+ }
56076
+
56077
+ /* Hide filter buttons (All, Events, Logs) */
56078
+ #${wrapperId} div:has(> button):not(:has(svg[class*="HelpCircle"])) button {
56079
+ display: none !important;
56080
+ }
56081
+
56082
+ /* Hide event/log counts (e.g., "1 events, 0 logs") */
56083
+ #${wrapperId} div[style*="fontSize: 12px"][style*="marginLeft: auto"] {
56084
+ display: none !important;
56085
+ }
56086
+
56087
+ /* Keep only the status badge and help button visible in header */
56088
+ #${wrapperId} > div > div:first-child > div:first-child {
56089
+ display: flex !important;
56090
+ align-items: center;
56091
+ justify-content: space-between;
56092
+ padding: 12px 16px;
56093
+ }
56094
+
56095
+ /* Hide all children except status badge and help button */
56096
+ #${wrapperId} > div > div:first-child > div:first-child > * {
56097
+ display: none !important;
56098
+ }
56099
+
56100
+ /* Show status badge */
56101
+ #${wrapperId} > div > div:first-child > div:first-child > div:has([style*="background"]) {
56102
+ display: flex !important;
56103
+ }
56104
+
56105
+ /* Show help button */
56106
+ #${wrapperId} > div > div:first-child > div:first-child > button {
56107
+ display: flex !important;
56108
+ }
56109
+ ` : ""}
56110
+ ` }),
56111
+ /* @__PURE__ */ jsx("div", { id: wrapperId, style: { height: "100%" }, children: /* @__PURE__ */ jsx(
56112
+ distExports.TestEventPanel,
56113
+ {
56114
+ spans,
56115
+ currentSpanIndex,
56116
+ currentEventIndex,
56117
+ onSpanIndexChange
56118
+ }
56119
+ ) })
56120
+ ] });
56121
+ };
56035
56122
  const ExecutionViewerPanel = ({
56036
56123
  context,
56037
56124
  actions,
@@ -56063,6 +56150,12 @@ const ExecutionViewerPanel = ({
56063
56150
  selectedExecutionIdRef.current = state.selectedExecutionId;
56064
56151
  const playbackTimerRef = useRef(null);
56065
56152
  const eventNodeMapRef = useRef(/* @__PURE__ */ new Map());
56153
+ const findCanvasFiles = useCallback((files) => {
56154
+ return files.filter((file) => {
56155
+ const path = file.relativePath || file.path || "";
56156
+ return path.endsWith(".otel.canvas") || path.endsWith(".canvas");
56157
+ }).map((file) => file.relativePath || file.path || "");
56158
+ }, []);
56066
56159
  const loadExecution = useCallback(async (executionId) => {
56067
56160
  setState((prev) => ({ ...prev, loading: prev.canvas === null, error: null }));
56068
56161
  try {
@@ -56091,9 +56184,26 @@ const ExecutionViewerPanel = ({
56091
56184
  }
56092
56185
  const availableExecutions = ExecutionLoader.findExecutionFiles(fileTreeData.allFiles);
56093
56186
  if (availableExecutions.length === 0) {
56187
+ const readFile2 = acts.readFile;
56188
+ const repositoryPath2 = ctx.repositoryPath;
56189
+ let canvas2 = null;
56190
+ if (readFile2 && repositoryPath2) {
56191
+ const canvasFiles = findCanvasFiles(fileTreeData.allFiles);
56192
+ if (canvasFiles.length > 0) {
56193
+ try {
56194
+ const fullCanvasPath = `${repositoryPath2}/${canvasFiles[0]}`;
56195
+ const canvasContent = await readFile2(fullCanvasPath);
56196
+ if (canvasContent && typeof canvasContent === "string") {
56197
+ canvas2 = JSON.parse(canvasContent);
56198
+ }
56199
+ } catch (error) {
56200
+ console.warn("[ExecutionViewer] Failed to load canvas:", error);
56201
+ }
56202
+ }
56203
+ }
56094
56204
  setState((prev) => ({
56095
56205
  ...prev,
56096
- canvas: null,
56206
+ canvas: canvas2,
56097
56207
  execution: null,
56098
56208
  metadata: null,
56099
56209
  loading: false,
@@ -56173,7 +56283,7 @@ const ExecutionViewerPanel = ({
56173
56283
  error: error.message
56174
56284
  }));
56175
56285
  }
56176
- }, []);
56286
+ }, [findCanvasFiles]);
56177
56287
  useEffect(() => {
56178
56288
  loadExecution();
56179
56289
  }, [loadExecution]);
@@ -56268,7 +56378,7 @@ const ExecutionViewerPanel = ({
56268
56378
  }
56269
56379
  };
56270
56380
  }, [state.isPlaying, state.execution]);
56271
- if (!state.loading && state.availableExecutions.length === 0) {
56381
+ if (!state.loading && state.availableExecutions.length === 0 && !state.canvas) {
56272
56382
  return /* @__PURE__ */ jsx(
56273
56383
  "div",
56274
56384
  {
@@ -56282,7 +56392,7 @@ const ExecutionViewerPanel = ({
56282
56392
  },
56283
56393
  children: /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", maxWidth: "600px", padding: "20px" }, children: [
56284
56394
  /* @__PURE__ */ jsx(Activity, { size: 48, style: { margin: "0 auto 20px", opacity: 0.3 } }),
56285
- /* @__PURE__ */ jsx("h2", { style: { margin: "0 0 10px 0", fontSize: "18px", fontWeight: 600 }, children: "No Execution Artifacts Found" }),
56395
+ /* @__PURE__ */ jsx("h2", { style: { margin: "0 0 10px 0", fontSize: "18px", fontWeight: 600 }, children: "No Execution Artifacts or Canvas Found" }),
56286
56396
  /* @__PURE__ */ jsxs("p", { style: { margin: "0 0 20px 0", color: theme.colors.textSecondary, lineHeight: 1.5 }, children: [
56287
56397
  "Execution artifacts should be saved to ",
56288
56398
  /* @__PURE__ */ jsx("code", { children: "__executions__/*.spans.json" }),
@@ -56381,7 +56491,7 @@ const ExecutionViewerPanel = ({
56381
56491
  gap: "12px"
56382
56492
  },
56383
56493
  children: [
56384
- /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
56494
+ state.availableExecutions.length > 0 && /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
56385
56495
  /* @__PURE__ */ jsxs(
56386
56496
  "button",
56387
56497
  {
@@ -56493,10 +56603,10 @@ const ExecutionViewerPanel = ({
56493
56603
  ] })
56494
56604
  ] }),
56495
56605
  /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
56496
- /* @__PURE__ */ jsx("div", { style: { fontSize: "14px", fontWeight: 600 }, children: ((_a = state.metadata) == null ? void 0 : _a.name) || "Execution Viewer" }),
56606
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "14px", fontWeight: 600 }, children: ((_a = state.metadata) == null ? void 0 : _a.name) || (state.canvas ? "Canvas Viewer" : "Execution Viewer") }),
56497
56607
  selectedExecution && /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: "#999", marginTop: "2px" }, children: selectedExecution.path })
56498
56608
  ] }),
56499
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
56609
+ state.execution && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
56500
56610
  /* @__PURE__ */ jsx(
56501
56611
  "button",
56502
56612
  {
@@ -56543,11 +56653,58 @@ const ExecutionViewerPanel = ({
56543
56653
  }
56544
56654
  ),
56545
56655
  /* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
56656
+ /* @__PURE__ */ jsx("div", { style: { flex: "0 0 40%", borderRight: "1px solid #333", overflow: "hidden" }, children: state.execution ? /* @__PURE__ */ jsx(
56657
+ TestEventPanelWrapper,
56658
+ {
56659
+ spans: ExecutionLoader.getSpans(state.execution),
56660
+ currentSpanIndex: state.currentSpanIndex,
56661
+ currentEventIndex: state.currentEventIndex,
56662
+ onSpanIndexChange: handleSpanIndexChange
56663
+ }
56664
+ ) : /* @__PURE__ */ jsx(
56665
+ "div",
56666
+ {
56667
+ style: {
56668
+ display: "flex",
56669
+ alignItems: "center",
56670
+ justifyContent: "center",
56671
+ height: "100%",
56672
+ background: "#0a0a0a",
56673
+ padding: "20px"
56674
+ },
56675
+ children: /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", maxWidth: "400px" }, children: [
56676
+ /* @__PURE__ */ jsx(Activity, { size: 48, style: { margin: "0 auto 20px", opacity: 0.3, color: "#666" } }),
56677
+ /* @__PURE__ */ jsx("h3", { style: { margin: "0 0 10px 0", fontSize: "16px", fontWeight: 600, color: "#fff" }, children: "No Execution Artifacts Found" }),
56678
+ /* @__PURE__ */ jsx("p", { style: { margin: "0 0 16px 0", color: "#999", lineHeight: 1.5, fontSize: "13px" }, children: "The canvas is displayed, but execution data is missing. Run tests to generate execution artifacts." }),
56679
+ /* @__PURE__ */ jsxs(
56680
+ "div",
56681
+ {
56682
+ style: {
56683
+ background: "#1e1e1e",
56684
+ padding: "10px",
56685
+ borderRadius: "4px",
56686
+ fontFamily: "monospace",
56687
+ fontSize: "11px",
56688
+ textAlign: "left",
56689
+ color: "#d4d4d4",
56690
+ marginBottom: "12px"
56691
+ },
56692
+ children: [
56693
+ /* @__PURE__ */ jsx("div", { children: "# Save execution artifacts to:" }),
56694
+ /* @__PURE__ */ jsx("div", { style: { marginTop: "4px" }, children: "__executions__/*.spans.json" }),
56695
+ /* @__PURE__ */ jsx("div", { children: "packages/*/__executions__/*.spans.json" })
56696
+ ]
56697
+ }
56698
+ ),
56699
+ /* @__PURE__ */ jsx("p", { style: { margin: 0, color: "#666", fontSize: "11px", fontStyle: "italic" }, children: "Tip: Use exportExecutionArtifact() in your tests" })
56700
+ ] })
56701
+ }
56702
+ ) }),
56546
56703
  state.canvas ? /* @__PURE__ */ jsx("div", { style: { flex: "0 0 60%", position: "relative" }, children: /* @__PURE__ */ jsx(
56547
56704
  distExports.GraphRenderer,
56548
56705
  {
56549
56706
  canvas: state.canvas,
56550
- showMinimap: true,
56707
+ showMinimap: false,
56551
56708
  showControls: true,
56552
56709
  showBackground: true,
56553
56710
  backgroundVariant: "lines",
@@ -56574,16 +56731,7 @@ const ExecutionViewerPanel = ({
56574
56731
  ] })
56575
56732
  ] })
56576
56733
  }
56577
- ),
56578
- /* @__PURE__ */ jsx("div", { style: { flex: "0 0 40%", borderLeft: "1px solid #333", overflow: "hidden" }, children: /* @__PURE__ */ jsx(
56579
- distExports.TestEventPanel,
56580
- {
56581
- spans: state.execution ? ExecutionLoader.getSpans(state.execution) : [],
56582
- currentSpanIndex: state.currentSpanIndex,
56583
- currentEventIndex: state.currentEventIndex,
56584
- onSpanIndexChange: handleSpanIndexChange
56585
- }
56586
- ) })
56734
+ )
56587
56735
  ] }),
56588
56736
  state.metadata && /* @__PURE__ */ jsx(ExecutionStats, { metadata: state.metadata })
56589
56737
  ]