fix(pickers): use_resource subscribes to query signal, populated-list affordance label echoes typed text #192

Merged
YousifShkara merged 1 commit from fix/pms-371-company-picker-filter-and-affordance-label into main 2026-06-16 09:29:28 +02:00
Owner

The CompanyPicker and AssetPicker both built their query string outside the use_resource closure and captured it as a plain String. Dioxus 0.7's resource tracking subscribes to signals read INSIDE the closure, so the only effect of reading the signal in the parent scope was to re-render the parent. The fetch fired once with the initial empty query and never refreshed when the user typed, leaving the dropdown showing the unfiltered first page regardless of the input field's value. Moved the signal read inside the closure on both pickers so each keystroke triggers a re-fetch against the server's existing ILIKE match on name.

The populated-list branch of the CompanyPicker's inline-create affordance also hardcoded the generic "+ Create new company" label, while the empty-list branch correctly echoed the typed query (+ Create "Wile E. Coyote Demolition"). Matched the two branches so the affordance label is consistent across both render paths.

#PMS-371

The CompanyPicker and AssetPicker both built their query string outside the use_resource closure and captured it as a plain String. Dioxus 0.7's resource tracking subscribes to signals read INSIDE the closure, so the only effect of reading the signal in the parent scope was to re-render the parent. The fetch fired once with the initial empty query and never refreshed when the user typed, leaving the dropdown showing the unfiltered first page regardless of the input field's value. Moved the signal read inside the closure on both pickers so each keystroke triggers a re-fetch against the server's existing ILIKE match on `name`. The populated-list branch of the CompanyPicker's inline-create affordance also hardcoded the generic "+ Create new company" label, while the empty-list branch correctly echoed the typed query (`+ Create "Wile E. Coyote Demolition"`). Matched the two branches so the affordance label is consistent across both render paths. #PMS-371
fix(pickers): use_resource subscribes to query signal, populated-list affordance label echoes typed text
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 1m44s
0300247541
The CompanyPicker and AssetPicker both built their query string outside the use_resource closure and captured it as a plain String. Dioxus 0.7's resource tracking subscribes to signals read INSIDE the closure, so the only effect of reading the signal in the parent scope was to re-render the parent. The fetch fired once with the initial empty query and never refreshed when the user typed, leaving the dropdown showing the unfiltered first page regardless of the input field's value. Moved the signal read inside the closure on both pickers so each keystroke triggers a re-fetch against the server's existing ILIKE match on `name`.

The populated-list branch of the CompanyPicker's inline-create affordance also hardcoded the generic "+ Create new company" label, while the empty-list branch correctly echoed the typed query (`+ Create "Wile E. Coyote Demolition"`). Matched the two branches so the affordance label is consistent across both render paths.

#PMS-371
YousifShkara deleted branch fix/pms-371-company-picker-filter-and-affordance-label 2026-06-16 09:29:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!192
No description provided.