Server-side term/authority search for the combobox picker (large vocabularies) #43
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The term/authority picker (#27, merged
de035bd) is a searchable combobox that filters the full option list client-side (useTerms/useAuthoritiesload everything, cached 5 min). That's fine for the current small vocabularies, but degrades once a vocabulary has hundreds/thousands of terms (large payload, no server filtering). This was explicitly deferred from #27.What to do
GET /api/admin/vocabularies/{id}/terms?q=<text>&limit=<n>(searchterm_label.label, any lang, scoped to the vocabulary; ILIKE/trigram; return top-N) and extendGET /api/admin/authorities?kind=&q=<text>&limit=<n>. Emptyq→ first N.ViewInternal.OptionsCombobox(or a server-backed variant) query the endpoint (debounced) viainputValue/onInputValueChangeinstead of loading the full list, for large vocabularies. Decide the client-vs-server threshold (or always-server).GET .../terms/{term_id},authorities/{id}) or include the selected id in results.value = idcontract + active-locale labels. Mind the bundle (object-form chunk).References
web/src/objects/options-combobox.tsx,web/src/objects/field-input.tsxweb/src/api/queries.ts(useTerms,useAuthorities)crates/api/src/admin_vocab.rs(list_terms),crates/api/src/admin_authorities.rs(list_authorities)docs/superpowers/specs/2026-06-06-searchable-term-authority-picker-design.md("Out of scope → follow-up issue").Deferred from #27 (client-side filtering shipped first; server-side search when a vocabulary genuinely grows large).