Skip to content

feat(customer-search): enhance cart customer search bar#308

Open
NotAbdelrahmanelsayed wants to merge 2 commits into
BrainWise-DEV:developfrom
NotAbdelrahmanelsayed:feat/customer-search-enhancements
Open

feat(customer-search): enhance cart customer search bar#308
NotAbdelrahmanelsayed wants to merge 2 commits into
BrainWise-DEV:developfrom
NotAbdelrahmanelsayed:feat/customer-search-enhancements

Conversation

@NotAbdelrahmanelsayed

Copy link
Copy Markdown
Contributor

Summary

Enhances the in-cart customer search with faster, more forgiving lookup and clearer results.

What's included

  • Clear-search (X) button — reset the query in one tap.
  • Arabic-insensitive matching with highlighting — tokenized search that normalizes alef/ya/ta-marbuta variants, diacritics, and Arabic-Indic digits, with matched segments highlighted in the results (new POS/src/utils/searchText.js). Typing أحمد matches احمد and vice-versa.
  • Top-customers suggestions — on focus, surfaces the most frequently selected customers (tracked in localStorage under pos_customer_counts).
  • "Show All Customers in Search" setting — a new POS Setting (customer_search_show_all) to show the full customer list instead of capping at the first 10–20 matches.
  • Keyboard navigation — arrow-key nav auto-scrolls the highlighted row into view and preselects the top-ranked match; Enter selects it.

Tests & i18n

  • Adds customerSearch.topCustomers.test.js (5 cases) covering the frequency ranking and tie-break.
  • Adds Arabic (ar.csv) entries for every new user-facing string.

Verification

  • npm run test:run — all tests pass.
  • npm run build — compiles cleanly.
  • Manual screenshot review against a live backend: confirmed the clear button, Arabic match highlighting, focus suggestions, results count, keyboard-nav preselection, and the settings toggle all render and behave correctly.

🤖 Generated with Claude Code

NotAbdelrahmanelsayed and others added 2 commits June 12, 2026 15:38
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
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity for 21 days.

To keep this PR open, please:

  • Rebase on the latest develop branch
  • Address any pending review comments
  • Reply with an update on the PR status

If no further activity occurs within the next 14 days, this PR will be automatically closed.

@github-actions github-actions Bot added the stale label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant