Skip to content

fix(pos): ignore IME Enter in product search - #1121

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

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

Conversation

@khaira777

@khaira777 khaira777 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1067 ("guard against IME composition confirmation in product search Enter accelerator"): in frontend/src/components/pos/ProductGrid.tsx (around line 254), pressing Enter in the POS product search input while an IME composition is active (e.nativeEvent.isComposing, e.isComposing, or e.keyCode === 229) triggers the search Enter accelerator and adds a matched product to the cart. Ignore Enter keydown events during IME composition. Deliver via the no-mistakes pipeline as its own PR with Fixes #1067 in the PR summary.

What Changed

  • Guard the POS product search onKeyDown handler in ProductGrid.tsx against active IME composition (e.nativeEvent?.isComposing, e.isComposing, or e.keyCode === 229) so confirming composed text with Enter does not trigger the product search Enter accelerator or clear the search input.
  • Add unit tests in tests/pos-keyboard-shortcuts.test.ts and Playwright E2E coverage in frontend/e2e/pos-keyboard-shortcuts.spec.ts verifying IME composition Enter events are ignored while non-composing Enter still adds the matched product to the cart.

Fixes #1067

Risk Assessment

✅ Low: Surgical early-return guard in ProductGrid search input onKeyDown for IME composition events (e.nativeEvent.isComposing, e.isComposing, e.keyCode === 229) with behavioral unit and E2E test coverage.

Testing

Ran npm run test:pos-keyboard-shortcuts and npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts against the live E2E server, and captured visual screenshot evidence showing that IME composition Enter events (e.nativeEvent.isComposing, e.isComposing, and e.keyCode === 229) in the POS product search input leave the cart empty and preserve the search query, while a subsequent non-composing Enter adds E2E Coffee to the cart and clears the search input.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Pressing Enter in the POS product search input during active IME composition (isComposing or keyCode 229) preserves the search text and does not add the matched product to the cart ✅ pass live ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-ime-composing-enter.png
Pressing a non-composing Enter in the POS product search input after IME composition ends adds the matched product to the cart and clears the search input ✅ pass live ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-post-composition-enter.png

POS search input after IME composition Enter events (cart remains empty and search value is preserved)
POS search input after non-composing Enter following composition end (matched product added to cart and search cleared)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Pressing Enter in the POS product search input during active IME composition (isComposing=true or keyCode=229) is ignored without adding the matched product to the cart or clearing the search input ✅ pass live ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-ime-composition-enter-guarded.png
Pressing non-composing Enter in the POS product search input after IME composition ends adds the matched product to the cart and clears the search input ✅ pass live ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-regular-enter-adds-to-cart.png
  • npm run test:pos-keyboard-shortcuts
  • npm run build && npm run build:frontend
  • npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts
  • Live Playwright Chromium verification against tests/e2e-server.cjs capturing ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-ime-composition-enter-guarded.png and ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-regular-enter-adds-to-cart.png

✅ No issues found.

  • Live validation: ✅ go - 2 of 2 scenarios driven live against the product
Scenario Result Live Evidence
Pressing Enter in the POS product search input during active IME composition (isComposing or keyCode 229) preserves the search text and does not add the matched product to the cart ✅ pass live ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-ime-composing-enter.png
Pressing a non-composing Enter in the POS product search input after IME composition ends adds the matched product to the cart and clears the search input ✅ pass live ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-post-composition-enter.png
  • npm run test:pos-keyboard-shortcuts
  • npx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.ts
  • Live Playwright verification against tests/e2e-server.cjs capturing ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-ime-composing-enter.png and ~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-post-composition-enter.png
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ 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: bfe1f841-485c-4d96-b99f-fcf1d89387f5

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): ignore IME composition Enter in POS product search fix(pos): ignore Enter during IME composition 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: 4/5

[Medium impact] Adds IME composition handling to product search input.

The fix appears safe to merge, with a non-blocking improvement needed to keep the browser test reliable.

Findings

  1. P2 Test races product loading ▶

Summary

ProductGrid now ignores search key events that carry an IME composition signal.

  • POS search ignores Enter while an IME composition is active.

Reviews (1) · Last reviewed commit: "fix(pos): ignore IME Enter in product se..." · Reviewed by Greptile

@khaira777

Copy link
Copy Markdown
Contributor Author

The production fix looks correct. Please address the remaining browser test reliability issue before merging.

In frontend/e2e/pos-keyboard-shortcuts.spec.ts, the new IME test sends Enter before confirming that the matching product has loaded. The pos-product-grid container can appear while the product list is still empty.

Please:

  1. Wait for the matching pos-product-card to be visible before dispatching IME events.
  2. Verify that Enter during composition does not add a product or clear the search input.
  3. Verify that a normal Enter after composition adds the correct product exactly once.
  4. Run the affected unit and Playwright tests and confirm they pass.

Keep the production behavior unchanged unless testing reveals an actual defect. Avoid unrelated changes or formatting.

@khaira777
khaira777 force-pushed the fm/flocafe-issue-1067-r1 branch from d97fddb to 069feed Compare October 13, 2026 21:27
@khaira777 khaira777 changed the title fix(pos): ignore Enter during IME composition fix(pos): ignore IME Enter in product search Oct 13, 2026
@khaira777 khaira777 changed the title fix(pos): ignore IME Enter in product search fix(pos): guard barcode scan during IME Oct 13, 2026
Ignore Enter keydown events in the POS product search input while an IME composition is active (e.nativeEvent.isComposing, e.isComposing, or e.keyCode === 229) so confirming composed characters does not prematurely trigger the search Enter accelerator and add a matched product to the cart.

Fixes #1067
@khaira777
khaira777 force-pushed the fm/flocafe-issue-1067-r1 branch from 069feed to 3caacfe Compare October 13, 2026 22:39
@khaira777 khaira777 changed the title fix(pos): guard barcode scan during IME fix(pos): ignore IME Enter in product search Oct 13, 2026
@khaira777
khaira777 merged commit 285dd32 into main Oct 13, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-issue-1067-r1 branch October 13, 2026 23:24
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(pos): guard against IME composition confirmation in product search Enter accelerator

1 participant