Description: src/components/SolverHeaderCard.test.tsx and src/components/SolverFillHistory.test.tsx already exist and each define an inline local implementation of the component under test — but no SolverHeaderCard.tsx or SolverFillHistory.tsx actually exists in src/components/. Meanwhile, src/app/solve/[address]/page.tsx duplicates the same header-card and fill-history markup inline, and separately references CopyButton, SkeletonCard, and isValidStellarPublicKey without importing them. Extract the two real components and wire the page to use them.
Problem Statement & Context: This is duplicated, drifting logic hiding a broken page: solve/[address]/page.tsx currently cannot compile as written (missing imports), and the two test files describe a cleaner component boundary that was never actually built, leaving the tests validating throwaway inline copies rather than real shipped code.
Scope & Acceptance Criteria:
- Create
src/components/SolverHeaderCard.tsx and src/components/SolverFillHistory.tsx matching the interfaces implied by their existing test files (solver: Solver prop for the header card; solverAddress: string prop for the fill history, internally using useIntentFeed).
- Update
src/app/solve/[address]/page.tsx to import and render these two components instead of its inline duplicated markup, and fix the missing CopyButton/SkeletonCard/isValidStellarPublicKey imports.
- Update
SolverHeaderCard.test.tsx and SolverFillHistory.test.tsx to import the real components instead of defining local inline copies.
- Out of scope: changing either component's visual design beyond what's needed to match the existing test expectations and page layout.
Implementation Guidelines:
- Key files:
src/components/SolverHeaderCard.test.tsx, src/components/SolverFillHistory.test.tsx, src/app/solve/[address]/page.tsx, src/lib/stellarAddress.ts, src/components/CopyButton.tsx, src/components/Skeleton.tsx.
- Match the props/behavior already asserted in the two test files exactly, since those tests should pass unmodified (aside from the import swap) once the real components exist.
- Edge cases:
SolverFillHistory's existing inline version filters useIntentFeed's 8-item-capped feed by solver === solverAddress, which may under-represent a solver's full history — consider (and note in the PR, even if not fixed here) whether it should use a different, unbounded data source; at minimum, don't silently change this behavior without flagging it.
- Testing:
npm run typecheck must pass (this file currently would not compile); run SolverHeaderCard.test.tsx and SolverFillHistory.test.tsx against the real components; add a page.test.tsx case for solve/[address] confirming the extracted components render with real solver data.
Definition of Done:
- Code written, tested;
solve/[address]/page.tsx compiles and renders correctly with no missing imports.
- Both orphaned test files now validate real, shipped components.
- PR passes CI (
npm run typecheck, npm test, npm run build).
- Reviewed and approved.
Resources: src/components/SolverHeaderCard.test.tsx, src/components/SolverFillHistory.test.tsx, src/app/solve/[address]/page.tsx
Complexity: High (200 points)
Description:
src/components/SolverHeaderCard.test.tsxandsrc/components/SolverFillHistory.test.tsxalready exist and each define an inline local implementation of the component under test — but noSolverHeaderCard.tsxorSolverFillHistory.tsxactually exists insrc/components/. Meanwhile,src/app/solve/[address]/page.tsxduplicates the same header-card and fill-history markup inline, and separately referencesCopyButton,SkeletonCard, andisValidStellarPublicKeywithout importing them. Extract the two real components and wire the page to use them.Problem Statement & Context: This is duplicated, drifting logic hiding a broken page:
solve/[address]/page.tsxcurrently cannot compile as written (missing imports), and the two test files describe a cleaner component boundary that was never actually built, leaving the tests validating throwaway inline copies rather than real shipped code.Scope & Acceptance Criteria:
src/components/SolverHeaderCard.tsxandsrc/components/SolverFillHistory.tsxmatching the interfaces implied by their existing test files (solver: Solverprop for the header card;solverAddress: stringprop for the fill history, internally usinguseIntentFeed).src/app/solve/[address]/page.tsxto import and render these two components instead of its inline duplicated markup, and fix the missingCopyButton/SkeletonCard/isValidStellarPublicKeyimports.SolverHeaderCard.test.tsxandSolverFillHistory.test.tsxto import the real components instead of defining local inline copies.Implementation Guidelines:
src/components/SolverHeaderCard.test.tsx,src/components/SolverFillHistory.test.tsx,src/app/solve/[address]/page.tsx,src/lib/stellarAddress.ts,src/components/CopyButton.tsx,src/components/Skeleton.tsx.SolverFillHistory's existing inline version filtersuseIntentFeed's 8-item-capped feed bysolver === solverAddress, which may under-represent a solver's full history — consider (and note in the PR, even if not fixed here) whether it should use a different, unbounded data source; at minimum, don't silently change this behavior without flagging it.npm run typecheckmust pass (this file currently would not compile); runSolverHeaderCard.test.tsxandSolverFillHistory.test.tsxagainst the real components; add apage.test.tsxcase forsolve/[address]confirming the extracted components render with real solver data.Definition of Done:
solve/[address]/page.tsxcompiles and renders correctly with no missing imports.npm run typecheck,npm test,npm run build).Resources:
src/components/SolverHeaderCard.test.tsx,src/components/SolverFillHistory.test.tsx,src/app/solve/[address]/page.tsxComplexity: High (200 points)