/** * ContextSwitchOverlay - Full-screen loading overlay during context switches. * * Displayed when isContextSwitching is true, preventing stale data flash * during workspace transitions. */ import React from 'react'; import { useAppTranslation } from '@features/localization/renderer'; import { useStore } from '@renderer/store'; export const ContextSwitchOverlay: React.FC = () => { const { t } = useAppTranslation('common'); const isContextSwitching = useStore((state) => state.isContextSwitching); const targetContextId = useStore((state) => state.targetContextId); if (!isContextSwitching) { return null; } // Format context label for display const contextLabel = targetContextId === 'local' ? t('context.local') : (targetContextId?.replace(/^ssh-/, '') ?? t('states.unknown')); return (
{t('context.switchingTo', { workspace: contextLabel })}
{t('context.loadingWorkspace')}