From 1a7cf409eb7e5d07decc8dca8a36112682aa0218 Mon Sep 17 00:00:00 2001 From: AndyMik90 Date: Fri, 19 Dec 2025 16:19:50 +0100 Subject: [PATCH] auto-claude: subtask-2-2 - Implement fallback URL display when browser launch fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added fallback URL card in error state when authUrl is available - Shows "Complete Authentication Manually" instructions when browser fails to open - Added copyable URL display with Copy button that tracks copy state separately - Added "Open URL in Browser" button to attempt manual browser launch - Shows device code reminder in fallback card if available - Changed Retry button in error state to call handleStartAuth instead of handleRetry for fresh auth attempt - Added urlCopied state variable to track URL copy status independently from device code copy status 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../project-settings/GitHubOAuthFlow.tsx | 80 ++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/auto-claude-ui/src/renderer/components/project-settings/GitHubOAuthFlow.tsx b/auto-claude-ui/src/renderer/components/project-settings/GitHubOAuthFlow.tsx index df9e677e..c51a2132 100644 --- a/auto-claude-ui/src/renderer/components/project-settings/GitHubOAuthFlow.tsx +++ b/auto-claude-ui/src/renderer/components/project-settings/GitHubOAuthFlow.tsx @@ -47,6 +47,7 @@ export function GitHubOAuthFlow({ onSuccess, onCancel }: GitHubOAuthFlowProps) { const [authUrl, setAuthUrl] = useState(null); const [browserOpened, setBrowserOpened] = useState(false); const [codeCopied, setCodeCopied] = useState(false); + const [urlCopied, setUrlCopied] = useState(false); // Check gh CLI installation and authentication status on mount // Use a ref to prevent double-execution in React Strict Mode @@ -151,6 +152,7 @@ export function GitHubOAuthFlow({ onSuccess, onCancel }: GitHubOAuthFlowProps) { setAuthUrl(null); setBrowserOpened(false); setCodeCopied(false); + setUrlCopied(false); try { debugLog('Calling startGitHubAuth...'); @@ -430,8 +432,84 @@ export function GitHubOAuthFlow({ onSuccess, onCancel }: GitHubOAuthFlowProps) { + {/* Fallback URL display when browser failed to open */} + {authUrl && ( + + +
+
+ +
+

+ Complete Authentication Manually +

+

+ The browser couldn't be opened automatically. Please visit the URL below to complete authentication: +

+
+
+ +
+
+ + {authUrl} + + +
+ + +
+ + {/* Device code reminder if available */} + {deviceCode && ( +
+

+ When prompted, enter this code:{' '} + + {deviceCode} + +

+
+ )} +
+
+
+ )} +
- {onCancel && (