Skip to content

Improve model picker loading state - #1728

Merged
ymichael merged 1 commit into
mainfrom
bb/improve-model-picker-loading-state-thr_zrxid5utnh
Aug 17, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/improve-model-picker-loading-state-thr_zrxid5utnh

Conversation

@ymichael

@ymichael ymichael commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • replace the model picker loading label with trigger and menu skeletons
  • keep built-in provider branding visible while model discovery is pending
  • preserve the loading state while placeholder provider data is active

Testing

  • pnpm exec turbo run test --filter=@bb/app --force -- src/components/pickers/ModelReasoningPicker.test.tsx src/hooks/queries/system-queries.test.tsx src/hooks/useThreadCreationOptions.test.tsx
  • pnpm exec turbo run typecheck --filter=@bb/app

AGENT GENERATED: by GPT-5


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@bb-slop-cop

bb-slop-cop Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · review

I am the SlopCop. I am now checking this change for security, quality, performance, architecture, and user behavior.

@ymichael
ymichael merged commit 781cb3f into main Aug 17, 2026
11 checks passed
@ymichael
ymichael deleted the bb/improve-model-picker-loading-state-thr_zrxid5utnh branch August 17, 2026 21:58
// the authoritative response still replaces it and adds configured providers.
function builtInProviderPlaceholderExecutionOptions(): SystemExecutionOptionsResponse {
return {
providers: PLACEHOLDER_PROVIDER_INFOS,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — The placeholder exposes disabled providers during a cold load.

PLACEHOLDER_PROVIDER_INFOS lists every built-in provider. The server removes a provider when its plugin is disabled. I disabled Pi and delayed this request in the browser. The picker still showed an active Pi tab until the authoritative response arrived. Please keep the roster authoritative and derive the selected loading icon separately.

retry: shouldRetrySystemExecutionOptions,
retryDelay: SYSTEM_EXECUTION_OPTIONS_RETRY_DELAY_MS,
...(isClaudeCode
...(canPreloadBuiltInProviders

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — Empty placeholder data bypasses the load state in provider previews.

This query now gives empty placeholder models to each built-in provider. TanStack sets isLoading to false when placeholder data exists. ModelReasoningPicker still checks only previewQuery.isLoading for the controlled preview path. That path can show “No models available” while the request remains active. Please apply the same empty-placeholder rule to the preview query and add a cold provider-tab test.

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Plain-English summary: This change replaces the model picker load text with stable skeleton rows. It also shows the selected provider icon sooner.

I found two correctness issues.

  • The new cold placeholder lists disabled providers as active choices. I reproduced this with Pi disabled and a delayed response.
  • The controlled provider preview path does not treat empty placeholder data as an active load. It can show “No models available” too soon.

The hard-coded provider roster also duplicates the first-party provider declarations. The existing provider icon map can supply the selected icon without a synthetic roster.

I found no security issue. Static React content, scoped query keys, and server permission limits remain intact.

I found no new polling, duplicate request, cache refresh, or render loop.

Validation passed:

  • The @bb/app type check passed.
  • All 349 app test files passed, with 2,778 tests.
  • The normal browser load showed the new trigger and menu skeletons.
  • The disabled-provider browser test reproduced the first issue. I restored the Pi provider after the test.

Please address the two inline findings before merge.

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