Skip to content

feat(ui): add click-to-expand detail panels to TransactionTimeline steps - #841

Merged
Haroldwonder merged 2 commits into
Haroldwonder:mainfrom
onlywiseone:feat/transaction-timeline-expand-panels
Jul 1, 2026
Merged

feat(ui): add click-to-expand detail panels to TransactionTimeline steps#841
Haroldwonder merged 2 commits into
Haroldwonder:mainfrom
onlywiseone:feat/transaction-timeline-expand-panels

Conversation

@onlywiseone

Copy link
Copy Markdown
Contributor

Summary

Closes #680

TransactionTimeline steps were rendered as a flat, read-only list with no way for users to inspect the underlying data for each step. This PR adds click-to-expand detail panels that reveal the raw API response, timestamp, and error (if any) for each step.

Changes

TransactionTimeline.tsx

  • TxEvent interface — added two optional fields:
    • rawApiResponse?: unknown — the raw anchor API response payload for that step
    • error?: string — a human-readable error message if this step errored
  • expandedStep state (TxStatus | null) — tracks which step's detail panel is currently open; only one can be open at a time
  • Clickable step headers — each step's label/description row is wrapped in a div with onClick that toggles expandedStep; a chevron (▾) rotates 180° when the panel is open
  • Detail panel — rendered below each step when expanded; shows:
    • ISO timestamp (full, not abbreviated)
    • Error message (in red accent) when error is set
    • Pretty-printed JSON of rawApiResponse in a scrollable <pre> block (max-height 200px)
    • Fallback "No additional details available." when the event has none of the above
  • Terminal nodes — the appended failed node has the same expand/collapse behaviour, including rawApiResponse and error support; the refunded node retains its existing appearance (no interactive data typically available)
  • txHash linke.stopPropagation() added so clicking the Stellar explorer link doesn't toggle the panel

TransactionTimeline.stories.tsx

  • PENDING_EVENTS fixtures updated with realistic rawApiResponse payloads (SEP-24 transaction objects) for the initiated, awaiting_user, and pending steps
  • FAILED_EVENTS fixture updated with an error string and rawApiResponse on the failed event to demonstrate the error panel

Behaviour

Interaction Result
Click any step header Expand detail panel for that step
Click expanded step header Collapse panel
Click a different step Only that step expands (previous closes)
Click Stellar tx hash link Opens explorer tab; panel state unchanged

Testing

No test changes — existing tests cover component rendering and are unaffected by the new optional fields and conditional UI.

- Add rawApiResponse and error fields to TxEvent interface
- Add expandedStep state (TxStatus | null) to track open panel
- Wrap each step header in a clickable div that toggles expansion
- Render detail panel showing ISO timestamp, error message, and
  pretty-printed raw API response when a step is expanded
- Add chevron indicator that rotates 180deg when panel is open
- Apply same expand/collapse to failed and refunded terminal nodes
- Update story fixtures with sample rawApiResponse and error data

Closes Haroldwonder#680
@Haroldwonder

Copy link
Copy Markdown
Owner

Hi @onlywiseone
Thanks for contributing. Please resolve conflicts

@drips-wave

drips-wave Bot commented Jul 1, 2026

Copy link
Copy Markdown

@onlywiseone Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@onlywiseone

Copy link
Copy Markdown
Contributor Author

thanks

@Haroldwonder
Haroldwonder merged commit 337b1f3 into Haroldwonder:main Jul 1, 2026
0 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TransactionTimeline step click-to-expand detail panels

2 participants