Skip to content

fix(tables): filter orders by floorplan table - #1301

Merged
khaira777 merged 9 commits into
mainfrom
fm/ship-c1a0a11c-floorplan-view-order
Oct 22, 2026
Merged

khaira777 merged 9 commits into
mainfrom
fm/ship-c1a0a11c-floorplan-view-order

Conversation

@khaira777

@khaira777 khaira777 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1292

Intent

Update FloorplanEditor.tsx, tables/page.tsx, and orders/page.tsx so clicking "View order" on an occupied floorplan table navigates to /orders?table=<tableId> and orders/page.tsx syncs ?table= from useSearchParams() into filters.table (Issue #1292). Follow Ponytail / YAGNI, validate through /no-mistakes, trigger @greptileai review this at apex on the PR, and resolve any review findings.

What Changed

  • Pass the selected Table to FloorplanEditor's onViewOrder callback and update TablesPage to navigate to /orders?table=<tableId> when clicking "View order" on an occupied floorplan table.
  • Add OrdersTableQuerySync inside a Suspense boundary in OrdersPage to sync the ?table= query parameter into filters.table, and load /tables on demand when a table filter is active before table options are loaded.
  • Add test coverage in tests/orders-search.test.ts and frontend/e2e/floorplan-view-order-live.spec.ts for floorplan "View order" navigation and ?table= query filter synchronization.

Risk Assessment

✅ Low: The change is small, well-bounded to floorplan View Order navigation and OrdersPage ?table= query parameter synchronization, preserves authorization gates, and is covered by unit and E2E tests.

Testing

Ran the focused unit and integration suite (npm run test:orders-search), built the backend and static frontend (npm run build && npm run build:frontend), and drove all five floorplan View order and /orders?table= synchronization scenarios live against an isolated tests/e2e-server.cjs instance using Playwright Chromium (frontend/e2e/floorplan-view-order-live.spec.ts), capturing six reviewer-visible PNG screenshots in the evidence directory with all checks passing.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Clicking View order on a placed occupied floorplan table (with tables_required=false) navigates to /orders?table=<tableId>, loads table dropdown options on demand, selects that table in filters.table,… ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/02-orders-filtered-by-placed-table.png
Clicking View order on an unplaced occupied table in the floorplan tray (with tables_required=true) navigates to /orders?table=<tableId>, syncs filters.table to that table ID, and displays only that t… ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/04-orders-filtered-by-unplaced-table.png
Manually changing or clearing the table filter dropdown on /orders?table=<tableId> persists across re-renders (such as switching status tabs) without being overwritten while ?table= in the URL is unch… ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/05-orders-manual-override-and-url-reset.png
Navigating from /orders?table=<tableId> to /orders (removing the ?table= query parameter) resets filters.table to All Tables ('') and shows orders across all tables ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/05-orders-manual-override-and-url-reset.png
Clicking an available (unoccupied) table on the floorplan opens its action sheet with Reserve Table and does not expose a View order action ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/06-available-table-no-view-order.png

Placed occupied floorplan table action sheet showing View order
Orders page filtered by placed table T101 with tables_required=false
Unplaced occupied floorplan tray table action sheet showing View order
Orders page filtered by unplaced tray table T102 with tables_required=true
Orders page after manual filter override and navigating to /orders without ?table=
Available floorplan table action sheet without View order button

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 - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Clicking View order on a placed occupied floorplan table (with tables_required=false) navigates to /orders?table=<tableId>, loads table dropdown options on demand, selects that table in filters.table,… ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/02-orders-filtered-by-placed-table.png
Clicking View order on an unplaced occupied table in the floorplan tray (with tables_required=true) navigates to /orders?table=<tableId>, syncs filters.table to that table ID, and displays only that t… ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/04-orders-filtered-by-unplaced-table.png
Manually changing or clearing the table filter dropdown on /orders?table=<tableId> persists across re-renders (such as switching status tabs) without being overwritten while ?table= in the URL is unch… ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/05-orders-manual-override-and-url-reset.png
Navigating from /orders?table=<tableId> to /orders (removing the ?table= query parameter) resets filters.table to All Tables ('') and shows orders across all tables ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/05-orders-manual-override-and-url-reset.png
Clicking an available (unoccupied) table on the floorplan opens its action sheet with Reserve Table and does not expose a View order action ✅ pass live ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX/06-available-table-no-view-order.png
  • npm run test:orders-search
  • npm run build && npm run build:frontend
  • cd frontend && E2E_BASE_URL=http://127.0.0.1:43001 E2E_KDS_BASE_URL=http://127.0.0.1:43002 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43003 npx playwright test --config=playwright.config.ts --project=chromium e2e/floorplan-view-order-live.spec.ts
  • Playwright live Chromium capture against isolated tests/e2e-server.cjs on ports 43011-43013 producing 01..06 PNG screenshots in ~/.no-mistakes/evidence/01M5JTB9BJ5242B4RS4RE65ABX
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Oct 22, 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

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 khaira777 changed the title fix(frontend): filter orders by selected floorplan table fix(tables): filter orders by floorplan table Oct 22, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: apex

[Medium impact] The change reaches the floorplan-to-orders workflow and its table filter.

The navigation and filtering changes appear sound, but the new test comment must meet the repository’s two-line limit before merging.

Findings

  1. P2 Test comment exceeds the limit ▶

Summary

Clicking “View Order” now opens /orders?table=<tableId> and applies that table to the order filter.

  • View Order opens the Orders list filtered to its table.

The four earlier threads were checked: settled-value assertions are present, machine-local screenshot writes are gone, tab selectors use “All,” and the E2E comments were shortened. None of those threads supplied a comment number.

This review was read-only. Builds, tests, and browser checks were not rerun.

Diagram

sequenceDiagram
  actor Staff
  participant Floorplan as FloorplanEditor
  participant Tables as TablesPage
  participant Orders as OrdersPage
  participant API
  Staff->>Floorplan: View Order
  Floorplan->>Tables: onViewOrder(selected table)
  Tables->>Orders: "/orders?table=<id>"
  Orders->>Orders: Set filters.table
  opt Table options are not loaded
    Orders->>API: GET /tables
  end
  Orders->>API: "GET /orders?table_id=<id>"
  API-->>Orders: Matching orders
Loading

Reviews (4) · Last reviewed commit: "fix(orders): load table options on deman..." · Reviewed by Greptile

Comment thread tests/orders-search.test.ts Resolved
@khaira777 khaira777 changed the title fix(tables): filter orders by floorplan table fix(frontend): filter orders by table when viewing order from floorplan Oct 22, 2026
@khaira777 khaira777 changed the title fix(frontend): filter orders by table when viewing order from floorplan fix(tables): filter orders by floorplan table Oct 22, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@khaira777
khaira777 force-pushed the fm/ship-c1a0a11c-floorplan-view-order branch from 8bdfc52 to 0786e7a Compare October 22, 2026 20:56
@khaira777 khaira777 changed the title fix(tables): filter orders by floorplan table fix(frontend): filter orders by selected floorplan table Oct 22, 2026
@khaira777 khaira777 changed the title fix(frontend): filter orders by selected floorplan table fix(tables): filter orders by floorplan table Oct 22, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@khaira777
khaira777 force-pushed the fm/ship-c1a0a11c-floorplan-view-order branch from 0786e7a to d96bd22 Compare October 22, 2026 21:38
@khaira777 khaira777 changed the title fix(tables): filter orders by floorplan table fix(frontend): filter orders by table when viewing order from floorplan Oct 22, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@khaira777 khaira777 changed the title fix(frontend): filter orders by table when viewing order from floorplan fix(tables): filter orders by floorplan table Oct 22, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

Comment thread tests/orders-search.test.ts Resolved
@khaira777 khaira777 changed the title fix(tables): filter orders by floorplan table fix(frontend): filter orders by table when viewing order from floorplan Oct 22, 2026
@khaira777 khaira777 changed the title fix(frontend): filter orders by table when viewing order from floorplan fix(tables): filter orders by floorplan table Oct 22, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@khaira777
khaira777 merged commit 7d5e74d into main Oct 22, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/ship-c1a0a11c-floorplan-view-order branch October 22, 2026 23:17
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(tables): filter /orders by clicked table from floorplan View Order action

1 participant