UI/UX: Show revert reason for failed transactions#3554
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the transaction details UI to surface revert reasons for failed transactions in the status row tooltip and a collapsible “Show revert reason” section, aligning the failed-tx experience with the referenced design/issue.
Changes:
- Introduces
TxDetailsStatusto render status + method + (when available) a collapsible revert-reason section, and wires it intoTxDetails. - Adds
getRevertReasonTextutility to extract a human-readable revert reason from decoded parameters for use in the status tooltip. - Restyles
TxRevertReason, adds Playwright coverage for revert-reason scenarios, and extends decoded-input table components to accept style props.
Reviewed changes
Copilot reviewed 11 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/slices/tx/utils/get-revert-reason-text.ts | Adds helper to extract a readable revert reason from decoded parameters. |
| src/slices/tx/pages/details/TxSubHeading.pw.tsx | Updates a mock tx status in a screenshot test. |
| src/slices/tx/pages/details/info/TxDetails.tsx | Replaces inline status/method rendering with TxDetailsStatus; removes separate “Revert reason” field row. |
| src/slices/tx/pages/details/info/TxDetails.pw.tsx | Removes revert-reason visual tests (moved to TxDetailsStatus). |
| src/slices/tx/pages/details/info/parts/TxRevertReason.tsx | Restyles revert reason display and handles missing/non-hex raw reasons; passes bg styling into decoded table. |
| src/slices/tx/pages/details/info/parts/TxDetailsStatus.tsx | New status/method component with tooltip text derived from revert reason and collapsible details block. |
| src/slices/tx/pages/details/info/parts/TxDetailsStatus.pw.tsx | New visual coverage for revert-reason variants and tooltip hover state. |
| src/slices/tx/mocks/details.ts | Adds mocks for revert-reason edge cases (missing reason, decoded param reason). |
| src/slices/log/components/LogDecodedInputDataTable.tsx | Allows passing Chakra style props down to the decoded input table grid. |
| src/slices/log/components/LogDecodedInputData.tsx | Adds inputsTableProps passthrough to style the decoded input table. |
| src/features/tx-interpretation/common/components/TxInterpretation.tsx | Colors “failed to call” text red by applying conditional span color. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description and Related Issue(s)
Resolves #3545
Reworks how failed transactions display revert reasons on the transaction details page, matching the Figma mockups. The status row now shows the revert reason in the error tooltip (when available), with a collapsible "Show revert reason" section for full details. "Failed to call" text in the sub-heading is styled in red.
Proposed Changes
TxDetailsStatuscomponent with an inline collapsible revert-reason blockgetRevertReasonTextutility to extract human-readable reason from decoded parametersTxRevertReasonwith a red background and handle missing/empty raw reasonsLogDecodedInputDataTableto accept style props for the revert-reason table backgroundTxInterpretationTxDetails.pw.tsxto dedicatedTxDetailsStatus.pw.tsxcoverageBreaking or Incompatible Changes
None.
Additional Information
Figma mockups
Checklist for PR author