Skip to content

fix: show asset suggestions on empty Add Asset query [PERA-4159]#390

Closed
wjbeau wants to merge 1 commit intomainfrom
wjbeau/PERA-4159
Closed

fix: show asset suggestions on empty Add Asset query [PERA-4159]#390
wjbeau wants to merge 1 commit intomainfrom
wjbeau/PERA-4159

Conversation

@wjbeau
Copy link
Copy Markdown
Contributor

@wjbeau wjbeau commented Apr 27, 2026

Summary

  • Matches the Android behavior on the Add Asset / Add Collectible screens: when the search field is empty, fetch and show the backend's default suggestion list instead of leaving the screen blank.
  • Adds a showOnEmptyQuery opt-in to useGlobalSearch so the remote asset query runs (and surfaces loading) without typed input. Local sections (accounts/contacts/owned assets) remain empty until the user types.
  • Omits the q parameter from /v1/assets/search/ when it's blank so the API returns suggestions (Android sends q as null, which Retrofit drops; RN was sending q='').

Test plan

  • Open Add Asset on a non-watch account — assets list should populate immediately (not blank).
  • Open Add Collectible — collectibles list should populate immediately.
  • Type a query — results should filter as before; clear the field — suggestions return.
  • Compare side-by-side with Android prod build to confirm parity.
  • pnpm build passes (tsc).
  • useGlobalSearch and assets endpoint test suites pass with new coverage.

🤖 Generated with Claude Code

Match Android: when the Add Asset / Add Collectible search field is
empty, fetch the backend's default suggestion list instead of leaving
the screen blank. Adds a `showOnEmptyQuery` opt-in to `useGlobalSearch`
so the remote asset query runs (and surfaces loading) without typed
input, and omits the `q` parameter from `/v1/assets/search/` when it's
blank so the API returns suggestions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wjbeau wjbeau closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant