@@ -56,15 +56,24 @@ export function useAuxillariesSurface({
5656 const { data : sessionUser , isLoading : userLoading } = useUser ( ) ;
5757 const { data : profileData , isLoading : profileLoading } = useProfile ( ) ;
5858 const { data : onboardingData } = useOnboarding ( ) ;
59- const { data : auxillaryData , hasWalletConnection, hasGitHubConnection, hasValidGitHubConnection } =
60- useUserData ( ) ;
59+ const {
60+ data : auxillaryData ,
61+ hasWalletConnection,
62+ hasGitHubConnection,
63+ hasValidGitHubConnection,
64+ repositories,
65+ } = useUserData ( ) ;
6166
6267 const authLoaded = ! userLoading ;
6368 // Wallet-native identity: a bound Bitcoin wallet counts as connected even
6469 // before a Supabase session user is present (Connect / Disconnect chrome).
6570 const hasConnectedIdentity = Boolean ( sessionUser ) || hasWalletConnection ;
66- const needsGitHubConnectAttention =
67- hasWalletConnection && ! ( hasValidGitHubConnection || hasGitHubConnection ) ;
71+ // Onboarding GitHub step: App install + at least one authorized repository.
72+ const hasAuthorizedGitHubRepository =
73+ ( hasValidGitHubConnection || hasGitHubConnection ) &&
74+ Array . isArray ( repositories ) &&
75+ repositories . length >= 1 ;
76+ const needsGitHubConnectAttention = hasWalletConnection && ! hasAuthorizedGitHubRepository ;
6877 const [ supabaseClient ] = useState ( ( ) => createClient ( ) ) ;
6978 const router = useRouter ( ) ;
7079 const pathname = usePathname ( ) ;
@@ -327,13 +336,19 @@ export function useAuxillariesSurface({
327336 /**
328337 * After wallet is bound but GitHub is not: open Externals and purple-spotlight
329338 * the Repository Connection card + Install GitHub App button.
339+ * Used by auto-cue after wallet bind and by chrome "Authorize GitHub".
330340 */
331341 const focusExternalsGitHubConnect = useCallback ( ( ) => {
332342 setCurrentStep ( 'externals' ) ;
333343 trackEvent ( 'auxillaries_connect_focus_github' ) ;
334344 requestGitHubConnectAttention ( ) ;
335345 } , [ ] ) ;
336346
347+ /** Chrome twin of Connect: Externals pane + purple GitHub attention. */
348+ const handleAuthorizeGitHubChrome = useCallback ( ( ) => {
349+ focusExternalsGitHubConnect ( ) ;
350+ } , [ focusExternalsGitHubConnect ] ) ;
351+
337352 const prevWalletConnectedRef = useRef ( false ) ;
338353 const githubCueOnOpenRef = useRef ( false ) ;
339354
@@ -410,6 +425,7 @@ export function useAuxillariesSurface({
410425 sessionUser,
411426 hasWalletConnection,
412427 hasConnectedIdentity,
428+ needsGitHubConnectAttention,
413429 profileData,
414430 profileLoading,
415431 auxillaryData,
@@ -434,6 +450,7 @@ export function useAuxillariesSurface({
434450 auxillariesBackgroundAnimationClass,
435451 handleSignOut,
436452 handleConnectChrome,
453+ handleAuthorizeGitHubChrome,
437454 handleStepComplete,
438455 handleStepClick,
439456 handleStepCompletionChange,
0 commit comments