Repository navigation
feat(customer-search): enhance cart customer search bar - #363
NotAbdelrahmanelsayed wants to merge 10 commits into
Conversation
Improve the in-cart customer search with faster, more forgiving lookup and clearer results: - Clear-search (X) button to reset the query in one tap - Arabic-insensitive tokenized matching with highlighted match segments (normalizes alef/ya/ta-marbuta variants, diacritics, and Arabic-Indic digits via new POS/src/utils/searchText.js) - Top-customers-by-frequency suggestions on focus, tracked in localStorage (pos_customer_counts) - "Show All Customers in Search" POS setting to show the full customer list instead of capping at the first 10-20 matches - Keyboard navigation with auto-scroll of the highlighted result into view and preselection of the top-ranked match Adds a unit test for the topCustomers ranking and Arabic translations for the new strings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…arch-enhancements # Conflicts: # POS/src/components/sale/InvoiceCart.vue # POS/src/stores/customerSearch.js # POS/src/stores/posSettings.js # pos_next/translations/ar.csv
…arch-enhancements
Resolve additive conflicts: keep upstream's cart_lifo checkbox and loyalty/wallet/display_item_code settings and expense strings alongside customer_search_show_all in POSSettings.vue, constants.py and ar.csv. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SSC8nNShKbobvshgNZpcfN
BrainWise-DEV#366 landed on develop and both it and this branch declare customerSearchInputRef next to each other in InvoiceCart.vue. Keep the single shared declaration plus this branch's customerResultsListRef. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SSC8nNShKbobvshgNZpcfN
|
Thanks for the PR — the Arabic-insensitive matching, result highlighting, clear button, and keyboard nav are a solid UX improvement for cashiers. Before we merge, please:
Happy to re-review once it’s updated against latest |
Resolve InvoiceCart.vue against develop's phone-name avatar, dir=auto name and changingCustomer state (Escape now also clears changingCustomer). Review follow-up (BrainWise-DEV#363): cap "Show All Customers in Search" at 500 rendered rows and say so in the setting description (en + ar). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@MohamedAliSmk thanks for the review. All four points are done in 2a1f545:
|
|
Thanks @NotAbdelrahmanelsayed, I checked the four review points against A few things are still needed before I can approve:
Once 1 to 3 are done, this is fine to approve |
… tests - Enter with nothing highlighted now picks the top match only when a query has been typed, so Enter on a just-focused empty input selects nobody. - Bump pos_settings.json `modified` so `bench migrate` syncs the new customer_search_show_all field on existing sites. - Add searchText.spec.js covering normalization (diacritics, alef/ta marbuta/ya forms, Arabic-Indic and Persian digits), tokenizing, and matchSegments highlighting across those forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @MohamedAliSmk. All addressed in 3dee083:
|
Summary
Enhances the in-cart customer search with faster, more forgiving lookup and clearer results.
What's included
POS/src/utils/searchText.js). Typingأحمدmatchesاحمدand vice-versa.localStorageunderpos_customer_counts; these are not server-side counts or shared across devices).customer_search_show_all) to show up to 500 customers instead of the first 10–20 matches. Matching still runs over every cached customer in memory; only the rendered rows are capped, because thousands of rows make the dropdown janky. Typing narrows the list.Tests & i18n
customerSearch.topCustomers.test.js(5 cases) covering the frequency ranking and tie-break.ar.csv) entries for every new user-facing string.Verification
npm run test:run— all tests pass.npm run build— compiles cleanly.🤖 Generated with Claude Code
Reopens #308, which was auto-closed by the stale-PR bot for lack of recent activity. Updated against current
developafter review.