Transaction Dashboard: Call stack trace tab#1821
Conversation
|
Preview is available here: |
There was a problem hiding this comment.
Pull request overview
This PR adds a new "Call Stack Trace" tab to the Transaction Dashboard that displays diagnostic events from Stellar transaction execution in a hierarchical, interactive view. The feature allows users to inspect contract function calls, events, parameters, and return values in chronological order with support for nested calls and error highlighting.
Changes:
- Added new CallStackTrace component with collapsible view toggle and error state handling
- Updated type definitions to support flexible diagnostic event formats
- Added tab8, tab9, tab10 support to TabView component for future extensibility
- Updated network limit configuration data for mainnet, testnet, and futurenet
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/types.ts | Updated diagnosticEventsJson type to support DiagnosticEventJson array, AnyObject, or undefined |
| src/helpers/getTxResourceBreakdown.ts | Added type assertion for diagnostic event data access |
| src/constants/networkLimits.ts | Updated live_soroban_state_size_window values for all networks |
| src/components/TabView/index.tsx | Extended TabView to support up to 10 tabs |
| src/app/(sidebar)/transaction-dashboard/styles.scss | Added comprehensive styling for CallStackTrace component |
| src/app/(sidebar)/transaction-dashboard/page.tsx | Integrated CallStackTrace tab into transaction dashboard |
| src/app/(sidebar)/transaction-dashboard/components/CallStackTrace.tsx | New component for displaying call stack trace with test data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const [testDataId, setTestDataId] = useState<string>(""); | ||
|
|
||
| const TEST_DATA: { [key: string]: DiagnosticEventJson[] } = { | ||
| soroSwap: TEMP_SS, | ||
| kale: TEMP_KALE, | ||
| longParams: TEMP_LONG_PARAMS, | ||
| someFailed: TEMP_MIXED, | ||
| allFailed: TEMP_FAILED, | ||
| }; | ||
|
|
||
| const data = diagnosticEvents | ||
| ? formatDiagnosticEvents(TEST_DATA[testDataId] || diagnosticEvents) |
There was a problem hiding this comment.
Test data state and logic must be removed before merging. The testDataId state, TEST_DATA object, and the logic that overrides diagnosticEvents with test data (line 53) are for testing purposes only and should not be present in production code.
src/app/(sidebar)/transaction-dashboard/components/CallStackTrace.tsx
Outdated
Show resolved
Hide resolved
src/app/(sidebar)/transaction-dashboard/components/CallStackTrace.tsx
Outdated
Show resolved
Hide resolved
| {/* TODO: remove before merge */} | ||
| <div | ||
| style={{ | ||
| border: "2px solid #c00", | ||
| display: "flex", | ||
| gap: "8px", | ||
| flexWrap: "wrap", | ||
| padding: 10, | ||
| alignItems: "center", | ||
| fontWeight: "bold", | ||
| color: "#c00", | ||
| }} | ||
| > | ||
| <span>FOR TESTING:</span> | ||
|
|
||
| <Button | ||
| variant="destructive" | ||
| size="sm" | ||
| onClick={() => setTestDataId("soroSwap")} | ||
| disabled={testDataId === "soroSwap"} | ||
| > | ||
| SoroSwap | ||
| </Button> | ||
|
|
||
| <Button | ||
| variant="destructive" | ||
| size="sm" | ||
| onClick={() => setTestDataId("kale")} | ||
| disabled={testDataId === "kale"} | ||
| > | ||
| Kale | ||
| </Button> | ||
|
|
||
| <Button | ||
| variant="destructive" | ||
| size="sm" | ||
| onClick={() => setTestDataId("longParams")} | ||
| disabled={testDataId === "longParams"} | ||
| > | ||
| Long params | ||
| </Button> | ||
|
|
||
| <Button | ||
| variant="destructive" | ||
| size="sm" | ||
| onClick={() => setTestDataId("someFailed")} | ||
| disabled={testDataId === "someFailed"} | ||
| > | ||
| Some failed | ||
| </Button> | ||
|
|
||
| <Button | ||
| variant="destructive" | ||
| size="sm" | ||
| onClick={() => setTestDataId("allFailed")} | ||
| disabled={testDataId === "allFailed"} | ||
| > | ||
| All failed | ||
| </Button> | ||
|
|
||
| <Button | ||
| variant="destructive" | ||
| size="sm" | ||
| onClick={() => setTestDataId("")} | ||
| disabled={testDataId === ""} | ||
| > | ||
| Clear | ||
| </Button> | ||
| </div> |
There was a problem hiding this comment.
Test data and debugging UI must be removed before merging. This includes:
- The entire test data section (lines 361-429) with the red border and test buttons
- The TEMP_ constant imports (lines 20-24)
- The TEST_DATA object and testDataId state (lines 42-50)
- The logic that uses TEST_DATA to override diagnosticEvents (line 53)
These test utilities should not be present in production code.
| TEMP_FAILED, | ||
| TEMP_KALE, | ||
| TEMP_LONG_PARAMS, | ||
| TEMP_MIXED, | ||
| TEMP_SS, |
There was a problem hiding this comment.
Test data imports must be removed before merging. These TEMP_ constants (lines 20-24) are imported for testing purposes only and should not be present in production code. They are used in the test data section that needs to be removed.
|
Preview is available here: |
|
Preview is available here: |
| | { type: "map"; value: FormattedMapEntry[] } | ||
| | { type: "literal"; value: string } | ||
| | { type: "ellipsis"; value: string } | ||
| | { type: undefined; value: unknown }; |
There was a problem hiding this comment.
we can have an undefined formatted event data?
There was a problem hiding this comment.
It's used in formatEventData function when we can't find the type. Should we set a different value? We can't make it optional, because the type prop is required.
// line 245
return { value: data, type: undefined };
|
One piece of feedback is that when I loaded up the page, the first place I went was the transaction subsection to look for the dashboard. But then after clicking around for a bit I realised that the dashboard was a separate page outside that section. |
|
The label for the transaction hash is |
|
The state change view is AMAZING. |
* Adjust Tabs styling * Call stack trace tabs text
|
Preview is available here: |
|
@leighmcculloch I'm going to move some of your comments into tickets so that this PR can be cleaned up and merge. @quietbits Could we link contract ID internally to Lab's contract explorer with contract ID already prepopulated? |
|
Preview is available here: |
|
|
||
| return { | ||
| callStack, | ||
| coreMetrics, |
There was a problem hiding this comment.
coreMetrics isn't being used in CallStackTrace. Does this need to be returned?
| }; | ||
| } | ||
|
|
||
| const { callStack, coreMetrics } = processEvents(dEvents); |
There was a problem hiding this comment.
same here with coreMetrics. Where does this being used?







PrettyJsonbecause the use case here is slightly different (everything needs to work inline).