CS-10380: Fetch type picker options from _federated-types endpoint#4171
CS-10380: Fetch type picker options from _federated-types endpoint#4171
Conversation
Instead of deriving type picker options from search results and recent cards, fetch all available types from the _federated-types endpoint so the picker is populated with all types across selected realms regardless of search state. Types with the same display_name but different code_refs appear as one picker option, but all associated code_refs are used when filtering search results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Preview deployments |
Host Test Results 1 files ±0 1 suites ±0 2h 31m 48s ⏱️ + 1m 4s Results for commit b645670. ± Comparison against base commit 0da90e3. This pull request removes 3 and adds 4 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
- Add built-in infinite scroll and loading indicators to the boxel-ui Picker component (isLoading, isLoadingMore, hasMore, onLoadMore args) - Full overlay loading covers options area during initial/search fetch, bottom spinner shows during load-more pagination - Simplify TypePicker by removing custom afterOptionsComponent, infiniteScroll modifier, and pickerExtra - now passes args directly - Split _typeSummariesLoading into _isLoadingTypes and _isLoadingMoreTypes for distinct loading states - Update tests for pagination (waitFor specific types) and type count Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
boxel/packages/host/app/components/card-search/panel.gts
Lines 327 to 331 in b645670
When the picker is using server-side search, this branch drops any previously selected type whose label is not present in the currently returned option set, so selecting Pet and then searching for Person clears Pet as soon as the filtered response arrives. That makes multi-select across different search terms impossible and unexpectedly reverts users back toward Any Type without an explicit deselect action.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!codeRefsByDisplayName.has(name)) { | ||
| codeRefsByDisplayName.set(name, []); | ||
| } | ||
| codeRefsByDisplayName.get(name)!.push(codeRef); |
There was a problem hiding this comment.
Merge type code refs beyond the current paged slice
The typeCodeRefs map is built only from _typeSummariesData, which is fetched in 25-item pages, so a selected display name can end up mapped to only the code refs from already-loaded pages. In multi-realm or large-type sets, cards whose same display name appears on later pages get filtered out incorrectly because their code refs were never added to this map.
Useful? React with 👍 / 👎.
Screen.Recording.2026-03-16.at.13.11.49.mov
Summary
_federated-typesendpoint instead of deriving them from search resultsTypePickerinto the boxel-uiPickercomponentChanges
packages/boxel-ui/addon/src/components/picker/index.gtsisLoading,isLoadingMore,hasMore,onLoadMoreargs to PickerPickerAfterOptionscomponent with full overlay loading for initial/search and bottom spinner for load-morerequestAnimationFramedropdownClassadds--loadingmodifier for z-index layering (search input stays above overlay)packages/host/app/components/type-picker/index.gts@isLoading,@isLoadingMore,@hasMore,@onLoadMoredirectly to Pickerpackages/host/app/components/card-search/panel.gtsfetchTypeSummariesrestartable task callingrealmServer.fetchCardTypeSummaries()_isLoadingTypes(initial/search) and_isLoadingMoreTypes(pagination)_typeCodeRefsmap tracks multiple code refs per display name for accurate search filteringpackages/host/app/components/card-search/search-bar.gtsisLoadingTypesarg, passed through to TypePickerTests
waitForfor paginated type options in operator-mode UI testsTest plan
packages/hostintegration tests for operator-mode UI🤖 Generated with Claude Code