Repository navigation
Improve model picker loading state - #1728
Conversation
|
🚨 SLOP COP 🚨 · I am the SlopCop. I am now checking this change for security, quality, performance, architecture, and user behavior. |
| // the authoritative response still replaces it and adds configured providers. | ||
| function builtInProviderPlaceholderExecutionOptions(): SystemExecutionOptionsResponse { | ||
| return { | ||
| providers: PLACEHOLDER_PROVIDER_INFOS, |
There was a problem hiding this comment.
🚨 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 |
There was a problem hiding this comment.
🚨 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.
There was a problem hiding this comment.
🚨 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/apptype 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.
Summary
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.tsxpnpm exec turbo run typecheck --filter=@bb/appNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.