Skip to content

feat(marketplace): add sortable face value and deadline columns (#35) - #51

Open
apatafamilycompound123-ops wants to merge 1 commit into
StellarState:devfrom
apatafamilycompound123-ops:feat/sortable-invoice-marketplace
Open

feat(marketplace): add sortable face value and deadline columns (#35)#51
apatafamilycompound123-ops wants to merge 1 commit into
StellarState:devfrom
apatafamilycompound123-ops:feat/sortable-invoice-marketplace

Conversation

@apatafamilycompound123-ops

Copy link
Copy Markdown

Summary

Adds sortable column headers to the invoice marketplace so investors can compare invoices by face value or funding deadline without manually scrolling.

Implements #35.

Scope

  • Clickable sort headers for Face Value and Deadline
  • First click sorts ascending, second click sorts descending, third click removes sort (returns to default)
  • Sort direction arrow shown on the active column
  • Active sort persisted in URL query params (?sort=faceValue&order=asc, ?sort=deadline&order=asc) so it survives a page refresh
  • Sort resets to default when the user clears all filters

Changes

  • lib/invoice-sort.ts — pure helpers: cycleSort, sortInvoices, parseSortState, serializeSortState
  • components/marketplace/sort-header.tsx — presentational sort header with direction indicators
  • app/marketplace/page.tsx — wires sort state, URL persistence, and applies sorting to the filtered list
  • Unit tests for the sorting helpers and the sort header component

Acceptance Criteria

  • Clicking 'Face Value' sorts ascending, then descending, then resets
  • Clicking 'Deadline' sorts ascending, then descending, then resets
  • Sort direction arrow visible on the active column
  • Active sort persisted in URL query params
  • Sort resets when filters are cleared

Testing

npm test

New tests: lib/__tests__/invoice-sort.test.ts (13) and components/marketplace/__tests__/sort-header.test.tsx (4) — all passing. Pre-existing recentlyViewed localStorage jsdom failures are unrelated (present on baseline).

Closes #35

Add clickable sort headers to the invoice marketplace for Face Value and
Deadline. Each column cycles ascending, descending, then resets to the
default order, with a direction arrow shown on the active column. The
active sort is persisted in URL query params and reset when filters are
cleared. Includes unit tests for the sorting helpers and sort header.
@drips-wave

drips-wave Bot commented Aug 2, 2026

Copy link
Copy Markdown

@apatafamilycompound123-ops 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

@apatafamilycompound123-ops

Copy link
Copy Markdown
Author

@Chucks1093 done closes #35

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 a sortable column header to the invoice marketplace table allowing sorting by face value and deadline

1 participant