Skip to content

CS-10380: Fetch type picker options from _federated-types endpoint#4171

Draft
FadhlanR wants to merge 6 commits intomainfrom
cs-10380-fetch-type-picker-options
Draft

CS-10380: Fetch type picker options from _federated-types endpoint#4171
FadhlanR wants to merge 6 commits intomainfrom
cs-10380-fetch-type-picker-options

Conversation

@FadhlanR
Copy link
Contributor

@FadhlanR FadhlanR commented Mar 12, 2026

Screen.Recording.2026-03-13.at.16.03.28.mov

Summary

  • Fetch type picker options from the _federated-types endpoint instead of deriving them from search results
  • Move loading indicators and infinite scroll behavior from the host TypePicker into the boxel-ui Picker component
  • Split type loading into two distinct states: full overlay for initial/search fetches, bottom spinner for load-more pagination
  • Implement server-side search and pagination for type picker options (page size: 25)
  • Types with the same display name but different code refs are merged into a single picker option

Changes

packages/boxel-ui/addon/src/components/picker/index.gts

  • Added isLoading, isLoadingMore, hasMore, onLoadMore args to Picker
  • Built-in PickerAfterOptions component with full overlay loading for initial/search and bottom spinner for load-more
  • Scroll-based infinite scroll detection with immediate check via requestAnimationFrame
  • dropdownClass adds --loading modifier for z-index layering (search input stays above overlay)

packages/host/app/components/type-picker/index.gts

  • Now passes @isLoading, @isLoadingMore, @hasMore, @onLoadMore directly to Picker

packages/host/app/components/card-search/panel.gts

  • Added fetchTypeSummaries restartable task calling realmServer.fetchCardTypeSummaries()
  • Resource-based reactivity: realm URL or search key changes trigger re-fetch automatically
  • Split loading into _isLoadingTypes (initial/search) and _isLoadingMoreTypes (pagination)
  • _typeCodeRefs map tracks multiple code refs per display name for accurate search filtering

packages/host/app/components/card-search/search-bar.gts

  • Added isLoadingTypes arg, passed through to TypePicker

Tests

  • Updated type counts and added waitFor for paginated type options in operator-mode UI tests

Test plan

  • Open type picker — verify loading indicator shows during initial fetch
  • Type in type picker search — verify loading overlay covers options area (not search input)
  • Scroll to bottom of type options — verify more types load with bottom spinner
  • Select a realm filter — verify type options refresh from the endpoint
  • Select specific type(s) — verify card search results filter correctly
  • Run packages/host integration tests for operator-mode UI

🤖 Generated with Claude Code

FadhlanR and others added 2 commits March 12, 2026 15:25
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>
@github-actions
Copy link

github-actions bot commented Mar 12, 2026

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Host Test Results

    1 files  ±0      1 suites  ±0   2h 30m 4s ⏱️ -40s
2 019 tests  - 1  2 003 ✅  - 2  15 💤 ±0  0 ❌ ±0  1 🔥 +1 
2 034 runs   - 1  2 017 ✅  - 3  15 💤 ±0  1 ❌ +1  1 🔥 +1 

For more details on these errors, see this check.

Results for commit 1aeeebf. ± Comparison against base commit 0da90e3.

This pull request removes 3 and adds 2 tests. Note that renamed tests count towards both.
Chrome ‑ Integration | operator-mode | ui: empty state shows no type options besides Any Type
Chrome ‑ Integration | operator-mode | ui: type options derived from recent cards when no search term, sorted alphabetically
Chrome ‑ Integration | operator-mode | ui: type options update when search term changes and deduplicate
Chrome ‑ Integration | operator-mode | ui: type options derived from realm types when no search term, sorted alphabetically
Chrome ‑ Integration | operator-mode | ui: type options show all realm types even without recent cards

♻️ This comment has been updated with latest results.

FadhlanR and others added 4 commits March 12, 2026 20:54
- 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>
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