Skip to content

Add filtering and pagination to merchant list#671

Merged
StuartFerguson merged 6 commits intomainfrom
copilot/add-filters-to-merchant-list
Jan 19, 2026
Merged

Add filtering and pagination to merchant list#671
StuartFerguson merged 6 commits intomainfrom
copilot/add-filters-to-merchant-list

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 18, 2026

Merchant list lacked ability to filter by key fields or navigate large datasets. Added 5 filters (name, reference, settlement schedule, region, postcode) and pagination with configurable page size.

Changes

UI Enhancements

  • Added filter controls in responsive 5-column grid
  • Added Region and Postcode columns to merchant table
  • Added pagination controls (First/Previous/Next/Last) with result count display
  • Added configurable page size selector (5, 10, 25, 50 items per page)
  • Summary cards now reflect filtered results

Backend

  • Expanded mock merchant data from 3 to 12 entries with Region/PostalCode populated
  • Added unit tests for filter UI, pagination display, and new columns

Performance

  • Single-pass LINQ filtering with compound predicate instead of chained Where clauses
  • Cached filtered/paged results and totalPages to avoid recomputation
  • Filters trigger on blur/change rather than per-keystroke
  • Auto-reset pagination to page 1 when filters or page size changes
// Combined filtering in single pass
_filteredMerchants = allMerchants.Where(m =>
    (string.IsNullOrWhiteSpace(_filterName) || 
     (m.MerchantName?.Contains(_filterName, StringComparison.OrdinalIgnoreCase) ?? false)) &&
    (string.IsNullOrWhiteSpace(_filterReference) || 
     (m.MerchantReference?.Contains(_filterReference, StringComparison.OrdinalIgnoreCase) ?? false)) &&
    // ... other filters
).ToList();

All filters work independently and in combination. Clear Filters button resets all state. Users can adjust the number of items displayed per page using the page size selector (default: 10 items).

> [!WARNING]
>
>

Original prompt

>
> ----
>
> This section details on the original issue you should resolve
>
> <filter_complete></filter_complete>

<issue_title>Merchant List needs new filters</issue_title>
><issue_description>Reference
> Name
> Settlement Schedule
> Region
> Postcode
>
> Add in paging as well to the list</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
>
>

Original prompt

This section details on the original issue you should resolve

<issue_title>Merchant List needs new filters</issue_title>
<issue_description>Reference
Name
Settlement Schedule
Region
Postcode

Add in paging as well to the list</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits January 18, 2026 21:22
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new filters and paging to merchant list Add filtering and pagination to merchant list Jan 18, 2026
Copilot AI requested a review from StuartFerguson January 18, 2026 21:31
@StuartFerguson
Copy link
Copy Markdown
Member

@copilot can you make the pagination changeable maybe 5,10,25,50

Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 19, 2026

@copilot can you make the pagination changeable maybe 5,10,25,50

Done! Added a page size selector with options for 5, 10, 25, and 50 items per page. The selector is integrated into the pagination controls on the left side. When the page size changes, the list automatically resets to page 1 and recalculates the pagination. The pagination controls are now visible even when there's only one page, so users can always change the page size.

Commit: 91345f4

@StuartFerguson StuartFerguson marked this pull request as ready for review January 19, 2026 09:30
@StuartFerguson StuartFerguson merged commit b02ebc7 into main Jan 19, 2026
10 checks passed
@github-actions github-actions Bot deleted the copilot/add-filters-to-merchant-list branch March 21, 2026 00:58
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.

Merchant List needs new filters

2 participants