Repository navigation
fix(pos): ignore IME Enter in product search - #1121
Conversation
|
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 |
|
|
The production fix looks correct. Please address the remaining browser test reliability issue before merging. In Please:
Keep the production behavior unchanged unless testing reveals an actual defect. Avoid unrelated changes or formatting. |
d97fddb to
069feed
Compare
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
069feed to
3caacfe
Compare
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), pressingEnterin the POS product search input while an IME composition is active (e.nativeEvent.isComposing,e.isComposing, ore.keyCode === 229) triggers the searchEnteraccelerator and adds a matched product to the cart. IgnoreEnterkeydown events during IME composition. Deliver via theno-mistakespipeline as its own PR withFixes #1067in the PR summary.What Changed
onKeyDownhandler inProductGrid.tsxagainst active IME composition (e.nativeEvent?.isComposing,e.isComposing, ore.keyCode === 229) so confirming composed text withEnterdoes not trigger the product searchEnteraccelerator or clear the search input.tests/pos-keyboard-shortcuts.test.tsand Playwright E2E coverage infrontend/e2e/pos-keyboard-shortcuts.spec.tsverifying IME compositionEnterevents are ignored while non-composingEnterstill 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-shortcutsandnpx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.tsagainst the live E2E server, and captured visual screenshot evidence showing that IME composition Enter events (e.nativeEvent.isComposing,e.isComposing, ande.keyCode === 229) in the POS product search input leave the cart empty and preserve the search query, while a subsequent non-composing Enter addsE2E Coffeeto the cart and clears the search input.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.
npm run test:pos-keyboard-shortcutsnpm run build && npm run build:frontendnpx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.tsLive Playwright Chromium verification againsttests/e2e-server.cjscapturing~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-ime-composition-enter-guarded.pngand~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-regular-enter-adds-to-cart.png✅ No issues found.
npm run test:pos-keyboard-shortcutsnpx playwright test --config=playwright.config.ts --project=chromium e2e/pos-keyboard-shortcuts.spec.tsLive Playwright verification againsttests/e2e-server.cjscapturing~/.no-mistakes/evidence/01M4VJ17ATD1SXYHCD3W31HY12/pos-search-ime-composing-enter.pngand~/.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.