/** * AdvancedSection - Advanced settings including config management and about info. */ import { useCallback, useEffect, useRef, useState } from 'react'; import appIcon from '@renderer/favicon.png'; import { useStore } from '@renderer/store'; import { CheckCircle, Code2, Download, Loader2, RefreshCw, Upload } from 'lucide-react'; import { SettingsSectionHeader } from '../components'; interface AdvancedSectionProps { readonly saving: boolean; readonly onResetToDefaults: () => void; readonly onExportConfig: () => void; readonly onImportConfig: () => void; readonly onOpenInEditor: () => void; } export const AdvancedSection = ({ saving, onResetToDefaults, onExportConfig, onImportConfig, onOpenInEditor, }: AdvancedSectionProps): React.JSX.Element => { const [version, setVersion] = useState(''); const updateStatus = useStore((s) => s.updateStatus); const availableVersion = useStore((s) => s.availableVersion); const checkForUpdates = useStore((s) => s.checkForUpdates); // Auto-revert "not-available" / "error" status back to idle after a brief display const revertTimerRef = useRef>(); useEffect(() => { if (updateStatus === 'not-available' || updateStatus === 'error') { revertTimerRef.current = setTimeout(() => { useStore.setState({ updateStatus: 'idle' }); }, 3000); } return () => { if (revertTimerRef.current) clearTimeout(revertTimerRef.current); }; }, [updateStatus]); useEffect(() => { window.electronAPI.getAppVersion().then(setVersion).catch(console.error); }, []); const handleCheckForUpdates = useCallback(() => { checkForUpdates(); }, [checkForUpdates]); const getUpdateButtonContent = (): React.JSX.Element => { switch (updateStatus) { case 'checking': return ( <> Checking... ); case 'not-available': return ( <> Up to date ); case 'available': case 'downloaded': return ( <> {updateStatus === 'downloaded' ? 'Update ready' : `v${availableVersion} available`} ); default: return ( <> Check for Updates ); } }; return (
App Icon

Claude Code Context

Version {version || '...'}

Visualize and analyze Claude Code session executions with interactive waterfall charts and detailed insights.

); };