@localstack/appinspector-ui 1.0.214 → 1.0.216

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
@@ -2537,7 +2537,6 @@ var WATERFALL_ROW_TOGGLE_TEST_ID = "waterfall-row-toggle";
2537
2537
  var DETAIL_TAB_DETAILS_TEST_ID = "detail-tab-details";
2538
2538
  var DETAIL_TAB_REQUEST_TEST_ID = "detail-tab-request";
2539
2539
  var DETAIL_TAB_RESPONSE_TEST_ID = "detail-tab-response";
2540
- var DETAIL_TAB_ERROR_TEST_ID = "detail-tab-error";
2541
2540
  var DETAIL_TAB_PERMISSIONS_TEST_ID = "detail-tab-permissions";
2542
2541
  var DETAIL_TAB_LOGS_TEST_ID = "detail-tab-logs";
2543
2542
  var DETAIL_TAB_ADVANCED_TEST_ID = "detail-tab-advanced";
@@ -15632,6 +15631,7 @@ var AwsServiceIcon = memo6(({ hideTooltip, service, size = "medium", title }) =>
15632
15631
 
15633
15632
  // src/components/operation-identity/operation-identity.tsx
15634
15633
  import { jsx as jsx126, jsxs as jsxs120 } from "react/jsx-runtime";
15634
+ var RESOURCE_CODE_SX = { backgroundColor: "action.hover", borderRadius: "4px", fontFamily: "monospace", px: "4px" };
15635
15635
  var OperationIdentity = memo7(({
15636
15636
  arn = "",
15637
15637
  children,
@@ -15645,7 +15645,9 @@ var OperationIdentity = memo7(({
15645
15645
  service,
15646
15646
  sx,
15647
15647
  tailTestId,
15648
- testId
15648
+ testId,
15649
+ trailing,
15650
+ trailingRow = "title"
15649
15651
  }) => {
15650
15652
  const resource = shortResourceName(resourceName, arn);
15651
15653
  const hasResource = resource !== "" && resource !== "*";
@@ -15653,20 +15655,26 @@ var OperationIdentity = memo7(({
15653
15655
  const stackedIconSize = typeof iconSize === "number" ? iconSize : 32;
15654
15656
  if (density === "heading") {
15655
15657
  const isText = typeof children === "string";
15658
+ const trailingNode = (row) => trailing !== void 0 && trailingRow === row ? /* @__PURE__ */ jsx126(Box3, { sx: { alignSelf: "center", flex: "none", ml: "auto", pl: 1 }, children: trailing }) : void 0;
15656
15659
  return /* @__PURE__ */ jsxs120(Box3, { "data-testid": testId, sx: { minWidth: 0, ...sx }, children: [
15657
- label !== void 0 && /* @__PURE__ */ jsx126(Typography3, { color: "text.secondary", component: "div", sx: { fontSize: 11, fontWeight: 500, letterSpacing: "0.06em", lineHeight: "16px", textTransform: "uppercase" }, children: label }),
15660
+ label !== void 0 && /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", display: "flex", minWidth: 0 }, children: [
15661
+ /* @__PURE__ */ jsx126(Typography3, { color: "text.secondary", component: "div", sx: { fontSize: 11, fontWeight: 500, letterSpacing: "0.06em", lineHeight: "16px", textTransform: "uppercase" }, children: label }),
15662
+ trailingNode("label")
15663
+ ] }),
15658
15664
  /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", columnGap: "10px", display: "flex", minWidth: 0 }, children: [
15659
15665
  /* @__PURE__ */ jsx126(Box3, { sx: { borderRadius: "6px", flex: "none", lineHeight: 0, overflow: "hidden" }, children: /* @__PURE__ */ jsx126(AwsServiceIcon, { hideTooltip: true, service, size: "large" }) }),
15660
15666
  /* @__PURE__ */ jsxs120(Stack, { sx: { flex: 1, minWidth: 0 }, children: [
15661
15667
  /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "baseline", columnGap: "6px", display: "flex", fontSize: 15, lineHeight: "20px", minWidth: 0 }, children: [
15662
15668
  /* @__PURE__ */ jsx126(Typography3, { component: "span", noWrap: true, sx: { flex: "0 100 auto", fontWeight: 700, minWidth: "3ch" }, title: getServiceDisplayName(service), variant: "inherit", children: getServiceDisplayName(service) }),
15663
- hasOperation && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID, noWrap: true, sx: { flex: "0 1 auto", minWidth: 0 }, variant: "inherit", children: operation2 })
15669
+ hasOperation && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID, noWrap: true, sx: { flex: "0 1 auto", minWidth: 0 }, variant: "inherit", children: operation2 }),
15670
+ trailingNode("title")
15664
15671
  ] }),
15665
- (hasResource || resourcePlaceholder !== void 0 || children !== void 0) && /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", color: "text.secondary", columnGap: "6px", display: "flex", flexWrap: isText ? "nowrap" : "wrap", fontSize: 12, lineHeight: "18px", minWidth: 0, rowGap: "4px" }, children: [
15666
- hasResource && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID, noWrap: true, sx: { flex: "0 3 auto", minWidth: "3ch" }, title: resourceName || arn, variant: "inherit", children: resource }),
15672
+ (hasResource || resourcePlaceholder !== void 0 || children !== void 0 || trailingRow === "resource") && /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", color: "text.secondary", columnGap: "6px", display: "flex", flexWrap: isText ? "nowrap" : "wrap", fontSize: 12, lineHeight: "18px", minWidth: 0, rowGap: "4px" }, children: [
15673
+ hasResource && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID, noWrap: true, sx: { ...RESOURCE_CODE_SX, flex: "0 3 auto", minWidth: "3ch" }, title: resourceName || arn, variant: "inherit", children: resource }),
15667
15674
  !hasResource && resourcePlaceholder !== void 0 && /* @__PURE__ */ jsx126(Box3, { component: "span", sx: { color: "text.disabled", flex: "none" }, children: resourcePlaceholder }),
15668
15675
  (hasResource || resourcePlaceholder !== void 0) && isText && /* @__PURE__ */ jsx126(Box3, { "aria-hidden": true, component: "span", sx: { color: "text.disabled", flex: "none" }, children: "\xB7" }),
15669
- isText ? /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": tailTestId, noWrap: true, sx: { flex: "1 1 0", minWidth: 0 }, title: children, variant: "inherit", children }) : children
15676
+ isText ? /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": tailTestId, noWrap: true, sx: { flex: "1 1 0", minWidth: 0 }, title: children, variant: "inherit", children }) : children,
15677
+ trailingNode("resource")
15670
15678
  ] })
15671
15679
  ] })
15672
15680
  ] })
@@ -15678,7 +15686,7 @@ var OperationIdentity = memo7(({
15678
15686
  /* @__PURE__ */ jsx126(Typography3, { component: "span", noWrap: true, sx: { flex: "0 1 auto", fontWeight: 700, minWidth: 0 }, variant: "inherit", children: getServiceDisplayName(service) }),
15679
15687
  hasOperation && /* @__PURE__ */ jsx126(Typography3, { component: "span", "data-testid": SERVICE_NODE_OPERATION_NAME_TEST_ID, noWrap: true, sx: { flex: "0 1 auto", minWidth: 0 }, variant: "inherit", children: operation2 }),
15680
15688
  children,
15681
- hasResource && /* @__PURE__ */ jsx126(Typography3, { color: "text.secondary", component: "span", "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID, noWrap: true, sx: { flex: "1 1 0", fontSize: "0.875em", minWidth: 0 }, title: resourceName || arn, children: resource })
15689
+ hasResource && /* @__PURE__ */ jsx126(Typography3, { color: "text.secondary", component: "span", "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID, noWrap: true, sx: { ...RESOURCE_CODE_SX, flex: "0 1 auto", fontSize: "0.875em", minWidth: 0 }, title: resourceName || arn, children: resource })
15682
15690
  ] });
15683
15691
  }
15684
15692
  return /* @__PURE__ */ jsxs120(Box3, { "data-testid": testId, sx: { alignItems: "center", display: "flex", gap: "8px", minWidth: 0, ...sx }, children: [
@@ -15690,7 +15698,7 @@ var OperationIdentity = memo7(({
15690
15698
  ] }),
15691
15699
  (hasResource || resourcePlaceholder !== void 0 || resourcePrefix !== void 0) && /* @__PURE__ */ jsxs120(Box3, { sx: { alignItems: "center", columnGap: "4px", display: "flex", height: 14, minWidth: 0 }, children: [
15692
15700
  resourcePrefix,
15693
- hasResource && /* @__PURE__ */ jsx126(Typography3, { color: "text.secondary", "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID, noWrap: true, sx: { lineHeight: "14px", minWidth: 0 }, title: resourceName || arn, variant: "caption", children: resource }),
15701
+ hasResource && /* @__PURE__ */ jsx126(Typography3, { color: "text.secondary", "data-testid": SERVICE_NODE_SERVICE_NAME_TEST_ID, noWrap: true, sx: { ...RESOURCE_CODE_SX, lineHeight: "14px", minWidth: 0 }, title: resourceName || arn, variant: "caption", children: resource }),
15694
15702
  !hasResource && resourcePlaceholder !== void 0 && /* @__PURE__ */ jsx126(Typography3, { color: "text.disabled", sx: { lineHeight: "14px" }, variant: "caption", children: resourcePlaceholder })
15695
15703
  ] })
15696
15704
  ] })
@@ -16979,6 +16987,12 @@ import { Cancel as Cancel5, Close as Close3, GppBad as GppBad2, GppMaybe as GppM
16979
16987
  import { Alert as Alert4, Box as Box18, FormControlLabel, IconButton as IconButton6, Stack as Stack4, Switch, Tab, Tabs, Typography as Typography13 } from "@mui/material";
16980
16988
  import { useEffect as useEffect17, useMemo as useMemo10, useRef as useRef13, useState as useState14 } from "react";
16981
16989
 
16990
+ // src/dev-settings.tsx
16991
+ import * as React122 from "react";
16992
+ var DEFAULT_DEV_SETTINGS = { allowedPillWhenSucceeded: "hide", headingPills: "resource-line", succeededIconColor: "green", waterfallLayout: "tree" };
16993
+ var DevSettingsContext = React122.createContext(DEFAULT_DEV_SETTINGS);
16994
+ var useDevSettings = () => React122.useContext(DevSettingsContext);
16995
+
16982
16996
  // src/utils/event-utils.ts
16983
16997
  var iamEventParser = (eventName, attributes) => {
16984
16998
  if (attributes?.payload && typeof attributes.payload === "string") {
@@ -17315,7 +17329,7 @@ import { Box as Box14, useTheme as useTheme3 } from "@mui/material";
17315
17329
  var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
17316
17330
  import { jsx as jsx137, jsxs as jsxs128, Fragment as Fragment8 } from "react/jsx-runtime";
17317
17331
  import { Box as Box13, InputBase, NoSsr, SvgIcon, createTheme, ThemeProvider, Paper } from "@mui/material";
17318
- import { createContext as createContext8, useContext as useContext14, useState as useState10, useRef as useRef8, useCallback as useCallback4, useMemo as useMemo6, useEffect as useEffect12, memo as memo10 } from "react";
17332
+ import { createContext as createContext9, useContext as useContext15, useState as useState10, useRef as useRef8, useCallback as useCallback4, useMemo as useMemo6, useEffect as useEffect12, memo as memo10 } from "react";
17319
17333
  import { create, useStore, createStore } from "zustand";
17320
17334
  function r(e2) {
17321
17335
  var t, f2, n = "";
@@ -17431,10 +17445,10 @@ var createJsonViewerStore = (props) => {
17431
17445
  };
17432
17446
  });
17433
17447
  };
17434
- var JsonViewerStoreContext = createContext8(void 0);
17448
+ var JsonViewerStoreContext = createContext9(void 0);
17435
17449
  JsonViewerStoreContext.Provider;
17436
17450
  var useJsonViewerStore = (selector2, equalityFn) => {
17437
- const store = useContext14(JsonViewerStoreContext);
17451
+ const store = useContext15(JsonViewerStoreContext);
17438
17452
  return useStore(store, selector2, equalityFn);
17439
17453
  };
17440
17454
  var useTextColor = () => {
@@ -18472,10 +18486,10 @@ var createTypeRegistryStore = () => {
18472
18486
  }
18473
18487
  }));
18474
18488
  };
18475
- var TypeRegistryStoreContext = /* @__PURE__ */ createContext8(void 0);
18489
+ var TypeRegistryStoreContext = /* @__PURE__ */ createContext9(void 0);
18476
18490
  TypeRegistryStoreContext.Provider;
18477
18491
  var useTypeRegistryStore = (selector2, equalityFn) => {
18478
- const store = useContext14(TypeRegistryStoreContext);
18492
+ const store = useContext15(TypeRegistryStoreContext);
18479
18493
  return useStore(store, selector2, equalityFn);
18480
18494
  };
18481
18495
  function matchTypeComponents(value, path, registry) {
@@ -18943,7 +18957,7 @@ function useThemeDetector() {
18943
18957
  return isDark;
18944
18958
  }
18945
18959
  function useSetIfNotUndefinedEffect(key, value) {
18946
- const { setState } = useContext14(JsonViewerStoreContext);
18960
+ const { setState } = useContext15(JsonViewerStoreContext);
18947
18961
  useEffect12(() => {
18948
18962
  if (value !== void 0) {
18949
18963
  setState({
@@ -18957,7 +18971,7 @@ function useSetIfNotUndefinedEffect(key, value) {
18957
18971
  ]);
18958
18972
  }
18959
18973
  var JsonViewerInner = (props) => {
18960
- const { setState } = useContext14(JsonViewerStoreContext);
18974
+ const { setState } = useContext15(JsonViewerStoreContext);
18961
18975
  useEffect12(() => {
18962
18976
  setState((state) => ({
18963
18977
  prevValue: state.value,
@@ -29209,7 +29223,7 @@ import { Box as Box16, CircularProgress as CircularProgress3, Stack as Stack3, T
29209
29223
  import { useEffect as useEffect16, useMemo as useMemo9, useRef as useRef12, useState as useState13 } from "react";
29210
29224
 
29211
29225
  // src/context.tsx
29212
- import { createContext as createContext10, useContext as useContext16 } from "react";
29226
+ import { createContext as createContext11, useContext as useContext17 } from "react";
29213
29227
  import { useCallback as useCallback6, useMemo as useMemo8 } from "react";
29214
29228
 
29215
29229
  // src/api/client.ts
@@ -29494,7 +29508,7 @@ var createApiClient = ({ localstackEndpoint }) => {
29494
29508
  };
29495
29509
 
29496
29510
  // src/hooks/status-provider.tsx
29497
- import { createContext as createContext9, useContext as useContext15 } from "react";
29511
+ import { createContext as createContext10, useContext as useContext16 } from "react";
29498
29512
 
29499
29513
  // src/hooks/use-connection-state-machine.ts
29500
29514
  import { useCallback as useCallback5, useEffect as useEffect14, useRef as useRef10, useState as useState12 } from "react";
@@ -29580,13 +29594,13 @@ function useConnectionStateMachine() {
29580
29594
 
29581
29595
  // src/hooks/status-provider.tsx
29582
29596
  import { jsx as jsx140 } from "react/jsx-runtime";
29583
- var AppInspectorStatusContext = createContext9(void 0);
29597
+ var AppInspectorStatusContext = createContext10(void 0);
29584
29598
  var StatusProvider = ({ children }) => {
29585
29599
  const value = useConnectionStateMachine();
29586
29600
  return /* @__PURE__ */ jsx140(AppInspectorStatusContext.Provider, { value, children });
29587
29601
  };
29588
29602
  var useAppInspectorStatus = () => {
29589
- const value = useContext15(AppInspectorStatusContext);
29603
+ const value = useContext16(AppInspectorStatusContext);
29590
29604
  if (!value) {
29591
29605
  throw new Error("@localstack-studio/ui: useAppInspectorStatus must be used within a <StatusProvider> (rendered internally by <AppInspectorContextProvider>)");
29592
29606
  }
@@ -31522,9 +31536,9 @@ var AppInspectorTheme = ({ children }) => /* @__PURE__ */ jsx141(ThemeProvider2,
31522
31536
 
31523
31537
  // src/context.tsx
31524
31538
  import { Fragment as Fragment10, jsx as jsx142 } from "react/jsx-runtime";
31525
- var AppInspectorContext = createContext10(void 0);
31539
+ var AppInspectorContext = createContext11(void 0);
31526
31540
  var useAppInspector = () => {
31527
- const context = useContext16(AppInspectorContext);
31541
+ const context = useContext17(AppInspectorContext);
31528
31542
  if (!context) {
31529
31543
  throw new Error("@localstack-studio/ui: components must be used within a <AppInspectorContextProvider>");
31530
31544
  }
@@ -31676,7 +31690,7 @@ var LambdaInvokeLogsSection = ({ endTimeNano, functionName: functionName2, regio
31676
31690
 
31677
31691
  // src/components/event-details/operation-status-badges.tsx
31678
31692
  import { Cancel as Cancel4, CheckCircle as CheckCircle3, GppBad, GppGood, GppMaybe as GppMaybe5, HelpOutline } from "@mui/icons-material";
31679
- import { alpha as alpha5, Box as Box17, ButtonBase, darken, lighten, Typography as Typography12 } from "@mui/material";
31693
+ import { alpha as alpha5, Box as Box17, darken, lighten, Typography as Typography12 } from "@mui/material";
31680
31694
  import { jsx as jsx144, jsxs as jsxs131 } from "react/jsx-runtime";
31681
31695
  var IAM = {
31682
31696
  allowed: { color: "success", icon: GppGood, label: "IAM allowed", title: "IAM allowed the call" },
@@ -31697,17 +31711,14 @@ var tint = (color2) => ({
31697
31711
  px: 0.75,
31698
31712
  py: 0.25
31699
31713
  });
31700
- var clickable = (onClick) => onClick === void 0 ? {} : {
31701
- component: ButtonBase,
31702
- onClick,
31703
- sx: { "&:hover": { filter: "brightness(1.15)" }, "borderRadius": 1, "cursor": "pointer", "font": "inherit" }
31704
- };
31705
- var OperationStatusBadges = ({ iam, iamPermission, onIamClick, onStatusClick, status, statusLabel }) => {
31714
+ var OperationStatusBadges = ({ iam, iamPermission, status, statusLabel }) => {
31715
+ const { allowedPillWhenSucceeded, succeededIconColor } = useDevSettings();
31706
31716
  const isError = status === "error";
31707
31717
  const statusText = isError ? statusLabel ?? "Error" : "OK";
31708
31718
  const StatusIcon2 = isError ? Cancel4 : CheckCircle3;
31709
31719
  const statusColor = isError ? "error" : "success";
31710
- const iamStyle = iam === void 0 ? void 0 : IAM[iam];
31720
+ const hideAllowed = iam === "allowed" && status === "ok" && allowedPillWhenSucceeded === "hide";
31721
+ const iamStyle = iam === void 0 || hideAllowed ? void 0 : IAM[iam];
31711
31722
  const iamLabel = iamPermission === void 0 || iam === "suppressed" ? iamStyle?.label : sentenceCase(formatPermissionStatus(iamPermission));
31712
31723
  const showStatus = status !== "unset";
31713
31724
  if (!showStatus && !iamStyle) {
@@ -31718,10 +31729,9 @@ var OperationStatusBadges = ({ iam, iamPermission, onIamClick, onStatusClick, st
31718
31729
  Box17,
31719
31730
  {
31720
31731
  "data-testid": EVENT_DETAILS_HEADING_STATUS_TEST_ID,
31721
- ...clickable(onStatusClick),
31722
- sx: { alignItems: "center", display: "flex", gap: 0.5, minWidth: 0, ...clickable(onStatusClick).sx, ...tint(statusColor) },
31732
+ sx: { alignItems: "center", display: "flex", gap: 0.5, minWidth: 0, ...tint(statusColor) },
31723
31733
  children: [
31724
- /* @__PURE__ */ jsx144(StatusIcon2, { sx: { color: `${statusColor}.main`, fontSize: 14 } }),
31734
+ /* @__PURE__ */ jsx144(StatusIcon2, { sx: { color: !isError && succeededIconColor === "gray" ? "text.disabled" : `${statusColor}.main`, fontSize: 14 } }),
31725
31735
  /* @__PURE__ */ jsx144(Typography12, { color: "inherit", noWrap: true, variant: "caption", children: isError ? `Failed \xB7 ${statusText}` : "Succeeded" })
31726
31736
  ]
31727
31737
  }
@@ -31730,8 +31740,7 @@ var OperationStatusBadges = ({ iam, iamPermission, onIamClick, onStatusClick, st
31730
31740
  Box17,
31731
31741
  {
31732
31742
  "data-testid": EVENT_DETAILS_HEADING_IAM_TEST_ID,
31733
- ...clickable(onIamClick),
31734
- sx: { alignItems: "center", display: "flex", flex: "none", gap: 0.5, ...clickable(onIamClick).sx, ...tint(iamStyle.color) },
31743
+ sx: { alignItems: "center", display: "flex", flex: "none", gap: 0.5, ...tint(iamStyle.color) },
31735
31744
  children: [
31736
31745
  /* @__PURE__ */ jsx144(iamStyle.icon, { sx: { color: paletteColor(iamStyle.color), fontSize: 14 } }),
31737
31746
  /* @__PURE__ */ jsx144(Typography12, { color: "inherit", variant: "caption", children: iamLabel })
@@ -31758,12 +31767,14 @@ var checkIsSqsSendMessage = (span) => {
31758
31767
  };
31759
31768
  var PERMISSION_SEVERITY = ["explicitly_denied", "implicitly_denied", "explicitly_allowed"];
31760
31769
  var getWorstPermission = (events) => PERMISSION_SEVERITY.find((permission) => events.some((event) => event.permission === permission));
31770
+ var TRAILING_ROW = { "bottom-right": "resource", "resource-line": "title", "title-row": "title", "top-right": "label" };
31761
31771
  var IAM_OUTCOME = { allowed: "allowed", error: "denied", none: void 0, warning: "warning" };
31762
- var OPTIONAL_TABS = ["error", "logs", "permissions"];
31772
+ var OPTIONAL_TABS = ["logs", "permissions", "response"];
31763
31773
  var getOptionalTabs = (span, eventGroups) => ({
31764
- error: getSpanIssues(span).error,
31765
31774
  logs: checkIsLambdaInvoke(span) && typeof span.attributes?.["localstack.request_id"] === "string",
31766
- permissions: span.iam_errors_suppressed === true || eventGroups.permissions !== void 0
31775
+ permissions: span.iam_errors_suppressed === true || eventGroups.permissions !== void 0,
31776
+ // A failed call has no response; its error is at the top of Details.
31777
+ response: span.attributes?.["localstack.aws.service.response_suppressed"] === true || tryParseJson(span.attributes?.["localstack.aws.service.response"]) !== void 0
31767
31778
  });
31768
31779
  var Field = ({ children, copy, label, testId, testIdOn = "value" }) => /* @__PURE__ */ jsxs132(Box18, { children: [
31769
31780
  /* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: label }),
@@ -31778,6 +31789,7 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
31778
31789
  () => getEventGroupsByType(selectedEvent?.events ?? []),
31779
31790
  [selectedEvent?.events]
31780
31791
  );
31792
+ const { headingPills } = useDevSettings();
31781
31793
  const [parseNestedJson, setParseNestedJson] = useState14(true);
31782
31794
  const [tab, setTab] = useState14("details");
31783
31795
  const optionalTabs = selectedEvent ? getOptionalTabs(selectedEvent, eventGroups) : void 0;
@@ -31822,7 +31834,8 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
31822
31834
  const functionError = isLambdaInvoke ? getLambdaFunctionError(selectedEvent.attributes?.["localstack.aws.service.response"]) : void 0;
31823
31835
  const errorType = functionError?.errorType ?? issues.errorType;
31824
31836
  const duration = selectedEvent.end_time_unix_nano ? ((BigInt(selectedEvent.end_time_unix_nano) - BigInt(selectedEvent.start_time_unix_nano)) / BigInt("1000000")).toString() : void 0;
31825
- const { error: showError, logs: showLogs, permissions: showPermissions } = getOptionalTabs(selectedEvent, eventGroups);
31837
+ const showError = issues.error;
31838
+ const { logs: showLogs, permissions: showPermissions, response: showResponse } = getOptionalTabs(selectedEvent, eventGroups);
31826
31839
  const errorMessages = functionError?.errorMessage === void 0 ? [.../* @__PURE__ */ new Set([selectedEvent.status_message, ...(selectedEvent.errors ?? []).filter((item) => item.level === "error").map((item) => item.message)])].filter((message) => Boolean(message) && message !== errorType) : [functionError.errorMessage];
31827
31840
  const iamEvents = getIamEvents(selectedEvent);
31828
31841
  const iamPermission = getWorstPermission(iamEvents);
@@ -31832,17 +31845,11 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
31832
31845
  {
31833
31846
  iam: iamOutcome,
31834
31847
  iamPermission,
31835
- onIamClick: showPermissions ? () => {
31836
- setTab("permissions");
31837
- } : void 0,
31838
- onStatusClick: () => {
31839
- setTab(showError ? "error" : "response");
31840
- },
31841
31848
  status: issues.error ? "error" : selectedEvent.status_code === 1 ? "ok" : "unset",
31842
31849
  statusLabel: errorType
31843
31850
  }
31844
31851
  );
31845
- const identity = { arn: selectedEvent.arn, operation: /* @__PURE__ */ jsx145(OperationName, { span: selectedEvent }), resourceName: selectedEvent.resource_name, resourcePlaceholder: "\u2014", service: selectedEvent.service_name };
31852
+ const identity = { arn: selectedEvent.arn, operation: /* @__PURE__ */ jsx145(OperationName, { span: selectedEvent }), resourceName: selectedEvent.resource_name, service: selectedEvent.service_name };
31846
31853
  const rawDataSwitch = /* @__PURE__ */ jsx145(
31847
31854
  FormControlLabel,
31848
31855
  {
@@ -31870,7 +31877,7 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
31870
31877
  py: 1.25
31871
31878
  },
31872
31879
  children: [
31873
- /* @__PURE__ */ jsx145(OperationIdentity, { ...identity, density: "heading", label: "Selected operation", sx: { flex: 1 }, testId: EVENT_DETAILS_HEADING_TEST_ID, children: statusBadges }),
31880
+ /* @__PURE__ */ jsx145(OperationIdentity, { ...identity, density: "heading", label: "Selected operation", sx: { flex: 1 }, testId: EVENT_DETAILS_HEADING_TEST_ID, trailing: headingPills === "resource-line" ? void 0 : statusBadges, trailingRow: TRAILING_ROW[headingPills], children: headingPills === "resource-line" ? statusBadges : void 0 }),
31874
31881
  onClose && /* @__PURE__ */ jsx145(IconButton6, { "data-testid": EVENT_DETAILS_CLOSE_BUTTON_TEST_ID, onClick: onClose, size: "small", children: /* @__PURE__ */ jsx145(Close3, {}) })
31875
31882
  ]
31876
31883
  }
@@ -31898,10 +31905,9 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
31898
31905
  value: activeTab,
31899
31906
  variant: "scrollable",
31900
31907
  children: [
31901
- /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_DETAILS_TEST_ID, label: "Details", value: "details" }),
31908
+ /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_DETAILS_TEST_ID, icon: showError ? /* @__PURE__ */ jsx145(Cancel5, { color: "error", sx: { fontSize: 16 } }) : void 0, iconPosition: "end", label: "Details", value: "details" }),
31902
31909
  /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_REQUEST_TEST_ID, label: "Payload", value: "payload" }),
31903
- /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_RESPONSE_TEST_ID, label: "Response", value: "response" }),
31904
- showError && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_ERROR_TEST_ID, icon: /* @__PURE__ */ jsx145(Cancel5, { color: "error", sx: { fontSize: 16 } }), iconPosition: "end", label: "Error", value: "error" }),
31910
+ showResponse && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_RESPONSE_TEST_ID, label: "Response", value: "response" }),
31905
31911
  showPermissions && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_PERMISSIONS_TEST_ID, icon: permissionsIcon, iconPosition: "end", label: "Permissions", value: "permissions" }),
31906
31912
  showLogs && /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_LOGS_TEST_ID, label: "Logs", value: "logs" }),
31907
31913
  /* @__PURE__ */ jsx145(Tab, { "data-testid": DETAIL_TAB_ADVANCED_TEST_ID, label: "Advanced", value: "advanced" })
@@ -31910,13 +31916,42 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
31910
31916
  ),
31911
31917
  /* @__PURE__ */ jsxs132(Box18, { sx: { p: 2 }, children: [
31912
31918
  activeTab === "details" && /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, children: [
31919
+ showError && /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, children: [
31920
+ /* @__PURE__ */ jsxs132(Stack4, { spacing: 1, children: [
31921
+ /* @__PURE__ */ jsx145(Field, { label: "Type", children: errorType }),
31922
+ errorMessages.length > 0 && /* @__PURE__ */ jsx145(Field, { label: "Message", children: errorMessages.join(" \xB7 ") }),
31923
+ functionError && /* @__PURE__ */ jsxs132(Box18, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
31924
+ functionError.requestId !== void 0 && /* @__PURE__ */ jsx145(Field, { label: "Request ID", children: functionError.requestId }),
31925
+ /* @__PURE__ */ jsx145(Field, { label: "Function Error", testId: EVENT_DETAILS_FUNCTION_ERROR_TEST_ID, children: functionError.functionError })
31926
+ ] })
31927
+ ] }),
31928
+ functionError?.stackTrace !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
31929
+ /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31930
+ /* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Stack Trace" }),
31931
+ /* @__PURE__ */ jsx145(CopyButton, { value: functionError.stackTrace })
31932
+ ] }),
31933
+ /* @__PURE__ */ jsx145(
31934
+ Box18,
31935
+ {
31936
+ component: "pre",
31937
+ "data-testid": EVENT_DETAILS_STACK_TRACE_TEST_ID,
31938
+ sx: { backgroundColor: "background.default", borderRadius: 1, fontFamily: "monospace", fontSize: 12, m: 0, overflow: "auto", p: 1 },
31939
+ children: functionError.stackTrace
31940
+ }
31941
+ )
31942
+ ] }),
31943
+ exceptionPayload !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
31944
+ /* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Exception" }),
31945
+ /* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
31946
+ ] })
31947
+ ] }),
31913
31948
  /* @__PURE__ */ jsxs132(Stack4, { "data-testid": EVENT_DETAILS_SECTION_BASIC_INFORMATION_TEST_ID, spacing: 1, children: [
31914
31949
  /* @__PURE__ */ jsxs132(Box18, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
31915
31950
  /* @__PURE__ */ jsx145(Field, { copy: getServiceDisplayName(selectedEvent.service_name), label: "Service", testId: EVENT_DETAILS_SERVICE_NAME_TEST_ID, children: getServiceDisplayName(selectedEvent.service_name) }),
31916
31951
  /* @__PURE__ */ jsx145(Field, { label: "Action", testId: EVENT_DETAILS_OPERATION_NAME_TEST_ID, children: /* @__PURE__ */ jsx145(OperationName, { span: selectedEvent }) })
31917
31952
  ] }),
31918
31953
  /* @__PURE__ */ jsxs132(Box18, { sx: cfnResourceType ? { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" } : void 0, children: [
31919
- /* @__PURE__ */ jsx145(Field, { copy: selectedEvent.resource_name, label: "Resource", testId: EVENT_DETAILS_RESOURCE_NAME_TEST_ID, testIdOn: "row", children: selectedEvent.resource_name || /* @__PURE__ */ jsx145(Box18, { component: "span", sx: { color: "text.disabled" }, children: "\u2014" }) }),
31954
+ /* @__PURE__ */ jsx145(Field, { copy: selectedEvent.resource_name, label: "Resource", testId: EVENT_DETAILS_RESOURCE_NAME_TEST_ID, testIdOn: "row", children: selectedEvent.resource_name ? /* @__PURE__ */ jsx145(Box18, { component: "span", sx: RESOURCE_CODE_SX, children: selectedEvent.resource_name }) : /* @__PURE__ */ jsx145(Box18, { component: "span", sx: { color: "text.disabled" }, children: "\u2014" }) }),
31920
31955
  Boolean(cfnResourceType) && /* @__PURE__ */ jsx145(Field, { label: "Resource Type", testId: EVENT_DETAILS_CFN_RESOURCE_TYPE_TEST_ID, children: cfnResourceType })
31921
31956
  ] }),
31922
31957
  Boolean(resourceArn) && /* @__PURE__ */ jsx145(Field, { label: "Resource ARN", testId: EVENT_DETAILS_RESOURCE_ARN_TEST_ID, testIdOn: "row", children: resourceArn }),
@@ -31949,38 +31984,9 @@ var EventDetails = ({ onClose, onOperationShown, selectedEvent }) => {
31949
31984
  rawDataSwitch,
31950
31985
  /* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_REQUEST_PAYLOAD, value: requestPayload })
31951
31986
  ] })),
31952
- activeTab === "response" && (responsePayload === void 0 && !isResponseSuppressed ? /* @__PURE__ */ jsx145(EmptyTab, { children: issues.error ? "No response: the call failed. See the Error tab." : "No response payload recorded." }) : /* @__PURE__ */ jsxs132(Fragment11, { children: [
31987
+ activeTab === "response" && /* @__PURE__ */ jsxs132(Fragment11, { children: [
31953
31988
  rawDataSwitch,
31954
31989
  isResponseSuppressed ? /* @__PURE__ */ jsx145(Alert4, { severity: "warning", children: "Response payload is available \u2014 upgrade your license to view" }) : /* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_RESPONSE_PAYLOAD_TEST_ID, value: responsePayload })
31955
- ] })),
31956
- activeTab === "error" && /* @__PURE__ */ jsxs132(Stack4, { spacing: 2, children: [
31957
- /* @__PURE__ */ jsxs132(Stack4, { spacing: 1, children: [
31958
- /* @__PURE__ */ jsx145(Field, { label: "Type", children: errorType }),
31959
- errorMessages.length > 0 && /* @__PURE__ */ jsx145(Field, { label: "Message", children: errorMessages.join(" \xB7 ") }),
31960
- functionError && /* @__PURE__ */ jsxs132(Box18, { sx: { display: "grid", gap: 2, gridTemplateColumns: "1.3fr 1fr" }, children: [
31961
- functionError.requestId !== void 0 && /* @__PURE__ */ jsx145(Field, { label: "Request ID", children: functionError.requestId }),
31962
- /* @__PURE__ */ jsx145(Field, { label: "Function Error", testId: EVENT_DETAILS_FUNCTION_ERROR_TEST_ID, children: functionError.functionError })
31963
- ] })
31964
- ] }),
31965
- functionError?.stackTrace !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
31966
- /* @__PURE__ */ jsxs132(Stack4, { alignItems: "center", direction: "row", sx: { "&:hover .copy-btn": { opacity: 1 } }, children: [
31967
- /* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600 }, variant: "caption", children: "Stack Trace" }),
31968
- /* @__PURE__ */ jsx145(CopyButton, { value: functionError.stackTrace })
31969
- ] }),
31970
- /* @__PURE__ */ jsx145(
31971
- Box18,
31972
- {
31973
- component: "pre",
31974
- "data-testid": EVENT_DETAILS_STACK_TRACE_TEST_ID,
31975
- sx: { backgroundColor: "background.default", borderRadius: 1, fontFamily: "monospace", fontSize: 12, m: 0, overflow: "auto", p: 1 },
31976
- children: functionError.stackTrace
31977
- }
31978
- )
31979
- ] }),
31980
- exceptionPayload !== void 0 && /* @__PURE__ */ jsxs132(Box18, { children: [
31981
- /* @__PURE__ */ jsx145(Typography13, { sx: { fontWeight: 600, mb: 0.5 }, variant: "caption", children: "Exception" }),
31982
- /* @__PURE__ */ jsx145(PayloadViewer, { testId: EVENT_DETAILS_EXCEPTION_PAYLOAD_TEST_ID, value: exceptionPayload })
31983
- ] })
31984
31990
  ] }),
31985
31991
  activeTab === "permissions" && /* @__PURE__ */ jsxs132(Fragment11, { children: [
31986
31992
  selectedEvent.iam_errors_suppressed && /* @__PURE__ */ jsx145(Alert4, { "data-testid": EVENT_DETAILS_IAM_ERRORS_SUPPRESSED_TEST_ID, severity: "warning", sx: { mb: 1 }, children: "IAM errors are suppressed \u2014 upgrade your license to view" }),
@@ -32576,16 +32582,10 @@ function useLocalStorage(key, initialValue) {
32576
32582
 
32577
32583
  // src/components/trace-panel/waterfall.tsx
32578
32584
  import { AccountTreeOutlined, Cancel as Cancel7, FormatListBulleted, GppMaybe as GppMaybe8, KeyboardArrowDown as KeyboardArrowDown2, KeyboardArrowRight as KeyboardArrowRight2 } from "@mui/icons-material";
32579
- import { Box as Box21, ButtonBase as ButtonBase2, ToggleButton as ToggleButton2, ToggleButtonGroup as ToggleButtonGroup2, Typography as Typography14 } from "@mui/material";
32585
+ import { Box as Box21, ButtonBase, ToggleButton as ToggleButton2, ToggleButtonGroup as ToggleButtonGroup2, Typography as Typography14 } from "@mui/material";
32580
32586
  import { alpha as alpha6 } from "@mui/material/styles";
32581
32587
  import * as React124 from "react";
32582
32588
 
32583
- // src/dev-settings.tsx
32584
- import * as React123 from "react";
32585
- var DEFAULT_DEV_SETTINGS = { waterfallLayout: "tree" };
32586
- var DevSettingsContext = React123.createContext(DEFAULT_DEV_SETTINGS);
32587
- var useDevSettings = () => React123.useContext(DevSettingsContext);
32588
-
32589
32589
  // src/components/trace-panel/axis-ticks.ts
32590
32590
  var getAxisTicks = (durationMs, maxIntervals) => {
32591
32591
  if (durationMs <= 0 || maxIntervals < 1) return [0];
@@ -32884,7 +32884,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32884
32884
  ] }),
32885
32885
  hasChildren && !isCollapsed && /* @__PURE__ */ jsx150(Line, { left: lineX(depth), top: 19 }),
32886
32886
  hasChildren ? /* @__PURE__ */ jsx150(
32887
- ButtonBase2,
32887
+ ButtonBase,
32888
32888
  {
32889
32889
  "aria-label": isCollapsed ? "Expand" : "Collapse",
32890
32890
  "data-testid": WATERFALL_ROW_TOGGLE_TEST_ID,
@@ -33116,7 +33116,6 @@ var TraceSidebar = ({ onClose, onOperationShown, onRequestRendered, onSelectSpan
33116
33116
  label: "Request",
33117
33117
  operation: /* @__PURE__ */ jsx151(OperationName, { span: root2 }),
33118
33118
  resourceName: root2.resource_name,
33119
- resourcePlaceholder: "\u2014",
33120
33119
  service: root2.service_name,
33121
33120
  sx: { flex: 1 },
33122
33121
  tailTestId: TRACE_SIDEBAR_STATS_TEST_ID,