From d026f2b2afc63f9c265aea336ddfe76ecbc113b0 Mon Sep 17 00:00:00 2001 From: bambuska-man Date: Sun, 30 Aug 2026 11:56:56 +0000 Subject: [PATCH] feat: swap prefill, repeat swap, solver draft, semantic tables (#276 #277 #278 #279) - #279: extend SwapCard with initialChain/initialSrcToken/initialDstToken props with graceful fallback; homepage reads ?srcChain/srcToken/amount/dstToken via useSearchParams (Suspense-wrapped) and passes them as prefill values - #276: add Swap again link to my-intents rows building the prefill URL; destination address intentionally omitted; pagination UI added - #277: new useLocalStorageDraft hook (debounced write, 24h TTL, wallet-address guard); wired into SolvePageClient to persist address/bond across reloads, cleared on success and reset - #278: convert ExplorePageClient and my-intents intent lists from div stacks to native table/thead/tbody/tr/th/td markup with real column headers so screen readers announce column context and table navigation mode works Also fix pre-existing syntax corruptions in explore/page.tsx, solve/page.tsx and solve/[address]/page.test.tsx (stray JSX fragments and missing closing brace) Closes #276 Closes #277 Closes #278 Closes #279 --- src/app/explore/ExplorePageClient.tsx | 75 +++++++++----- src/app/explore/page.tsx | 9 +- src/app/my-intents/page.tsx | 137 +++++++++++++++++++++----- src/app/page.tsx | 25 ++++- src/app/solve/SolvePageClient.tsx | 45 ++++++++- src/app/solve/[address]/page.test.tsx | 2 +- src/app/solve/page.tsx | 7 +- src/components/SwapCard.tsx | 37 ++++++- src/hooks/useLocalStorageDraft.ts | 122 +++++++++++++++++++++++ 9 files changed, 392 insertions(+), 67 deletions(-) create mode 100644 src/hooks/useLocalStorageDraft.ts diff --git a/src/app/explore/ExplorePageClient.tsx b/src/app/explore/ExplorePageClient.tsx index 10af3f1..fd6f982 100644 --- a/src/app/explore/ExplorePageClient.tsx +++ b/src/app/explore/ExplorePageClient.tsx @@ -132,28 +132,59 @@ export default function ExplorePageClient() { ) : ( <> -
- {paginated.map((item) => ( - -
-
- {item.srcAmount} {item.srcToken} → {item.dstToken} -
-
- {item.srcChain} · via {item.solver} -
-
- - - {timeAgo(item.createdAt)} - - - ))} + {/* + Native so screen readers announce column headers, row/column + counts, and allow table-navigation mode. + Visual layout is preserved via display:block tricks on narrow viewports + if needed, but the semantic structure stays table-based. + */} +
+
+ + + + + + + + + + {paginated.map((item) => ( + + + + + + + ))} + +
+ Swap + + Chain · Solver + + Status + + Age +
+ + {item.srcAmount} {item.srcToken} → {item.dstToken} + + + {item.srcChain} · via {item.solver} + + + + {timeAgo(item.createdAt)} +
{pageCount > 1 && ( diff --git a/src/app/explore/page.tsx b/src/app/explore/page.tsx index b0b1671..6bf6ab8 100644 --- a/src/app/explore/page.tsx +++ b/src/app/explore/page.tsx @@ -252,11 +252,6 @@ export default function ExplorePage() { )}