diff --git a/packages/ui/src/components/ui/UpdateDialog.tsx b/packages/ui/src/components/ui/UpdateDialog.tsx index b50add83..bdf2a6d2 100644 --- a/packages/ui/src/components/ui/UpdateDialog.tsx +++ b/packages/ui/src/components/ui/UpdateDialog.tsx @@ -4,6 +4,7 @@ import { DialogContent, DialogTitle, } from '@/components/ui/dialog'; +import { Button } from '@/components/ui/button'; import { ScrollableOverlay } from '@/components/ui/ScrollableOverlay'; import { SimpleMarkdownRenderer } from '@/components/chat/MarkdownRenderer'; import { Icon } from "@/components/icon/Icon"; @@ -27,10 +28,10 @@ interface UpdateDialogProps { onDownload: () => void; onRestart: () => void; /** Runtime type to show different UI for desktop vs web */ - runtimeType?: 'desktop' | 'web' | 'vscode' | null; + runtimeType?: 'desktop' | 'web' | 'vscode' | 'mobile' | null; } -const GITHUB_RELEASES_URL = 'https://github.com/btriapitsyn/openchamber/releases'; +const GITHUB_RELEASES_URL = 'https://github.com/openchamber/openchamber/releases'; type ChangelogSection = { version: string; @@ -206,14 +207,16 @@ export const UpdateDialog: React.FC = ({ const [webError, setWebError] = useState(null); const releaseUrl = info?.version - ? `${GITHUB_RELEASES_URL}/tag/v${info.version}` + ? (info.releaseUrl || `${GITHUB_RELEASES_URL}/tag/v${info.version}`) : GITHUB_RELEASES_URL; + const mobileUpdateUrl = info?.downloadUrl || releaseUrl; const progressPercent = progress?.total ? Math.round((progress.downloaded / progress.total) * 100) : 0; const isWebRuntime = runtimeType === 'web'; + const isMobileRuntime = runtimeType === 'mobile'; const updateCommand = info?.updateCommand || 'openchamber update'; // Reset state when dialog closes @@ -264,6 +267,10 @@ export const UpdateDialog: React.FC = ({ } }, [info?.currentVersion, t]); + const handleMobileUpdate = useCallback(() => { + void handleOpenExternal(mobileUpdateUrl); + }, [handleOpenExternal, mobileUpdateUrl]); + const isWebUpdating = webUpdateState !== 'idle' && webUpdateState !== 'error'; const changelog = useMemo(() => { @@ -437,7 +444,7 @@ export const UpdateDialog: React.FC = ({ )} {/* Desktop progress bar */} - {!isWebRuntime && downloading && ( + {!isWebRuntime && !isMobileRuntime && downloading && (
{t('updateDialog.status.downloadingPayload')} @@ -474,7 +481,7 @@ export const UpdateDialog: React.FC = ({
{/* Desktop Buttons */} - {!isWebRuntime && !downloaded && !downloading && ( + {!isWebRuntime && !isMobileRuntime && !downloaded && !downloading && ( )} - {!isWebRuntime && downloading && ( + {!isWebRuntime && !isMobileRuntime && downloading && ( )} - {!isWebRuntime && downloaded && ( + {!isWebRuntime && !isMobileRuntime && downloaded && ( + )} + {isWebRuntime && !isWebUpdating && (