Use toast notifications for SyncTeX errors and handle missing file errors (#24579)

GitOrigin-RevId: 88c6658ff0d11fdb43cef19c48b542a3b2206666
This commit is contained in:
Alf Eaton
2025-04-28 08:05:42 +00:00
committed by Copybot
parent c6ac06b51c
commit c732a02b38
7 changed files with 85 additions and 45 deletions
@@ -2,11 +2,9 @@ import { useTranslation } from 'react-i18next'
import { LostConnectionAlert } from './lost-connection-alert'
import { useConnectionContext } from '@/features/ide-react/context/connection-context'
import { debugging } from '@/utils/debugging'
import useScopeValue from '@/shared/hooks/use-scope-value'
import { createPortal } from 'react-dom'
import { useGlobalAlertsContainer } from '@/features/ide-react/context/global-alerts-context'
import OLNotification from '@/features/ui/components/ol/ol-notification'
import OLButton from '@/features/ui/components/ol/ol-button'
export function Alerts() {
const { t } = useTranslation()
@@ -19,8 +17,6 @@ export function Alerts() {
} = useConnectionContext()
const globalAlertsContainer = useGlobalAlertsContainer()
const [synctexError] = useScopeValue('sync_tex_error')
if (!globalAlertsContainer) {
return null
}
@@ -50,24 +46,6 @@ export function Alerts() {
/>
) : null}
{synctexError ? (
<OLNotification
type="warning"
content={<strong>{t('synctex_failed')}</strong>}
action={
<OLButton
href="/learn/how-to/SyncTeX_Errors"
target="_blank"
id="synctex-more-info-button"
variant="secondary"
size="sm"
>
{t('more_info')}
</OLButton>
}
/>
) : null}
{connectionState.inactiveDisconnect ||
(connectionState.readyState === WebSocket.CLOSED &&
(connectionState.error === 'rate-limited' ||