This document describes the implementation of the transaction detail page feature for Finchippay Solution, fulfilling all requirements specified in the issue.
-
Transaction Detail Page (
/tx/[txHash]) ✅- Mobile-first responsive design
- Card-based sections layout
- Single column on mobile, two-column grid on desktop
- Fetches transaction details from Stellar Horizon API
- Displays comprehensive transaction information
-
Status Timeline Component ✅
- Visual timeline showing transaction progression
- Steps: Created → Signed → Submitted → Confirmed
- Current step highlighted with animation
- Timestamps displayed for each step
- Color-coded status indicators
-
Action Buttons ✅
- View on Explorer: Opens Stellar Expert in new tab
- Copy Hash: Copies transaction hash to clipboard with toast confirmation
- Share Receipt: Uses Web Share API on mobile, copy link on desktop
- Download PDF: Generates PDF receipt with transaction details
-
PDF Receipt Generation ✅
- Uses jspdf + jspdf-autotable (already in package.json)
- Branded PDF with Finchippay header
- Includes all transaction details
- Professional formatting with colors and layout
-
Clickable Transaction Rows ✅
- Updated TransactionList.tsx to navigate to
/tx/[txHash]on click - Hover state indication
- Keyboard navigation support (Enter key)
- Stop propagation on action buttons to prevent conflicts
- Updated TransactionList.tsx to navigate to
-
Mobile Optimizations ✅
- Touch-friendly button sizes (min 44x44px)
- Responsive grid layout (single column → two columns)
- max-h-screen and overflow-y-auto for scrolling
- Bottom padding for mobile navigation
- Optimized spacing and typography for small screens
frontend/
├── pages/
│ └── tx/
│ └── [txHash].tsx (NEW) - Transaction detail page
├── components/
│ ├── TransactionTimeline.tsx (NEW) - Status timeline component
│ ├── TransactionActions.tsx (NEW) - Action buttons component
│ └── TransactionList.tsx (UPDATED) - Made rows clickable
├── lib/
│ └── generatePDF.ts (NEW) - PDF receipt generation
├── __tests__/
│ └── TransactionDetail.test.tsx (NEW) - Unit tests
├── e2e/
│ └── transaction-detail.spec.ts (NEW) - E2E tests
└── stories/
└── TransactionDetail.stories.tsx (NEW) - Storybook stories
Features:
- Fetches transaction from Horizon API using transaction hash
- Displays loading skeleton while fetching
- Error handling with user-friendly messages
- Responsive layout with mobile-first approach
- Six main sections:
- Overview (status, type, operations, amount)
- Parties (from/to addresses)
- Timeline (visual status progression)
- Details (hash, ledger, fee, timestamp, memo)
- Actions (buttons for various operations)
Layout:
- Mobile: Single column stack
- Desktop: Two-column grid with overview/parties left, timeline/details right
- Actions section full-width at bottom
Data Fetching:
const tx = await server.transactions().transaction(txHash).call();
const operations = await server.operations().forTransaction(txHash).call();Features:
- Visual timeline with 4 steps
- Each step has: label, timestamp, status (completed/current/pending)
- Color-coded circles: green for completed, blue for current, gray for pending
- Check icon for completed steps
- Animated pulse for current step
- Vertical connecting lines between steps
- Formatted timestamps using date-fns
Props:
interface TimelineStep {
label: string;
timestamp?: string;
status: "completed" | "current" | "pending";
}Features:
- Four action buttons in responsive grid
- Mobile: 1 column, Desktop: 2 columns
- Touch-friendly button sizes (min 44x44px)
- Loading states and disabled states
- Framer Motion animations on hover/tap
Actions:
- View on Explorer: Uses
explorerUrl()from stellar.ts - Copy Hash: Uses
copyToClipboard()utility, shows confirmation - Share Receipt: Navigator.share() on mobile, clipboard fallback
- Download PDF: Calls
generatePDFReceipt()function
Features:
- Professional branded PDF with Finchippay header
- Color-coded sections (primary blue, dark slate, light slate)
- Status badge (confirmed/failed)
- Transaction details table using jspdf-autotable
- Footer with generation timestamp
- Filename:
finchippay-receipt-{hash}.pdf
Sections:
- Header with branding
- Status badge
- Amount display (if payment)
- Details table (hash, timestamp, ledger, fee, from, to, memo)
- Footer with disclaimer
Changes:
- Added
onClickhandler to navigate to/tx/[txHash] - Added
cursor-pointerclass for visual feedback - Updated keyboard navigation: Enter key navigates to detail page
- Added
stopPropagation()to action buttons to prevent conflicts - Maintains existing functionality (copy, save contact, send again)
- ✅ Timeline renders all steps correctly
- ✅ Timeline shows completed, current, and pending states
- ✅ Actions component renders all buttons
- ✅ Copy hash functionality works
- ✅ Shows "Copied!" confirmation message
- ✅ Transaction detail page displays correctly
- ✅ Mobile responsive at 375px width
- ✅ Status timeline is visible
- ✅ Action buttons work (copy, share, explorer, PDF)
- ✅ Touch-friendly buttons (min 44x44px)
- ✅ Navigation back to transactions list
- ✅ Error handling for invalid transaction hash
- ✅ Desktop layout on wide screens (1280px)
- Timeline: All completed, In progress, Failed states
- Actions: Default state with all buttons
- Viewport Meta Tag: Already configured in Next.js
- Touch Targets: All buttons min 44x44px height
- Responsive Grid:
- Mobile:
grid-cols-1(single column) - Desktop:
md:grid-cols-2(two columns)
- Mobile:
- Scrolling: Uses
max-h-screenandoverflow-y-auto - Bottom Padding:
pb-20 md:pb-8for mobile navigation - Typography: Scaled appropriately for readability
- Spacing: Reduced on mobile, expanded on desktop
- Buttons: Responsive grid with proper gaps
- Two-Column Layout: Overview & Parties | Timeline & Details
- Full-Width Actions: Actions section spans both columns
- Hover States: Visual feedback on hover for all interactive elements
- Larger Typography: More prominent headings and text
- Expanded Spacing: More breathing room between elements
- Keyboard Navigation: All interactive elements are keyboard accessible
- ARIA Labels: Buttons have descriptive aria-labels
- Semantic HTML: Proper heading hierarchy (h1 → h2)
- Focus States: Visible focus indicators
- Color Contrast: WCAG AA compliant color combinations
- Touch Targets: Minimum 44x44px for touch accessibility
- Data Fetching: Single API call to Horizon, parallel operations fetch
- Loading States: Skeleton screens prevent layout shift
- Code Splitting: Automatic with Next.js dynamic routing
- Lazy Loading: Framer Motion animations optimized
- Image Optimization: No images in initial implementation
- Bundle Size: Leverages existing dependencies (jspdf already included)
The implementation passes all CI checks specified in .github/workflows/ci.yml:
- ✅ Lint: No linting errors
- ✅ Type-check: TypeScript compilation successful
- ✅ Unit tests: All tests pass
- ✅ Build: Next.js build succeeds
- ✅ E2E tests: Playwright tests pass
- ✅ Transaction detail page coverage: New tests added
- ✅ Storybook: Stories added for new components
// From TransactionList
<div onClick={() => router.push(`/tx/${tx.transactionHash}`)}>
{/* Transaction row */}
</div>
// Direct URL
https://finchippay.com/tx/abc123def456...await copyToClipboard(transactionHash);await generatePDFReceipt(transaction);// Mobile (Web Share API)
await navigator.share({
title: "Transaction Receipt",
url: shareUrl,
});
// Desktop (Clipboard fallback)
await copyToClipboard(shareUrl);- Modern Browsers: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Mobile: iOS 14+, Android 8+
- Web Share API: Graceful fallback to clipboard on unsupported browsers
- PDF Generation: Works in all browsers with jspdf support
All dependencies were already in package.json:
jspdf: ^4.2.1jspdf-autotable: ^5.0.8framer-motion: ^12.42.2date-fns: ^3.6.0@stellar/stellar-sdk: ^15.1.0next: 14.2.3react: ^18.3.1
Potential improvements for future iterations:
- QR code generation for transaction hash
- Related transactions section (previous/next in account history)
- Transaction simulation replay
- Multi-language support for PDF receipts
- Email receipt functionality
- Transaction tagging/notes
- Favorite/bookmark transactions
- Export to other formats (JSON, CSV)
This implementation fulfills all requirements specified in the issue:
- ✅ Full transaction detail page at
/tx/[txHash] - ✅ Mobile-first responsive design
- ✅ Card-based layout
- ✅ Visual status timeline
- ✅ Action buttons (explorer, copy, share, PDF)
- ✅ Clickable transaction rows
- ✅ Touch-friendly buttons (min 44x44px)
- ✅ All acceptance criteria met
- ✅ CI tests pass
The feature is production-ready and follows all best practices for React, Next.js, TypeScript, and mobile-first responsive design.