Skip to content

Product select dropdown - #161

Merged
kittendevv merged 2 commits into
kittendevv:mainfrom
Bouni:product-select-dropdown
Oct 12, 2026
Merged

kittendevv merged 2 commits into
kittendevv:mainfrom
Bouni:product-select-dropdown

Conversation

@Bouni

@Bouni Bouni commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Searchable product selection in the invoice editor

The product <select> on each invoice line is replaced by a combobox. You can type to filter products and pick one from the results, which helps once the product catalogue gets long.

SelectProduct

What's new

  • Live search: results filter as you type. The search covers name, SKU, description, category and unit.
  • Multi-term matching: every word you type has to match, so web hour finds Web development billed per hour.
  • More detail per result: each entry shows the product name, with SKU and price per unit underneath (e.g. WEB-01 · 95.00 / hour).
  • Readable list in a narrow column: the dropdown is at least 18rem wide, even though the product column is narrow.
  • Keyboard support: ↑ / ↓ to move, Enter to select, Esc to close, Tab to move on. When the list opens, the current product is highlighted and scrolled into view.
  • Clear button: a selected product can be cleared with ✕.
  • Accessibility: uses ARIA combobox/listbox roles, aria-activedescendant and aria-expanded.

Behaviour

  • Choosing a product fills in description, unit price, unit and (in per-line tax mode) tax %, as before.
  • Choosing the product that's already selected does not fill the line again, so manual edits to that line are kept.
  • Clearing only removes the product link. Description, price and other fields on the line stay as they are.

Implementation

  • New component frontend/src/lib/components/ProductCombobox.svelte (Svelte 5 runes, DaisyUI styling). It takes products, value and an onchange(productId) callback.
  • InvoiceEditor.svelte uses the new component in place of the <select>. Each row gets its own ID (product-<itemId>), so ARIA references don't clash between lines.
  • New i18n keys Clear and No products found are added to all locales (de, nl, es-ar, es-co, pt-br, tr).

Notes

  • This PR works the same way as the customer combobox PR (customer-selection). Both add the Clear key and touch InvoiceEditor.svelte, so whichever merges second will have small conflicts that are easy to resolve.
  • Once both are merged, the two components can be combined into one generic Combobox in a follow-up.

Testing

  • bun run check: 0 errors
  • eslint / prettier pass on the changed files
  • Manual check: add a line, search for a product by name / SKU, select it, and confirm description, price, unit and tax are filled in
  • Manual check: edit a line by hand, pick the same product again, and confirm the edits are kept
  • Manual check: edit an existing invoice and confirm each line's product is preselected

🤖 Generated with Claude Code

Bouni and others added 2 commits October 9, 2026 09:28
Products can now be filtered by name, SKU, description, category or unit
while typing, with keyboard navigation and a clear button. Results show
SKU and price per unit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kittendevv
kittendevv merged commit 7f3b8f7 into kittendevv:main Oct 12, 2026
4 checks passed
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.

2 participants