Skip to content

Multi-Column Sortable Invoice List Table #478

Description

@Kingsman-99

Description

The invoice list currently renders as a simple card grid ordered by creation date with no way to re-sort by amount, status, or due date. A sortable table view with column headers that toggle ascending and descending sort order should be added alongside the existing card view.

Technical Context

src/components/invoice/InvoiceTable.tsx (new) renders a <table> with columns for Title, Amount, Status, Recipients, Created, and Due Date. Clicking a column header calls router.replace to set ?sort=amount&order=asc in the URL. src/hooks/useInvoices.ts passes the sort parameters to src/app/api/invoices/route.ts. Column headers use aria-sort="ascending" or "descending" attributes. A view-mode toggle in src/app/invoice/page.tsx switches between table and card grid.

Acceptance Criteria

  • Clicking a column header sorts the list by that column and shows a sort direction icon
  • Clicking the same header a second time reverses the sort order
  • Sort state is reflected in the URL and is restored when returning to the page
  • The table is horizontally scrollable in its own container on screens narrower than the table width
  • A view toggle button persists the user's preference (table vs card) in localStorage
  • All CI checks (npm test, npm run build, ESLint/TypeScript) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highuiUI styling and visual changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions