From ce4fd6e22b016597f994042ea4d134b20918d175 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Fri, 5 Jun 2026 08:51:01 -0400 Subject: [PATCH] fix(settings): wire up version dialog button in ServerHealthStatus (#253) * fix(settings): wire up version dialog button in ServerHealthStatus * fix(settings): render VersionSelectDialog outside outer Dialog to prevent nesting issues * fix(settings): use portal + guarded close for version dialog to prevent Radix nesting issue * fix(settings): replace portal workaround with direct VersionSelectDialog render Remove the createPortal + useRef guarded-close pattern for the version dialog (introduced to work around Radix nesting issues). Instead render VersionSelectDialog directly inside the Dialog and prevent outside interactions via onInteractOutside/onFocusOutside/onPointerDownOutside preventDefault. Delete the obsolete VersionSelectContent component. --- .../components/settings/SettingsDialog.tsx | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/settings/SettingsDialog.tsx b/frontend/src/components/settings/SettingsDialog.tsx index b9a3ca0a..d7eac1ec 100644 --- a/frontend/src/components/settings/SettingsDialog.tsx +++ b/frontend/src/components/settings/SettingsDialog.tsx @@ -11,6 +11,7 @@ import { ProviderSettings } from '@/components/settings/ProviderSettings' import { AccountSettings } from '@/components/settings/AccountSettings' import { VoiceSettings } from '@/components/settings/VoiceSettings' import { NotificationSettings } from '@/components/settings/NotificationSettings' +import { VersionSelectDialog } from '@/components/settings/VersionSelectDialog' import { Dialog, DialogContent } from '@/components/ui/dialog' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Settings2, Keyboard, Code, ChevronLeft, Key, GitBranch, User, Volume2, Bell, X } from 'lucide-react' @@ -22,6 +23,7 @@ type SettingsView = 'menu' | 'general' | 'git' | 'shortcuts' | 'opencode' | 'pro export function SettingsDialog() { const { isOpen, close, activeTab, setActiveTab } = useSettingsDialog() const [mobileView, setMobileView] = useState('menu') + const [isVersionDialogOpen, setIsVersionDialogOpen] = useState(false) const [sectionHistory, setSectionHistory] = useState([]) const [authSectionsOpen, setAuthSectionsOpen] = useState(true) const toggleAuthSections = useCallback(() => setAuthSectionsOpen((open) => !open), []) @@ -64,14 +66,13 @@ export function SettingsDialog() { return } const handleKeyDown = (e: KeyboardEvent) => { - if (e.key === 'Escape') { - e.stopPropagation() + if (e.key === 'Escape' && !isVersionDialogOpen) { close() } } - document.addEventListener('keydown', handleKeyDown) - return () => document.removeEventListener('keydown', handleKeyDown) - }, [isOpen, close]) + document.addEventListener('keydown', handleKeyDown, { capture: true }) + return () => document.removeEventListener('keydown', handleKeyDown, { capture: true }) + }, [isOpen, close, isVersionDialogOpen]) const menuItems = [ { id: 'account', icon: User, label: 'Account', description: 'Profile, passkeys, and sign out' }, @@ -104,6 +105,9 @@ export function SettingsDialog() { fullscreen canSwipeBack={() => mobileView !== 'menu'} onSwipeBack={handleSettingsBack} + onInteractOutside={(e) => e.preventDefault()} + onFocusOutside={(e) => e.preventDefault()} + onPointerDownOutside={(e) => e.preventDefault()} >
@@ -159,7 +163,7 @@ export function SettingsDialog() {
- + setIsVersionDialogOpen(true)} />
@@ -232,7 +236,7 @@ export function SettingsDialog() { {mobileView === 'shortcuts' &&
} {mobileView === 'opencode' && (
- + setIsVersionDialogOpen(true)} /> @@ -242,7 +246,12 @@ export function SettingsDialog() { {mobileView === 'providers' &&
}
+ + ) }