@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.js CHANGED
@@ -2586,7 +2586,7 @@ var EmulatorVersionBanner = ({
2586
2586
  import { Alert as Alert2, Box as Box6, Button as Button3 } from "@mui/material";
2587
2587
 
2588
2588
  // src/components/spans-list/spans-data-grid.tsx
2589
- import { DeleteForeverOutlined, PauseOutlined, PlayArrowOutlined } from "@mui/icons-material";
2589
+ import { DeleteForeverOutlined } from "@mui/icons-material";
2590
2590
  import {
2591
2591
  Box as Box5,
2592
2592
  Button as Button2,
@@ -15562,14 +15562,9 @@ var newSpanBackgroundColor = {
15562
15562
  var LABEL_BEGINNING_OF_STREAM = "This is the beginning of the stream";
15563
15563
  var LABEL_END_OF_STREAM = "This is the end of the stream";
15564
15564
  var LABEL_NO_SPANS = "There are no operations";
15565
- var LABEL_LOAD_OLDER = "Load older operations";
15566
- var LABEL_LOAD_NEWER = "Load newer operations";
15567
15565
  var STICK_TO_EDGE_THRESHOLD_PX = 4;
15568
15566
  var StreamBoundaryRow = ({ colSpan, label }) => /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx127("span", { children: label }) }) });
15569
- var LoadSpansRow = ({ colSpan, fetching, label, onFetch }) => /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsxs121(TableCell, { colSpan, sx: { textAlign: "center" }, children: [
15570
- !fetching && /* @__PURE__ */ jsx127(Button2, { onClick: onFetch, sx: { my: 1 }, children: label }),
15571
- fetching && /* @__PURE__ */ jsx127(CircularProgress, { size: 24, sx: { m: 2 } })
15572
- ] }) });
15567
+ var LoadingRow = ({ colSpan }) => /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan, sx: { textAlign: "center" }, children: /* @__PURE__ */ jsx127(CircularProgress, { size: 24, sx: { m: 2 } }) }) });
15573
15568
  var SpansDataGridRow = memo9(
15574
15569
  ({ isNew, onSpanClick, row }) => {
15575
15570
  const theme = useTheme2();
@@ -15636,14 +15631,10 @@ var SpansDataGrid = ({
15636
15631
  hasMoreForward,
15637
15632
  licenseLimit,
15638
15633
  onClearSpans,
15639
- onFetchBackward,
15640
- onFetchForward,
15641
15634
  onOrderChange,
15642
15635
  onSpanClick,
15643
- onToggleStream,
15644
15636
  order: order2,
15645
15637
  spans,
15646
- streamPaused,
15647
15638
  systemLimit,
15648
15639
  totalCount,
15649
15640
  warningCount
@@ -15811,21 +15802,6 @@ var SpansDataGrid = ({
15811
15802
  ) })
15812
15803
  ] }),
15813
15804
  /* @__PURE__ */ jsx127(Box5, { sx: { flexGrow: 1 } }),
15814
- /* @__PURE__ */ jsx127(
15815
- FormControlLabel,
15816
- {
15817
- control: /* @__PURE__ */ jsx127(
15818
- Button2,
15819
- {
15820
- onClick: onToggleStream,
15821
- startIcon: streamPaused ? /* @__PURE__ */ jsx127(PlayArrowOutlined, {}) : /* @__PURE__ */ jsx127(PauseOutlined, {}),
15822
- variant: "text",
15823
- children: streamPaused ? "Resume Stream" : "Pause Stream"
15824
- }
15825
- ),
15826
- label: ""
15827
- }
15828
- ),
15829
15805
  /* @__PURE__ */ jsx127(
15830
15806
  FormControlLabel,
15831
15807
  {
@@ -15888,7 +15864,7 @@ var SpansDataGrid = ({
15888
15864
  (spans === void 0 || clearingSpans) && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { fontStyle: "italic", textAlign: "center" }, children: /* @__PURE__ */ jsx127(CircularProgress, { size: 48, sx: { m: 4 } }) }) }),
15889
15865
  !clearingSpans && spans?.length === 0 && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_NO_SPANS }),
15890
15866
  !clearingSpans && order2 === "newest_first" && /* @__PURE__ */ jsxs121(Fragment5, { children: [
15891
- hasRows && hasMoreForward && /* @__PURE__ */ jsx127(LoadSpansRow, { colSpan: columnCount, fetching: fetchingForward, label: LABEL_LOAD_NEWER, onFetch: onFetchForward }),
15867
+ hasRows && hasMoreForward && fetchingForward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
15892
15868
  hasRows && !hasMoreForward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM }),
15893
15869
  hasRows && paddingTop > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingTop, p: 0 } }) }),
15894
15870
  hasRows && virtualItems.map((virtualItem) => {
@@ -15897,12 +15873,12 @@ var SpansDataGrid = ({
15897
15873
  return /* @__PURE__ */ jsx127(SpansDataGridRow, { isNew, onSpanClick, row }, row.original.span_id);
15898
15874
  }),
15899
15875
  hasRows && paddingBottom > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingBottom, p: 0 } }) }),
15900
- hasRows && hasMoreBackward && /* @__PURE__ */ jsx127(LoadSpansRow, { colSpan: columnCount, fetching: fetchingBackward, label: LABEL_LOAD_OLDER, onFetch: onFetchBackward }),
15876
+ hasRows && hasMoreBackward && fetchingBackward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
15901
15877
  hasRows && !hasMoreBackward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM })
15902
15878
  ] }),
15903
15879
  !clearingSpans && order2 === "oldest_first" && /* @__PURE__ */ jsxs121(Fragment5, { children: [
15904
15880
  hasRows && !hasMoreBackward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_BEGINNING_OF_STREAM }),
15905
- hasRows && hasMoreBackward && /* @__PURE__ */ jsx127(LoadSpansRow, { colSpan: columnCount, fetching: fetchingBackward, label: LABEL_LOAD_OLDER, onFetch: onFetchBackward }),
15881
+ hasRows && hasMoreBackward && fetchingBackward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
15906
15882
  hasRows && paddingTop > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingTop, p: 0 } }) }),
15907
15883
  hasRows && virtualItems.map((virtualItem) => {
15908
15884
  const row = displayRows[virtualItem.index];
@@ -15910,7 +15886,7 @@ var SpansDataGrid = ({
15910
15886
  return /* @__PURE__ */ jsx127(SpansDataGridRow, { isNew, onSpanClick, row }, row.original.span_id);
15911
15887
  }),
15912
15888
  hasRows && paddingBottom > 0 && /* @__PURE__ */ jsx127(TableRow, { children: /* @__PURE__ */ jsx127(TableCell, { colSpan: columnCount, sx: { border: 0, height: paddingBottom, p: 0 } }) }),
15913
- hasRows && hasMoreForward && /* @__PURE__ */ jsx127(LoadSpansRow, { colSpan: columnCount, fetching: fetchingForward, label: LABEL_LOAD_NEWER, onFetch: onFetchForward }),
15889
+ hasRows && hasMoreForward && fetchingForward && /* @__PURE__ */ jsx127(LoadingRow, { colSpan: columnCount }),
15914
15890
  hasRows && !hasMoreForward && /* @__PURE__ */ jsx127(StreamBoundaryRow, { colSpan: columnCount, label: LABEL_END_OF_STREAM })
15915
15891
  ] })
15916
15892
  ] })
@@ -15949,14 +15925,10 @@ var SpansList = (props) => {
15949
15925
  hasMoreForward: props.hasMoreForward,
15950
15926
  licenseLimit: props.licenseLimit,
15951
15927
  onClearSpans: props.onClearSpans,
15952
- onFetchBackward: props.onFetchBackward,
15953
- onFetchForward: props.onFetchForward,
15954
15928
  onOrderChange: props.onOrderChange,
15955
15929
  onSpanClick: props.onSpanClick,
15956
- onToggleStream: props.onToggleStream,
15957
15930
  order: props.order,
15958
15931
  spans: props.spans,
15959
- streamPaused: props.streamPaused,
15960
15932
  systemLimit: props.systemLimit,
15961
15933
  totalCount: props.totalCount,
15962
15934
  warningCount: props.warningCount
@@ -18775,7 +18747,7 @@ function useSpansWebSocket(options) {
18775
18747
  }
18776
18748
 
18777
18749
  // src/hooks/use-spans.ts
18778
- var PAGE_SIZE = 30;
18750
+ var PAGE_SIZE = 100;
18779
18751
  var useSpans = () => {
18780
18752
  const api = useAppInspectorApi();
18781
18753
  const { reportDisabled } = useAppInspectorStatus();
@@ -18856,26 +18828,23 @@ var useSpans = () => {
18856
18828
  setClearingSpans(false);
18857
18829
  }
18858
18830
  }, [clearingSpans, api]);
18859
- const [streamPaused, setStreamPaused] = useState9(false);
18860
- const toggleStream = useCallback8(() => {
18861
- setStreamPaused((previous) => !previous);
18862
- }, []);
18863
18831
  useEffect16(() => {
18864
- if (hasMoreForward === true && !fetchingForward && !streamPaused) {
18832
+ if (hasMoreForward === true && !fetchingForward) {
18865
18833
  void paginationBufferRef.current.fetchForward();
18866
18834
  }
18867
- }, [hasMoreForward, fetchingForward, streamPaused]);
18835
+ }, [hasMoreForward, fetchingForward]);
18836
+ useEffect16(() => {
18837
+ if (hasMoreBackward === true && !fetchingBackward && !fetchingForward) {
18838
+ void paginationBufferRef.current.fetchBackward();
18839
+ }
18840
+ }, [hasMoreBackward, fetchingBackward, fetchingForward]);
18868
18841
  useSpansWebSocket({
18869
18842
  onMessage: () => {
18870
18843
  if (clearingSpans) {
18871
18844
  return;
18872
18845
  }
18873
18846
  if (!hasMoreForward) {
18874
- if (streamPaused) {
18875
- paginationBufferRef.current.checkIfThereAreMoreItemsForward();
18876
- } else {
18877
- void paginationBufferRef.current.fetchForward();
18878
- }
18847
+ void paginationBufferRef.current.fetchForward();
18879
18848
  }
18880
18849
  }
18881
18850
  });
@@ -18901,9 +18870,7 @@ var useSpans = () => {
18901
18870
  hasMoreForward,
18902
18871
  licenseLimit,
18903
18872
  spans,
18904
- streamPaused,
18905
18873
  systemLimit,
18906
- toggleStream,
18907
18874
  totalCount,
18908
18875
  warningCount
18909
18876
  };
@@ -31902,7 +31869,11 @@ var TraceGraph = ({
31902
31869
  });
31903
31870
  }
31904
31871
  }
31905
- const { edges: layoutedEdges, nodes: layoutedNodes } = getLayoutedNodesAndEdges(allNodes, allEdges);
31872
+ const knownSpanIds = new Set(allNodes.map((node) => node.id));
31873
+ const validEdges = allEdges.filter(
31874
+ (edge) => knownSpanIds.has(edge.source) && knownSpanIds.has(edge.target)
31875
+ );
31876
+ const { edges: layoutedEdges, nodes: layoutedNodes } = getLayoutedNodesAndEdges(allNodes, validEdges);
31906
31877
  for (const node of layoutedNodes) {
31907
31878
  if (node.id === initialFocusEventId) {
31908
31879
  node.selected = true;
@@ -32197,7 +32168,6 @@ var SpansListPage = () => {
32197
32168
  clearingSpans,
32198
32169
  clearSpans,
32199
32170
  errorCount,
32200
- fetchBackward,
32201
32171
  fetchError,
32202
32172
  fetchForward,
32203
32173
  fetchingBackward,
@@ -32206,9 +32176,7 @@ var SpansListPage = () => {
32206
32176
  hasMoreForward,
32207
32177
  licenseLimit,
32208
32178
  spans,
32209
- streamPaused,
32210
32179
  systemLimit,
32211
- toggleStream,
32212
32180
  totalCount,
32213
32181
  warningCount
32214
32182
  } = useSpans();
@@ -32317,14 +32285,11 @@ var SpansListPage = () => {
32317
32285
  hasMoreForward,
32318
32286
  licenseLimit,
32319
32287
  onClearSpans: clearSpansSync,
32320
- onFetchBackward: fetchBackward,
32321
32288
  onFetchForward: fetchForward,
32322
32289
  onOrderChange: setOrder,
32323
32290
  onSpanClick: navigateToSpan,
32324
- onToggleStream: toggleStream,
32325
32291
  order: order2,
32326
32292
  spans,
32327
- streamPaused,
32328
32293
  systemLimit,
32329
32294
  totalCount,
32330
32295
  warningCount