Skip to content

Pick BOM components by search in web and desktop (#419) - #444

Merged
Sebagrei merged 4 commits into
mainfrom
feature/419-bom-component-picker
Nov 22, 2026
Merged

Sebagrei merged 4 commits into
mainfrom
feature/419-bom-component-picker

Conversation

@Sebagrei

Copy link
Copy Markdown
Collaborator

Closes #419

What changed

  • Service: items::suggest (src/services/items.rs) – the existing item search (number, name, description, attributes, file name) with the caller's actor, so access::item_visible hides restricted groups; at most 10 rows, nothing below 2 characters, text cut at 200; a thumbnail file per row (similar::thumbnails, now pub(crate)).
  • Web: GET /items/suggest?q=&limit= (session cookie, no-store) returns JSON incl. thumbnail_url. The Add component field on the BOM card keeps its child input (works without JS) and gets data-suggest + ARIA combobox/listbox attributes; static/app.js adds a debounced picker (DOM APIs only, no innerHTML; ↑/↓, Enter, Esc); styles in static/style.css. No inline JS/CSS.
  • REST: GET /api/v1/items/suggest?q=&limit= (same service; listed in the API index and docs/src/reference/api.md).
  • Desktop: new desktop/ui/js/bom-lines.js – Add line… in the Structure tab of an own check-out (picker over /items/suggest, falls back to /items?q= on older servers; qty, find no., notes → POST …/bom), editable quantity (PATCH /bom-lines/{id}) and Remove (DELETE, confirmed) on first-level lines; the tab reloads after each change.
  • Tests: tests/component_picker.rs – name / file name / number matches and the 10-row cap; restricted-group items never suggested (web and API); unauthenticated and bearer-on-web requests refused; adding a line without the own check-out refused through the web form and the API.
  • Docs: CHANGELOG, README (Features), docs/src/guide/structure.md, docs/src/guide/desktop.md, desktop/README.md, docs/src/reference/api.md, docs/src/dev/threat-model.md, docs/OPEN_WORK.md.

How it was tested

Not compiled or run locally (no builds on this machine); only cargo fmt --all was run. node was not available here, so the JS was not syntax-checked locally either – CI (ci.yml, desktop.yml ui job incl. check-desktop-modules.mjs) verifies.

Checklist

  • This is my own work (or my AI agent's, written from its own
    knowledge), or openly licensed material under a compatible licence
    that is credited. It contains no code decompiled, disassembled or
    rewritten from proprietary software
    and no leaked code
    (CONTRIBUTING.md).
  • Reading a file format: not applicable (no format work).
  • The documentation is updated in this pull request (CHANGELOG.md,
    README.md, docs/src/**, docs/OPEN_WORK.md where it applies).
  • cargo fmt --all --check, cargo clippy --all-targets -- -D warnings
    and cargo test pass locally, or CI runs them. (fmt done locally; clippy and tests left to CI)

🤖 Generated with Claude Code

fork and others added 2 commits November 22, 2026 19:26
The web *Add component* field lists matching items while typing part of
their number, name or file name (thumbnail, revision, state, group, matched
file; keyboard and ARIA combobox), progressive enhancement over the exact
number field. New GET /items/suggest (session) and GET /api/v1/items/suggest
over items::suggest, i.e. the item search with the caller's read rights.
Desktop Structure tab: Add line... with the same picker, editable quantity
and Remove on first-level lines of an own check-out. Tests for name and
file-name matches, restricted groups, sign-in and the check-out rule; docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test: release the author's automatic check-out before the
  "not checked out" case, so the refusal is really exercised
- desktop: drop a stale choice on typing, Esc closes only the
  suggestions, aria-activedescendant and a live status line
- web: a late answer after blur no longer reopens the list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sebagrei
Sebagrei marked this pull request as ready for review November 22, 2026 20:50
fork added 2 commits November 22, 2026 21:53
…nent-picker

# Conflicts:
#	CHANGELOG.md
#	docs/OPEN_WORK.md
#	src/services/similar.rs
@Sebagrei
Sebagrei merged commit 0452d4c into main Nov 22, 2026
8 checks passed
@Sebagrei
Sebagrei deleted the feature/419-bom-component-picker branch November 22, 2026 20:54
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.

UX B5: Pick BOM components by search (name, file name, number) in web and desktop

1 participant