@@ -350,40 +350,38 @@ function ConnectionStep({
350350 onToggleEnvironment = { onToggleEnvironment }
351351 />
352352 ) : null }
353- < Collapsible
354- open = { pairingOpen }
355- onOpenChange = { setPairingOpen }
356- className = "rounded-lg border border-border bg-background"
357- >
358- < CollapsibleTrigger
359- disabled = { isPairing }
360- render = {
361- < Button
362- variant = "ghost"
363- className = "h-auto min-h-14 w-full justify-start gap-3 px-3 py-3 text-left whitespace-normal sm:h-auto"
364- />
365- }
366- >
367- < LinkIcon className = "size-4 text-muted-foreground" />
368- < span className = "flex-1" > Add a computer</ span >
369- < ChevronRightIcon
370- className = { cn ( "size-4 text-muted-foreground" , pairingOpen && "rotate-90" ) }
371- />
372- </ CollapsibleTrigger >
373- < CollapsiblePanel >
374- < div className = "px-3 pb-3" >
375- < PairingForm
376- isPairing = { isPairing }
377- setIsPairing = { setIsPairing }
378- onPaired = { ( environmentId ) => {
379- setPairingOpen ( false ) ;
380- onPaired ( environmentId ) ;
381- requestAnimationFrame ( ( ) => continueRef . current ?. focus ( ) ) ;
382- } }
353+ < div className = "rounded-lg border border-border bg-background" >
354+ < Collapsible open = { pairingOpen } onOpenChange = { setPairingOpen } >
355+ < CollapsibleTrigger
356+ disabled = { isPairing }
357+ render = {
358+ < Button
359+ variant = "ghost"
360+ className = "h-auto min-h-14 w-full justify-start gap-3 px-3 py-3 text-left whitespace-normal sm:h-auto"
361+ />
362+ }
363+ >
364+ < LinkIcon className = "size-4 text-muted-foreground" />
365+ < span className = "flex-1" > Add a computer</ span >
366+ < ChevronRightIcon
367+ className = { cn ( "size-4 text-muted-foreground" , pairingOpen && "rotate-90" ) }
383368 />
384- </ div >
385- </ CollapsiblePanel >
386- </ Collapsible >
369+ </ CollapsibleTrigger >
370+ < CollapsiblePanel >
371+ < div className = "px-3 pb-3" >
372+ < PairingForm
373+ isPairing = { isPairing }
374+ setIsPairing = { setIsPairing }
375+ onPaired = { ( environmentId ) => {
376+ setPairingOpen ( false ) ;
377+ onPaired ( environmentId ) ;
378+ requestAnimationFrame ( ( ) => continueRef . current ?. focus ( ) ) ;
379+ } }
380+ />
381+ </ div >
382+ </ CollapsiblePanel >
383+ </ Collapsible >
384+ </ div >
387385 </ div >
388386 < div className = "mt-6 flex items-center justify-end gap-3" >
389387 < Button
@@ -419,69 +417,67 @@ function ConnectAccountOption({
419417 const onDiscoveryReady = useCallback ( ( ) => setDiscoveryReady ( true ) , [ ] ) ;
420418
421419 return (
422- < Collapsible
423- open = { expanded && ! ! isSignedIn && discoveryReady }
424- onOpenChange = { setExpanded }
425- className = "rounded-lg border border-border bg-background"
426- >
427- < CollapsibleTrigger
428- disabled = { disabled || ! isLoaded }
429- onClick = { ( event ) => {
430- if ( ! isSignedIn ) {
431- event . preventDefault ( ) ;
432- setExpanded ( true ) ;
433- openAuthPrompt ( ) ;
420+ < div className = "rounded-lg border border-border bg-background" >
421+ < Collapsible open = { expanded && ! ! isSignedIn && discoveryReady } onOpenChange = { setExpanded } >
422+ < CollapsibleTrigger
423+ disabled = { disabled || ! isLoaded }
424+ onClick = { ( event ) => {
425+ if ( ! isSignedIn ) {
426+ event . preventDefault ( ) ;
427+ setExpanded ( true ) ;
428+ openAuthPrompt ( ) ;
429+ }
430+ } }
431+ render = {
432+ < Button
433+ variant = "ghost"
434+ className = "h-auto min-h-14 w-full justify-start gap-3 px-3 py-3 text-left whitespace-normal sm:h-auto"
435+ />
434436 }
435- } }
436- render = {
437- < Button
438- variant = "ghost"
439- className = "h-auto min-h-14 w-full justify-start gap-3 px-3 py-3 text-left whitespace-normal sm:h-auto"
437+ >
438+ < CloudIcon className = "size-4 text-muted-foreground" />
439+ < span className = "flex-1" > T3 Connect</ span >
440+ < span className = "text-xs text-muted-foreground" >
441+ { ! isLoaded
442+ ? "Loading sign-in…"
443+ : ! isSignedIn
444+ ? "Sign in"
445+ : ! discoveryReady
446+ ? "Loading computers…"
447+ : null }
448+ </ span >
449+ < ChevronRightIcon
450+ className = { cn ( "size-4 text-muted-foreground" , expanded && isSignedIn && "rotate-90" ) }
440451 />
441- }
442- >
443- < CloudIcon className = "size-4 text-muted-foreground" />
444- < span className = "flex-1" > T3 Connect</ span >
445- < span className = "text-xs text-muted-foreground" >
446- { ! isLoaded
447- ? "Loading sign-in…"
448- : ! isSignedIn
449- ? "Sign in"
450- : ! discoveryReady
451- ? "Loading computers…"
452- : null }
453- </ span >
454- < ChevronRightIcon
455- className = { cn ( "size-4 text-muted-foreground" , expanded && isSignedIn && "rotate-90" ) }
456- />
457- </ CollapsibleTrigger >
458- < CollapsiblePanel keepMounted >
459- < div className = "px-3 pb-3" >
460- < div className = "mb-3 space-y-1.5" >
461- { isSignedIn ? (
462- < CloudEnvironmentConnectRows
463- primaryEnvironmentId = { null }
464- savedEnvironments = { environments }
465- showSavedEnvironments
466- onDiscoveryReady = { onDiscoveryReady }
467- selection = { { selectedIds, onChange : onToggleEnvironment , autoSelectedComputers } }
468- refreshWhileEmpty
469- empty = {
470- < p className = "py-3 text-sm text-muted-foreground" > No computers linked yet.</ p >
471- }
472- />
473- ) : null }
452+ </ CollapsibleTrigger >
453+ < CollapsiblePanel keepMounted >
454+ < div className = "px-3 pb-3" >
455+ < div className = "mb-3 space-y-1.5" >
456+ { isSignedIn ? (
457+ < CloudEnvironmentConnectRows
458+ primaryEnvironmentId = { null }
459+ savedEnvironments = { environments }
460+ showSavedEnvironments
461+ onDiscoveryReady = { onDiscoveryReady }
462+ selection = { { selectedIds, onChange : onToggleEnvironment , autoSelectedComputers } }
463+ refreshWhileEmpty
464+ empty = {
465+ < p className = "py-3 text-sm text-muted-foreground" > No computers linked yet.</ p >
466+ }
467+ />
468+ ) : null }
469+ </ div >
470+ < p className = "text-sm text-muted-foreground" >
471+ Run this on each computer you want to connect.
472+ </ p >
473+ < CommandBlock command = "npx t3 connect" className = "mt-3" />
474+ < p className = "mt-3 text-xs text-muted-foreground" >
475+ Keep T3 Code running. Select the computers you want to set up above.
476+ </ p >
474477 </ div >
475- < p className = "text-sm text-muted-foreground" >
476- Run this on each computer you want to connect.
477- </ p >
478- < CommandBlock command = "npx t3 connect" className = "mt-3" />
479- < p className = "mt-3 text-xs text-muted-foreground" >
480- Keep T3 Code running. Select the computers you want to set up above.
481- </ p >
482- </ div >
483- </ CollapsiblePanel >
484- </ Collapsible >
478+ </ CollapsiblePanel >
479+ </ Collapsible >
480+ </ div >
485481 ) ;
486482}
487483
0 commit comments