Problem #
The Target Lexicon NSID suggestions in the "Create a record" and "Update a record" actions include lexicons that can't be record targets, such as searchStarterPacks, unmuteActor and graph.defs.
Code: app/routes/api/lexicons/suggest.ts. It returns every NSID that matches the prefix, with no filtering by lexicon type.
Fix direction #
- Filter suggestions to lexicons whose main definition has
type: "record". - Decide where to filter: in
collectLocalNsids,collectCachedNsidsandcollectRemoteNsidsinlexicons/discovery.ts, or on the merged set in the route. The remote source may need a schema fetch, so check the cost. - Add route tests for each source.
Context #
Split out of #46 so the focus-loss fix could ship on its own.
Replacing the native <datalist> with a non-intrusive combobox (the other half of #20) stays out of scope here.
Related: #20