Skip to content

Refactor transactions page for mobile responsiveness#778

Merged
jamespepper81 merged 2 commits into
devfrom
claude/gracious-gauss-rye7d0
Jun 17, 2026
Merged

Refactor transactions page for mobile responsiveness#778
jamespepper81 merged 2 commits into
devfrom
claude/gracious-gauss-rye7d0

Conversation

@jamespepper81

Copy link
Copy Markdown
Contributor

Summary

Refactored the transactions page to improve mobile responsiveness and code maintainability by:

  1. Extracted shared logic into utility functions (getTxDerived, StatusBadge, TxIdentity) to eliminate duplication and improve consistency
  2. Implemented responsive layouts: Desktop uses a table (sm+), mobile uses stacked cards (below sm) to prevent column overlap on small screens
  3. Improved address truncation: Uses min-w-0 + truncate for graceful width yielding instead of fixed max-width constraints
  4. Enhanced mobile UX: Added TransactionCard component for better touch targets and readability on mobile devices
  5. Cleaned up styling: Removed unnecessary padding overrides and improved spacing consistency across breakpoints

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactor / cleanup

Test Plan

  • Verified responsive behavior at multiple breakpoints (mobile, tablet, desktop)
  • Confirmed table layout displays correctly on sm+ screens
  • Confirmed card layout displays correctly on mobile screens
  • Tested address truncation with long addresses
  • Verified status badges render correctly in both layouts
  • Confirmed transaction links navigate properly in both layouts

Checklist

  • npm run typecheck passes
  • npm run lint passes
  • No new tests required (refactor of existing UI)
  • No documentation updates needed

https://claude.ai/code/session_01Q4xBbTDDCCxzmFGzGpo1PC

On narrow screens the transaction history table squeezed its rigid
columns (whitespace-nowrap amounts/status, default p-4 padding, px-0
content, max-w-[80px] address cap) until content overlapped before the
horizontal scrollbar engaged.

Replace the cramped table-on-mobile with a responsive layout:
- Below sm, render each transaction as a stacked card (details on top,
  amount + status on a second row), eliminating sideways scroll.
- Keep the existing table for sm+ (Fiat column still shows at md+).
- Extract shared logic/markup (getTxDerived, TxIdentity, StatusBadge) so
  the row and card stay DRY; fix address truncation with min-w-0 +
  truncate instead of a fixed-width cap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4xBbTDDCCxzmFGzGpo1PC
@jamespepper81

Copy link
Copy Markdown
Contributor Author

@claude can you code review the pr 778 and make any changes required

Code review follow-up: role="listitem" was set directly on the card's
<Link> (an <a href>), which overrides the anchor's implicit "link" role
so screen readers no longer announce each card as a link. Move
role="listitem" to a wrapper div so the list semantics and the link
semantics both survive.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4xBbTDDCCxzmFGzGpo1PC

Copy link
Copy Markdown
Contributor Author

Code review — PR #778

Reviewed the diff (single file, src/app/(app)/transactions/page.tsx, a presentational refactor that splits the transaction list into a desktop table + mobile stacked cards). Checked correctness, behavior parity, cross-file callers, reuse, and a11y.

Behavior parity — ✅

  • Derived values, currency formatting, unique labels, and BTC/fiat signs are all preserved (now centralized in getTxDerived).
  • Desktop table column alignment is unchanged — the removed pl-4 sm:pl-0 / pr-4 sm:pr-0 overrides shift header and body padding together, so columns stay aligned.
  • Empty state and "Load More" pagination work in both the card and table views.

One issue found & fixed (3af6899)

  • role="listitem" was set directly on the card's <Link>. An explicit ARIA role overrides an <a href>'s implicit link role, so screen readers would announce each card as a list item but not as a link — an a11y regression. Moved role="listitem" to a wrapper <div> so both the list semantics and the link semantics survive.

npm run typecheck and npm run lint pass. No other changes required — the rest of the diff is a clean, DRY refactor.

Note: a pixel-level mobile screenshot wasn't possible in this environment (no browser + the page needs a connected wallet), so the responsive layout is verified by code review + type/lint, not a visual capture.


Generated by Claude Code

@jamespepper81 jamespepper81 merged commit 7f7a0db into dev Jun 17, 2026
5 checks passed
@jamespepper81 jamespepper81 deleted the claude/gracious-gauss-rye7d0 branch June 17, 2026 11:51
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.

2 participants