fix(filter-builder): id labels survive Apply — stored ids resolve to names
The library cell reverted to the raw uuid after Apply: the apply flow reloads the page, the SSR-preloaded tree re-ingests, and idLabels — populated only by suggestion PICKS — starts empty, so valueCellText falls back to the id. Same on any fresh load of a stored id-rule. Two halves: - Server: the id-source suggest query's typed filter (library/ collection/added_by/feed) now also exact-matches a comma-separated ID list alongside the name ILIKE — so a suggest call with the stored ids returns their labeled rows. No new endpoint; the menu and the resolver share one surface. - Client: fetchSuggestions gains a QUIET mode (fills idLabels, touches no menu state), id rows fall back to their stored ids as the typed lookup when no draft is present, and init() calls resolveIdLabels() after tree ingest — one quiet fetch per id-kind rule resolves every stored id to its name from the first paint after reload. Pins: the Go side (suggest with a library's UUID returns the row with the library NAME as display), the client side (resolveIdLabels fills labels, the cell renders the name, no menu opens). 35 filter-builder vitest cases green; container filter slice green.
This commit is contained in:
1 parent
ed42111df1
commit
09f8f0875f
4 files changed
+87
-8
No files matched your search
@@ -650,6 +650,16 @@ func TestFilterSuggestionsUnderRules(t *testing.T) {
|
||||
}
|
||||
assert.True(t, found, "the visible library is offered")
|
||||
|
||||
// ID LOOKUP (2026-11-01): typing a stored ID resolves its label —
|
||||
// the builder's post-Apply reload path resolves stored ids to names
|
||||
// through this same call.
|
||||
status, results = suggest("library", libUUID.String(), "")
|
||||
require.Equal(t, http.StatusOK, status)
|
||||
require.NotEmpty(t, results, "the id lookup returns its row")
|
||||
assert.Equal(t, libUUID.String(), results[0]["value"])
|
||||
disp, _ := results[0]["display"].(string)
|
||||
assert.Contains(t, disp, "Test Builder", "the id resolves to the library NAME")
|
||||
|
||||
// BROWSE the library field UNDER rules (the blank-typed click): the
|
||||
// id-source query must not choke on the unused typed parameter and
|
||||
// must list exactly the library holding the surviving books.
|
||||
|
||||
Reference in new issue
Block a user