@localstack/appinspector-ui 1.0.132 → 1.0.134

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/dist/index.cjs CHANGED
@@ -15549,14 +15549,9 @@ var newSpanBackgroundColor = {
15549
15549
  var LABEL_BEGINNING_OF_STREAM = "This is the beginning of the stream";
15550
15550
  var LABEL_END_OF_STREAM = "This is the end of the stream";
15551
15551
  var LABEL_NO_SPANS = "There are no operations";
15552
- var LABEL_LOAD_OLDER = "Load older operations";
15553
- var LABEL_LOAD_NEWER = "Load newer operations";
15554
15552
  var STICK_TO_EDGE_THRESHOLD_PX = 4;
15555
15553
  var StreamBoundaryRow = ({ colSpan, label }) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { children: label }) }) });
15556
- var LoadSpansRow = ({ colSpan, fetching, label, onFetch }) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_material7.TableCell, { colSpan, sx: { textAlign: "center" }, children: [
15557
- !fetching && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.Button, { onClick: onFetch, sx: { my: 1 }, children: label }),
15558
- fetching && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.CircularProgress, { size: 24, sx: { m: 2 } })
15559
- ] }) });
15554
+ var LoadingRow = ({ colSpan }) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan, sx: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.CircularProgress, { size: 24, sx: { m: 2 } }) }) });
15560
15555
  var SpansDataGridRow = (0, import_react38.memo)(
15561
15556
  ({ isNew, onSpanClick, row }) => {
15562
15557
  const theme = (0, import_material7.useTheme)();
@@ -15623,14 +15618,10 @@ var SpansDataGrid = ({
15623
15618
  hasMoreForward,
15624
15619
  licenseLimit,
15625
15620
  onClearSpans,
15626
- onFetchBackward,
15627
- onFetchForward,
15628
15621
  onOrderChange,
15629
15622
  onSpanClick,
15630
- onToggleStream,
15631
15623
  order: order2,
15632
15624
  spans,
15633
- streamPaused,
15634
15625
  systemLimit,
15635
15626
  totalCount,
15636
15627
  warningCount
@@ -15798,21 +15789,6 @@ var SpansDataGrid = ({
15798
15789
  ) })
15799
15790
  ] }),
15800
15791
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.Box, { sx: { flexGrow: 1 } }),
15801
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
15802
- import_material7.FormControlLabel,
15803
- {
15804
- control: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
15805
- import_material7.Button,
15806
- {
15807
- onClick: onToggleStream,
15808
- startIcon: streamPaused ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons_material3.PlayArrowOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_icons_material3.PauseOutlined, {}),
15809
- variant: "text",
15810
- children: streamPaused ? "Resume Stream" : "Pause Stream"
15811
- }
15812
- ),
15813
- label: ""
15814
- }
15815
- ),
15816
15792
  /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
15817
15793
  import_material7.FormControlLabel,
15818
15794
  {
@@ -15875,7 +15851,7 @@ var SpansDataGrid = ({
15875
15851
  (spans === void 0 || clearingSpans) && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
15876
15852
  !clearingSpans && spans?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_NO_SPANS }),
15877
15853
  !clearingSpans && order2 === "newest_first" && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
15878
- hasRows && hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadSpansRow, { colSpan: columnCount, fetching: fetchingForward, label: LABEL_LOAD_NEWER, onFetch: onFetchForward }),
15854
+ hasRows && hasMoreForward && fetchingForward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadingRow, { colSpan: columnCount }),
15879
15855
  hasRows && !hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM }),
15880
15856
  hasRows && paddingTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingTop, p: 0 } }) }),
15881
15857
  hasRows && virtualItems.map((virtualItem) => {
@@ -15884,12 +15860,12 @@ var SpansDataGrid = ({
15884
15860
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(SpansDataGridRow, { isNew, onSpanClick, row }, row.original.span_id);
15885
15861
  }),
15886
15862
  hasRows && paddingBottom > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingBottom, p: 0 } }) }),
15887
- hasRows && hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadSpansRow, { colSpan: columnCount, fetching: fetchingBackward, label: LABEL_LOAD_OLDER, onFetch: onFetchBackward }),
15863
+ hasRows && hasMoreBackward && fetchingBackward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadingRow, { colSpan: columnCount }),
15888
15864
  hasRows && !hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM })
15889
15865
  ] }),
15890
15866
  !clearingSpans && order2 === "oldest_first" && /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
15891
15867
  hasRows && !hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM }),
15892
- hasRows && hasMoreBackward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadSpansRow, { colSpan: columnCount, fetching: fetchingBackward, label: LABEL_LOAD_OLDER, onFetch: onFetchBackward }),
15868
+ hasRows && hasMoreBackward && fetchingBackward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadingRow, { colSpan: columnCount }),
15893
15869
  hasRows && paddingTop > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingTop, p: 0 } }) }),
15894
15870
  hasRows && virtualItems.map((virtualItem) => {
15895
15871
  const row = displayRows[virtualItem.index];
@@ -15897,7 +15873,7 @@ var SpansDataGrid = ({
15897
15873
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(SpansDataGridRow, { isNew, onSpanClick, row }, row.original.span_id);
15898
15874
  }),
15899
15875
  hasRows && paddingBottom > 0 && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_material7.TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingBottom, p: 0 } }) }),
15900
- hasRows && hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadSpansRow, { colSpan: columnCount, fetching: fetchingForward, label: LABEL_LOAD_NEWER, onFetch: onFetchForward }),
15876
+ hasRows && hasMoreForward && fetchingForward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(LoadingRow, { colSpan: columnCount }),
15901
15877
  hasRows && !hasMoreForward && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM })
15902
15878
  ] })
15903
15879
  ] })
@@ -15936,14 +15912,10 @@ var SpansList = (props) => {
15936
15912
  hasMoreForward: props.hasMoreForward,
15937
15913
  licenseLimit: props.licenseLimit,
15938
15914
  onClearSpans: props.onClearSpans,
15939
- onFetchBackward: props.onFetchBackward,
15940
- onFetchForward: props.onFetchForward,
15941
15915
  onOrderChange: props.onOrderChange,
15942
15916
  onSpanClick: props.onSpanClick,
15943
- onToggleStream: props.onToggleStream,
15944
15917
  order: props.order,
15945
15918
  spans: props.spans,
15946
- streamPaused: props.streamPaused,
15947
15919
  systemLimit: props.systemLimit,
15948
15920
  totalCount: props.totalCount,
15949
15921
  warningCount: props.warningCount
@@ -18762,7 +18734,7 @@ function useSpansWebSocket(options) {
18762
18734
  }
18763
18735
 
18764
18736
  // src/hooks/use-spans.ts
18765
- var PAGE_SIZE = 30;
18737
+ var PAGE_SIZE = 100;
18766
18738
  var useSpans = () => {
18767
18739
  const api = useAppInspectorApi();
18768
18740
  const { reportDisabled } = useAppInspectorStatus();
@@ -18843,26 +18815,23 @@ var useSpans = () => {
18843
18815
  setClearingSpans(false);
18844
18816
  }
18845
18817
  }, [clearingSpans, api]);
18846
- const [streamPaused, setStreamPaused] = (0, import_react47.useState)(false);
18847
- const toggleStream = (0, import_react47.useCallback)(() => {
18848
- setStreamPaused((previous) => !previous);
18849
- }, []);
18850
18818
  (0, import_react47.useEffect)(() => {
18851
- if (hasMoreForward === true && !fetchingForward && !streamPaused) {
18819
+ if (hasMoreForward === true && !fetchingForward) {
18852
18820
  void paginationBufferRef.current.fetchForward();
18853
18821
  }
18854
- }, [hasMoreForward, fetchingForward, streamPaused]);
18822
+ }, [hasMoreForward, fetchingForward]);
18823
+ (0, import_react47.useEffect)(() => {
18824
+ if (hasMoreBackward === true && !fetchingBackward && !fetchingForward) {
18825
+ void paginationBufferRef.current.fetchBackward();
18826
+ }
18827
+ }, [hasMoreBackward, fetchingBackward, fetchingForward]);
18855
18828
  useSpansWebSocket({
18856
18829
  onMessage: () => {
18857
18830
  if (clearingSpans) {
18858
18831
  return;
18859
18832
  }
18860
18833
  if (!hasMoreForward) {
18861
- if (streamPaused) {
18862
- paginationBufferRef.current.checkIfThereAreMoreItemsForward();
18863
- } else {
18864
- void paginationBufferRef.current.fetchForward();
18865
- }
18834
+ void paginationBufferRef.current.fetchForward();
18866
18835
  }
18867
18836
  }
18868
18837
  });
@@ -18888,9 +18857,7 @@ var useSpans = () => {
18888
18857
  hasMoreForward,
18889
18858
  licenseLimit,
18890
18859
  spans,
18891
- streamPaused,
18892
18860
  systemLimit,
18893
- toggleStream,
18894
18861
  totalCount,
18895
18862
  warningCount
18896
18863
  };
@@ -31889,7 +31856,11 @@ var TraceGraph = ({
31889
31856
  });
31890
31857
  }
31891
31858
  }
31892
- const { edges: layoutedEdges, nodes: layoutedNodes } = getLayoutedNodesAndEdges(allNodes, allEdges);
31859
+ const knownSpanIds = new Set(allNodes.map((node) => node.id));
31860
+ const validEdges = allEdges.filter(
31861
+ (edge) => knownSpanIds.has(edge.source) && knownSpanIds.has(edge.target)
31862
+ );
31863
+ const { edges: layoutedEdges, nodes: layoutedNodes } = getLayoutedNodesAndEdges(allNodes, validEdges);
31893
31864
  for (const node of layoutedNodes) {
31894
31865
  if (node.id === initialFocusEventId) {
31895
31866
  node.selected = true;
@@ -32184,7 +32155,6 @@ var SpansListPage = () => {
32184
32155
  clearingSpans,
32185
32156
  clearSpans,
32186
32157
  errorCount,
32187
- fetchBackward,
32188
32158
  fetchError,
32189
32159
  fetchForward,
32190
32160
  fetchingBackward,
@@ -32193,9 +32163,7 @@ var SpansListPage = () => {
32193
32163
  hasMoreForward,
32194
32164
  licenseLimit,
32195
32165
  spans,
32196
- streamPaused,
32197
32166
  systemLimit,
32198
- toggleStream,
32199
32167
  totalCount,
32200
32168
  warningCount
32201
32169
  } = useSpans();
@@ -32304,14 +32272,11 @@ var SpansListPage = () => {
32304
32272
  hasMoreForward,
32305
32273
  licenseLimit,
32306
32274
  onClearSpans: clearSpansSync,
32307
- onFetchBackward: fetchBackward,
32308
32275
  onFetchForward: fetchForward,
32309
32276
  onOrderChange: setOrder,
32310
32277
  onSpanClick: navigateToSpan,
32311
- onToggleStream: toggleStream,
32312
32278
  order: order2,
32313
32279
  spans,
32314
- streamPaused,
32315
32280
  systemLimit,
32316
32281
  totalCount,
32317
32282
  warningCount