Repository navigation
fix(orders): show Load More when cursor exists - #1126
Conversation
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
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
@greptile review |
|
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 theLoad Morepagination button whenevernextOrdersCursoris present on non-held order tabs even when the search query is empty. Deliver via theno-mistakespipeline as its own PR withFixes #1074in the PR summary.What Changed
filters.search.trim()condition gating theLoad Morebutton infrontend/src/app/(dashboard)/orders/page.tsxso pagination renders whenevernextOrdersCursoris non-null on non-held tabs.tests/orders-search.test.tsverifying thatLoad Morerenders with an empty search query on non-held tabs, stays hidden on theheldtab, 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 pageLoad Morebutton 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(coveringtests/orders-search.test.tsandtests/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 clickingLoad moreon non-held tabs (ActiveandAll) with an empty search input to append older orders (#ORD-20261014-0002and#ORD-20261014-0001) viaGET /api/orders?per_page=50&before_id=3and hiding the button whennextOrdersCursorbecomesnull, (2) verifying theHeldtab guard keepsLoad morehidden whilenextOrdersCursoris non-null, and (3) verifying paginated search queries (search=ORD-) continue to paginate viaLoad more. All checks and live scenarios passed.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" }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.
npm run test:orders-searchnpm run build && npm run build:frontendE2E_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.