Skip to content

fix(orders): show Load More when cursor exists - #1126

Merged
khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1074-r1
Oct 13, 2026
Merged

khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1074-r1

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Intent

Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1074 ("Orders history Load More button hidden when search box is empty"): in frontend/src/app/(dashboard)/orders/page.tsx, render the Load More pagination button whenever nextOrdersCursor is present on non-held order tabs even when the search query is empty. Deliver via the no-mistakes pipeline as its own PR with Fixes #1074 in the PR summary.

What Changed

  • Removed the filters.search.trim() condition gating the Load More button in frontend/src/app/(dashboard)/orders/page.tsx so pagination renders whenever nextOrdersCursor is non-null on non-held tabs.
  • Added a regression test in tests/orders-search.test.ts verifying that Load More renders with an empty search query on non-held tabs, stays hidden on the held tab, and appends the next page of orders when clicked.

Fixes #1074

Risk Assessment

✅ Low: The change removes the unintended filters.search.trim() guard on the Orders page Load More button so cursor pagination works on non-held tabs when the search query is empty, covered by an executable behavioral test.

Testing

Ran npm run test:orders-search (covering tests/orders-search.test.ts and tests/orders-search-api.test.ts), built the backend and static frontend (npm run build && npm run build:frontend), and stood up an isolated FloCafe E2E server instance with 52 seeded takeaway orders to drive three live Chromium browser scenarios capturing visual screenshots and network traces: (1) rendering and clicking Load more on non-held tabs (Active and All) with an empty search input to append older orders (#ORD-20261014-0002 and #ORD-20261014-0001) via GET /api/orders?per_page=50&before_id=3 and hiding the button when nextOrdersCursor becomes null, (2) verifying the Held tab guard keeps Load more hidden while nextOrdersCursor is non-null, and (3) verifying paginated search queries (search=ORD-) continue to paginate via Load more. All checks and live scenarios passed.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Staff opens /orders on a non-held tab with an empty search input when more than 50 orders exist, sees the Load More button, and clicks it to fetch and append older orders until no further pages remain ✅ pass live ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/orders-empty-search-load-more-visible.png and ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/orders-empty…
Staff switches to the Held tab on /orders while nextOrdersCursor is non-null and search is empty, and the Load More button stays hidden until switching back to a non-held tab ✅ pass live ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/orders-held-tab-load-more-hidden.png
Staff enters a search query matching more than 50 orders on /orders, sees the Load More button for the first page of search results, and clicks it to fetch and append the next page of matching orders ✅ pass live ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/live-verification-trace.json

Orders screen with empty search box showing Load More button on Active tab
Orders Held tab hiding Load More button while nextOrdersCursor is non-null
Orders screen after clicking Load More with empty search appending oldest orders #ORD-20261014-0002 and #ORD-20261014-0001 and hiding Load More

Evidence: Live browser network and pagination trace for 52 seeded orders

{ "seededOrderCount": 52, "oldestOrder": { "id": 1, "order_number": "ORD-20261014-0001" }, "secondOldestOrder": { "id": 2, "order_number": "ORD-20261014-0002" }, "newestOrder": { "id": 52, "order_number": "ORD-20261014-0052" }, "emptySearchInitialPageCount": 50, "emptySearchNextCursor": 3, "emptySearchPage2Query": "?per_page=50&before_id=3", "searchQueryPage1NextCursor": 3, "searchQueryPage2Query": "?per_page=50&search=ORD-&before_id=3" }

{
  "seededOrderCount": 52,
  "oldestOrder": {
    "id": 1,
    "order_number": "ORD-20261014-0001"
  },
  "secondOldestOrder": {
    "id": 2,
    "order_number": "ORD-20261014-0002"
  },
  "newestOrder": {
    "id": 52,
    "order_number": "ORD-20261014-0052"
  },
  "emptySearchInitialPageCount": 50,
  "emptySearchNextCursor": 3,
  "emptySearchPage2Query": "?per_page=50&before_id=3",
  "searchQueryPage1NextCursor": 3,
  "searchQueryPage2Query": "?per_page=50&search=ORD-&before_id=3"
}

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Staff opens /orders on a non-held tab with an empty search input when more than 50 orders exist, sees the Load More button, and clicks it to fetch and append older orders until no further pages remain ✅ pass live ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/orders-empty-search-load-more-visible.png and ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/orders-empty…
Staff switches to the Held tab on /orders while nextOrdersCursor is non-null and search is empty, and the Load More button stays hidden until switching back to a non-held tab ✅ pass live ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/orders-held-tab-load-more-hidden.png
Staff enters a search query matching more than 50 orders on /orders, sees the Load More button for the first page of search results, and clicks it to fetch and append the next page of matching orders ✅ pass live ~/.no-mistakes/evidence/01M4VCHM74E62YP7ZCEPHV5QTM/live-verification-trace.json
  • npm run test:orders-search
  • npm run build && npm run build:frontend
  • E2E_BASE_URL=http://127.0.0.1:13001 E2E_KDS_BASE_URL=http://127.0.0.1:13002 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:13003 npx --prefix frontend playwright test --config=frontend/playwright.config.ts (live 52-order pagination verification across Active, Held, All, and search query states)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Render the Orders history Load More pagination button whenever nextOrdersCursor is present on non-held tabs even when the search query is empty.

Fixes #1074
@khaira777 khaira777 changed the title fix(frontend): show orders Load More button when search query is empty fix(orders): show Load More when cursor exists Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e89c3167-74d3-491d-8434-0c9c416f5d4a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@khaira777

Copy link
Copy Markdown
Contributor Author

@greptile review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; empty-search paging uses the existing supported fetch path.

Summary

Shows “Load More” on non-held order tabs whenever more orders are available, including when the search box is empty.

  • Non-held order lists show Load More for blank searches when another page exists.

Reviews (1) · Last reviewed commit: "fix(orders): show Load More without sear..." · Reviewed by Greptile

@khaira777
khaira777 enabled auto-merge (squash) October 13, 2026 21:26
@khaira777
khaira777 merged commit eca3913 into main Oct 13, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-issue-1074-r1 branch October 13, 2026 21:44
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.

fix(orders): allow pagination beyond 50 orders when search query is empty

1 participant