fix(desktop): collapse Fireworks behind the provider disclosure on first run
The first-run provider picker showed Fireworks AI alongside Nous Portal before the user opened the 'Other providers' disclosure. Only Nous Portal should be visible up front; Fireworks now lives inside the expanded list but keeps its #1 position there (Nous -> Fireworks ordering preserved).
This commit is contained in:
parent
697f2896bf
commit
9d6c5a920c
|
|
@ -62,18 +62,19 @@ describe('onboarding Picker', () => {
|
|||
|
||||
expect(screen.getByText('Nous Portal')).toBeTruthy()
|
||||
expect(screen.getByText('Recommended')).toBeTruthy()
|
||||
// Fireworks is the always-visible #2 slot (after Nous), even while OAuth
|
||||
// alternatives stay collapsed behind the disclosure.
|
||||
expect(screen.getByText('Fireworks AI')).toBeTruthy()
|
||||
// Fireworks stays behind the disclosure with the other alternatives; only
|
||||
// Nous Portal is visible before the user expands the list.
|
||||
expect(screen.queryByText('Fireworks AI')).toBeNull()
|
||||
expect(screen.queryByText('Anthropic API Key')).toBeNull()
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Other providers' }))
|
||||
|
||||
expect(screen.getByText('Fireworks AI')).toBeTruthy()
|
||||
expect(screen.getByText('Anthropic API Key')).toBeTruthy()
|
||||
expect(screen.getByRole('button', { name: 'Collapse' })).toBeTruthy()
|
||||
})
|
||||
|
||||
it('shows Fireworks in slot #2 ahead of other OAuth providers', () => {
|
||||
it('shows Fireworks first in the expanded list, ahead of other OAuth providers', () => {
|
||||
setProviders([
|
||||
provider('openai-codex', 'OpenAI Codex / ChatGPT'),
|
||||
provider('minimax-oauth', 'MiniMax'),
|
||||
|
|
|
|||
|
|
@ -467,19 +467,22 @@ export function Picker({ ctx }: { ctx: OnboardingContext }) {
|
|||
const select = (p: OAuthProvider) => void startProviderOAuth(p, ctx)
|
||||
const featured = ordered.find(p => p.id === FEATURED_ID) ?? null
|
||||
const rest = featured ? ordered.filter(p => p.id !== FEATURED_ID) : ordered
|
||||
// Collapse the secondary providers behind a disclosure only when Nous
|
||||
// Portal is present to anchor the choice — otherwise show the full list.
|
||||
const collapsible = Boolean(featured) && rest.length > 0
|
||||
// Collapse the secondary providers behind a disclosure whenever Nous Portal
|
||||
// is present to anchor the choice — otherwise show the full list. The
|
||||
// Fireworks/OpenRouter key rows always live behind the disclosure, so the
|
||||
// toggle is warranted even when there are no other OAuth providers.
|
||||
const collapsible = Boolean(featured)
|
||||
const showRest = !collapsible || showAll
|
||||
|
||||
return (
|
||||
<div className="grid gap-2">
|
||||
<div className="grid max-h-[60dvh] gap-2 overflow-y-auto p-1">
|
||||
{featured ? <FeaturedProviderRow onSelect={select} provider={featured} /> : null}
|
||||
{/* Slot #2 — always visible, matching CANONICAL_PROVIDERS (Nous → Fireworks). */}
|
||||
<FireworksProviderRow onClick={() => openKeyForm('FIREWORKS_API_KEY')} />
|
||||
{showRest ? (
|
||||
<>
|
||||
{/* Fireworks leads the expanded list, matching CANONICAL_PROVIDERS
|
||||
(Nous → Fireworks), but stays hidden until the user opens it. */}
|
||||
<FireworksProviderRow onClick={() => openKeyForm('FIREWORKS_API_KEY')} />
|
||||
{rest.map(p => (
|
||||
<ProviderRow key={p.id} onSelect={select} provider={p} />
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ function ConnectedTag() {
|
|||
const PROVIDER_ROW_CLASS =
|
||||
'group flex w-full items-center justify-between gap-3 rounded-[6px] px-3 py-2.5 text-left transition-colors hover:bg-(--ui-control-hover-background)'
|
||||
|
||||
/** Quick-key row for API-key providers (Fireworks #2 after Nous, OpenRouter further down). */
|
||||
/** Quick-key row for API-key providers (Fireworks leads the expanded list after Nous, OpenRouter further down). */
|
||||
export function KeyProviderRow({ onClick, pitch, title }: { onClick: () => void; pitch: string; title: string }) {
|
||||
return (
|
||||
<RowButton className={PROVIDER_ROW_CLASS} onClick={onClick}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue