Skip to content

feat: select first search result on Enter key press - #368

Open
NotAbdelrahmanelsayed wants to merge 3 commits into
BrainWise-DEV:developfrom
NotAbdelrahmanelsayed:feat/search-enter-first-result
Open

feat: select first search result on Enter key press#368
NotAbdelrahmanelsayed wants to merge 3 commits into
BrainWise-DEV:developfrom
NotAbdelrahmanelsayed:feat/search-enter-first-result

Conversation

@NotAbdelrahmanelsayed

Copy link
Copy Markdown
Contributor

Summary

  • When the cashier types a partial item name in the search box and presses Enter, the first visible search result is added to the cart immediately
  • If no search results are present (e.g. typing a barcode), the existing exact barcode lookup runs as before — no regression for scanner workflows
  • Variant/UOM/batch dialogs still appear when needed (respects auto-add mode)

Behaviour change

Before After
Enter → exact barcode lookup → "Item Not Found" for partial text Enter → first search result added to cart
Barcode scan → works as before Barcode scan → works as before (fallback path)

Files changed

  • POS/src/composables/useSearchInput.jshandleKeyDown: checks itemStore.filteredItems[0] before falling back to barcode lookup

Test plan

  • Type a partial item name → results appear → press Enter → first result added to cart
  • Type an exact barcode → press Enter → barcode lookup fires normally
  • Type something with no matches → press Enter → "Item Not Found" warning
  • With auto-add ON: Enter adds without prompts for simple items
  • With auto-add OFF: Enter opens variant/UOM dialog if applicable

🤖 Generated with Claude Code


Reopens #239, which was auto-closed by the stale-PR bot for lack of recent activity. No code changes since — recreated to bring it back into review.

NotAbdelrahmanelsayed and others added 2 commits April 15, 2026 19:15
When the user presses Enter in the item search box and search results
are visible, the first result is added to the cart immediately instead
of falling back to an exact barcode lookup (which showed "Item Not Found"
for partial text). Barcode lookup is preserved as the fallback when
no search results are present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r-first-result

# Conflicts:
#	POS/src/composables/useSearchInput.js
@NotAbdelrahmanelsayed
NotAbdelrahmanelsayed force-pushed the feat/search-enter-first-result branch from e8e6cd2 to 2398df9 Compare September 8, 2026 06:36
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.

1 participant