docs/ITEM-SEARCH.md

Catalog-backed item suggestions

src/blackrock/ItemSearchInput.tsx is the shared Frosted combobox. It is used in Bank holdings, Exchange, general Blackrock search, recipe search, the chart item finder, acquisition-item lookup, and Palantir's item catalog. Player/NPC/location searches keep their existing semantics.

Behavior

  • Focus an empty field for recent selections and curated suggestions resolved from actual local definitions (not claimed trending items).
  • Type a name or item ID for up to eight suggestions. Exact ID/name matches sort ahead of prefix and substring matches. Every option shows the sprite, name and ID.
  • Arrow keys select, Enter applies, Escape dismisses, Tab proceeds. Enter without a highlighted option preserves the containing form's normal submit behavior. IME composition does not select prematurely.
  • Selections are saved locally under rs-blackrock:recent-item-searches:v1 (eight items maximum). Clear recent removes this list only. Invalid storage is ignored.
  • The dropdown is portaled inside the existing theme and positioned against the field with viewport bounds. It tracks page scroll and resize; short/narrow viewports constrain the list. It has no motion or new dependencies.
  • Requests start only while open, debounce typing by 120ms, cancel superseded requests, and ignore late responses. A bounded session cache avoids repeated catalog lookups. This is not a market price request.

Source and destination semantics

Use existing read-only /api/catalog?kind=items&q=...&limit=200. Definition matches are not proof of holdings, tradability or live supply. Suggested definitions are local; catalog failure leaves manual search available.

Bank selection queries the item's name and applies the chosen exact ID to the returned preview filters, including zero-match cases. Exchange's upstream overview searches names, so selections pass names there; same-name variants may remain in market results. General research opens the selected item's dossier. Chart and acquisition lookup use the selected ID. Recipe search uses the item name as a recipe query; not every item has a recipe. Catalog selections filter by exact ID.

Reference and validation

User-provided Amazon examples inspired focus suggestions and recent selections. Mobbin Instacart showed thumbnail/name suggestions under the input; Urban Outfitters showed grouped suggestions and product results. These inform structure only; visual styling stays Frosted.

Model tests in item-suggestions.test.ts cover ranking, duplicate-name IDs, capped recent selections and corrupt storage. Evidence is in repository-root reports/palantir-validation/item-autocomplete-20261027/.