From bec12df38c7c53d31f176f60abe36cedbadf62ca Mon Sep 17 00:00:00 2001 From: Kainoa Date: Mon, 19 Jan 2026 09:12:27 -0800 Subject: [PATCH] feat(integrations): add GitHub disconnect button to settings Users can now disconnect their GitHub account from the integrations settings panel, matching the behavior already available for Linear and Jira integrations. --- src/renderer/components/IntegrationsCard.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/IntegrationsCard.tsx b/src/renderer/components/IntegrationsCard.tsx index 4691347f..d31bd1be 100644 --- a/src/renderer/components/IntegrationsCard.tsx +++ b/src/renderer/components/IntegrationsCard.tsx @@ -36,7 +36,7 @@ const IntegrationsCard: React.FC = () => { const [linearState, setLinearState] = useState( () => cachedLinearState ?? defaultLinearState ); - const { installed, authenticated, user, isLoading, login, checkStatus } = useGithubAuth(); + const { installed, authenticated, user, isLoading, login, logout, checkStatus } = useGithubAuth(); const [githubError, setGithubError] = useState(null); // Jira state const [jiraSite, setJiraSite] = useState(''); @@ -264,6 +264,16 @@ const IntegrationsCard: React.FC = () => { } }, [checkStatus, login]); + const handleGithubDisconnect = useCallback(async () => { + setGithubError(null); + try { + await logout(); + } catch (error) { + console.error('GitHub logout failed:', error); + setGithubError('Could not disconnect.'); + } + }, [logout]); + const renderStatusIndicator = useCallback( (label: string, tone: 'connected' | 'inactive' = 'inactive') => { const dotClass = tone === 'connected' ? 'bg-emerald-500' : 'bg-muted-foreground/50'; @@ -394,6 +404,7 @@ const IntegrationsCard: React.FC = () => { 'Install & Sign in' ) } + onDisconnect={authenticated ? () => void handleGithubDisconnect() : undefined} /> {githubError ? (