Components › Forms & input › Select › Entity picker

Entity picker

beta

Record reference field: removable record chips plus Add, built on the canonical RecordSelect (server search, recent, create from e-mail).

`apps/web/src/lib/anchored-panel.ts` is gone from origin/main — anchoring moved into the shared Popover (acrm 26de4b54b, AddRefMenu/RecipientInput/AssignPicker/deal-parts); the reference was dropped from this entry. Optional prop `recent` (27 Sep 2026, `RelationDialog`'s entity picker is the first consumer): on an empty/below-minimum query it offers recently opened records of the allowed `types` instead of the "type at least N characters" hint, sourced from `useRecentRecords` (`GET /search/recent` → `record_views`, written server-side when a record's detail loads — real opens, not search clicks). Rows reuse the exact `.acrm-recordselect-opt` markup and `add()` path as a search result; already-selected and locked records are filtered out client-side. Without the prop the picker behaves exactly as before. Debt: `EntityPicker` lives in `apps/web/src/components/EntityPicker.tsx`, not `packages/ui`, so it has no Ladle story — behaviour is covered by `relation-dialog.test` instead. Move it to `packages/ui` to get stories (AD 27 Sep 2026). 3 Oct 2026 (AD): deprecated → beta. The duplicate shell is gone (AddRefMenu removed, 4a9a934e0; ProductPicker on RecordSelect since 1 Oct); it is a composition over RecordSelect, not a second picker. Migrating its consumers would rebuild the same composition each time. Canon after: move into @acrm/ui with stories (Default · States · Composition) + baselines, usage/a11y rewritten. 3 Oct 2026: shell is DS.RecordRefField in @acrm/ui (acrm !4502); EntityPicker / ProductPicker are data wrappers around it, DOM 1:1. Focus returns to Přidat on close. Registry repaired 17 Oct 2026 (review F1): AddRefMenu.tsx is gone from main (file reference dropped). Registry repaired 17 Oct 2026 (review F2): removed classes with no CSS definition and no TSX use on main: .acrm-popover.eref-add-pop.

Used in 13 files · 11 areas · 14× — components/ProductPicker, components/calendar, components/deal, components/dialer, components/mail, components/meetings …

Default

Účastníci
components--record-reference-field--defaultOpen standalone ↗Code

States

Účastníci
empty — only “Přidat”, no visible input (references float)
Účastníci
filled — tokens wrap, “Přidat” stays last
Firma
max reached (max={1}) — “Přidat” is gone, × gives the slot back
Účastníci
Jana NovákováPetr SvobodaNeodesláno
token state — dot after the name, title + aria-label carry the meaning
Napište alespoň 3 znaky
open — below the minimum query (state, not an explanation)
open — results (adding mode: nothing checked, picked records are tokens)
open — invite by e-mail: the typed address is the first row
open — products: free text in the footer when nothing matches by name (no empty sentence — the answer is the action)
components--record-reference-field--statesOpen standalone ↗Code

Composition

Entity picker = this field + records from /mentions/search (recent, e-mail invites). Product picker = this field + the product catalog (top by usage, free text). One value in a form row is a plain Record select, not this field.
Obchody
form row — deals of a meeting
Kontakty
rail editor — hideLabel, the rail row draws the key on the left
components--record-reference-field--compositionOpen standalone ↗Code