Skip to content

fix(customers): preserve address on customer edit - #1131

Merged
khaira777 merged 4 commits into
mainfrom
fm/flocafe-issue-1084-r1
Oct 14, 2026
Merged

khaira777 merged 4 commits into
mainfrom
fm/flocafe-issue-1084-r1

Conversation

@khaira777

@khaira777 khaira777 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1084

Intent

Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1084 ("Customer create/edit modal omits address and notes fields supported by backend"): add address and notes inputs to the customer create/edit modal in frontend/src/app/(dashboard)/customers/page.tsx wired to the existing backend POST/PUT /api/customers fields and existing i18n keys. Deliver via the no-mistakes pipeline as its own PR with Fixes #1084 in the PR summary.

What Changed

  • Added optional address input and notes textarea (500-character limit) to the customer create/edit modal in frontend/src/app/(dashboard)/customers/page.tsx, wired to POST /api/customers and PUT /api/customers/:id using existing pos.customerAddress, common.optional, and orders.notesOptional i18n keys, and added notes?: string | null to the Customer interface in frontend/src/lib/types.ts.
  • Omitted unchanged address values from PUT /api/customers/:id payloads when editing an existing customer so legacy or non-conforming stored addresses do not block unrelated edits, surfaced backend error messages on save failure, and added max-h-[90vh] overflow-y-auto so the modal remains scrollable on smaller viewports.
  • Extended unit/integration coverage in tests/customer-top-items-ui.test.ts and Playwright E2E coverage in frontend/e2e/customer-address-round-trip.spec.ts for creating, editing, clearing, and preserving customer address and notes fields from the /customers modal.

Fixes #1084

Risk Assessment

✅ Low: The change is a small, well-bounded UI update that wires the existing backend customer address and notes fields and existing i18n keys into the Customers page create/edit modal with comprehensive unit and E2E coverage.

Testing

Ran the focused unit/UI test suite (npm run test:customer-top-items) and stood up the live E2E backend and static desktop frontend to drive e2e/customer-address-round-trip.spec.ts in headless Chromium via Playwright, capturing 6 visual evidence screenshots in ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV; all 4 live scenarios and all unit/E2E assertions passed.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Create a customer on the Customers page with address and notes, then verify POST /api/customers persists both fields and the Edit Customer modal hydrates them ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-page-add-modal.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-address-round-tri…
Edit and clear a customer's address and notes on the Customers page, then verify PUT /api/customers/:id updates and clears both fields and re-opening the Add Customer modal resets all inputs ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-page-edit-modal.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-address-round-tr…
Preserve an unchanged legacy over-limit (>300 chars) address when editing unrelated customer fields, and surface the backend validation error toast while keeping the modal open when a changed address… ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-page-address-validation-error.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-ad…
Constrain the Customers page modal to 90vh with vertical scrolling on a short 667x320 viewport so the address, notes, and submit controls remain reachable ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-modal-landscape.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-address-round-tr…

Customers page Add Customer modal with address and notes inputs populated
Customers page Edit Customer modal hydrated with saved address and notes
Customers page Edit Customer modal showing backend validation toast when address exceeds 300 characters
Customers page Add Customer modal scrolling within a short 667x320 viewport
Orders quick-add customer modal with address input populated
POS Edit Customer modal hydrated with saved customer address

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 - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Create a customer on the Customers page with address and notes, then verify POST /api/customers persists both fields and the Edit Customer modal hydrates them ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-page-add-modal.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-address-round-tri…
Edit and clear a customer's address and notes on the Customers page, then verify PUT /api/customers/:id updates and clears both fields and re-opening the Add Customer modal resets all inputs ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-page-edit-modal.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-address-round-tr…
Preserve an unchanged legacy over-limit (>300 chars) address when editing unrelated customer fields, and surface the backend validation error toast while keeping the modal open when a changed address… ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-page-address-validation-error.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-ad…
Constrain the Customers page modal to 90vh with vertical scrolling on a short 667x320 viewport so the address, notes, and submit controls remain reachable ✅ pass live ~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV/customers-modal-landscape.png; npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-address-round-tr…
  • npm run test:customer-top-items
  • EVIDENCE_DIR=~/.no-mistakes/evidence/01M4VV82BC3ZHP3631GY122MEV npx playwright test --config=playwright.config.ts --project=chromium e2e/customer-address-round-trip.spec.ts
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@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: 3429b54b-5a2e-4941-8d79-526da2cfda97

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): add address and notes fields to customer create/edit modal fix(customers): add address and notes to modal Oct 13, 2026
@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: 3/5

[Medium impact] Adds address and notes fields to the customer modal.

Fix the browser test's output path, preserve edits to customers with older long addresses, and satisfy the comment-writing rule before merging.

Findings

  1. P1 Browser test fails on Ubuntu ▶
  2. P1 Long addresses block unrelated edits ▶
  3. P2 Save button can fall offscreen ▶
  4. P2 Shared customer type misses notes ▶
  5. P2 Comments repeat the code ▶

Summary

Adds optional address and notes fields to the customer create/edit modal.

  • Customer forms now save address and notes.
  • The existing top-items tests keep the same behavior.

Reviews (1) · Last reviewed commit: "no-mistakes(document): Verify customer m..." · Reviewed by Greptile

@khaira777

Copy link
Copy Markdown
Contributor Author

The feature is useful, but I found several issues that should be addressed before merging.

1. Preserve existing customer records

The edit form now sends address on every update. The backend validates every supplied address, but intentionally allows older addresses over the current limit to remain unchanged.

This means editing only a customer's name or phone can fail if they have a legacy over-limit address.

Please omit an unchanged address from edit requests. Continue sending it when the user actually changes or clears the address.

2. Fix modal scrolling

Adding Address and Notes makes the modal taller. The current centered modal has no viewport height limit or internal scrolling, so the Save button can become unreachable on short screens.

Constrain the modal to the available viewport height and allow vertical scrolling. Verify that all fields and buttons remain accessible on a phone in landscape mode.

3. Update the shared Customer type

Add the supported notes?: string | null field to the shared Customer interface in frontend/src/lib/types.ts. Remove the local type cast used to read customer notes.

4. Add focused regression coverage

Please verify:

  • Creating a customer with address and notes.
  • Editing and clearing both fields.
  • Editing an unrelated field on a customer with an existing over-limit address.
  • Address validation when the address is actually changed.
  • Reopening Add Customer without retaining the previous customer's data.
  • Reaching the Save button on short mobile viewports.

The PR currently reports no completed live product validation. Please run the relevant automated tests and actual browser validation, and include the results.

Keep the changes focused. Do not alter the database schema, phone validation, or unrelated customer functionality. Avoid unnecessary formatting changes.

@khaira777
khaira777 force-pushed the fm/flocafe-issue-1084-r1 branch from 4f0678f to 9dcfba6 Compare October 14, 2026 00:10
@khaira777 khaira777 changed the title fix(customers): add address and notes to modal fix(customers): add address and notes fields to customer modal Oct 14, 2026
@khaira777 khaira777 changed the title fix(customers): add address and notes fields to customer modal fix(customers): add address and notes to modal Oct 14, 2026
@khaira777 khaira777 changed the title fix(customers): add address and notes to modal fix(customers): preserve address on customer edit Oct 14, 2026
Add bounded address and notes inputs to the customer create/edit modal in frontend/src/app/(dashboard)/customers/page.tsx, wired to existing POST/PUT /api/customers fields and existing i18n keys.

Fixes #1084
…idation spec (`frontend/e2e/tmp-issue-1084-validation.spec.ts`), which had hardcoded a local macOS evidence path (`/Users/gurkiratkhaira/.no-mistakes/evidence/01M4VGZA4NATH6B7021QQ5QYGN`) and caused `Playwright E2E (Shard 4/4)`, `End-to-End Playwright Tests`, and `Required Checks Gate` to fail on Linux CI runners with `EACCES: permission denied`. The permanent test coverage for Issue #1084 remains in `tests/customer-top-items-ui.test.ts`
Omit unchanged address on customer edit requests so legacy over-limit addresses do not block unrelated edits, surface backend validation errors when address changes, add notes to shared Customer type, constrain modal height with vertical scrolling, and expand unit and Playwright E2E regression tests.

Fixes #1084
@khaira777
khaira777 force-pushed the fm/flocafe-issue-1084-r1 branch from 9dcfba6 to 8134818 Compare October 14, 2026 01:42
@khaira777
khaira777 enabled auto-merge (squash) October 14, 2026 01:42
@khaira777
khaira777 merged commit f3882df into main Oct 14, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-issue-1084-r1 branch October 14, 2026 01:49
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(customers): add address and notes fields to customer create and edit modals

1 participant