Merge pull request #35941 from overleaf/ds-suggest-fix-disable-offline-mode

[WEB] Disabling buttons in error logs in offline mode

GitOrigin-RevId: b19daaf1cf98ecf626568690ff677a491b8dad63
This commit is contained in:
Davinder Singh
2026-09-17 11:40:38 +00:00
committed by Copybot
parent 52350353cb
commit 0458293e9e
@@ -21,6 +21,7 @@ import importOverleafModules from '../../../../macros/import-overleaf-module.mac
import MaterialIcon from '@/shared/components/material-icon'
import { useFileTreePathContext } from '@/features/file-tree/contexts/file-tree-path'
import { useFileTreeOpenContext } from '@/features/ide-react/context/file-tree-open-context'
import useIsNetworkStalled from '@/features/ide-react/hooks/use-is-network-stalled'
const actionComponents = importOverleafModules(
'pdfLogEntryHeaderActionComponents'
@@ -61,6 +62,7 @@ function LogEntryHeader({
const [locationSpanOverflown, setLocationSpanOverflown] = useState(false)
const { findEntityByPath } = useFileTreePathContext()
const { openEntity } = useFileTreeOpenContext()
const isDisabledDueToNetworkStall = useIsNetworkStalled()
useResizeObserver(
logLocationSpanRef,
@@ -170,12 +172,24 @@ function LogEntryHeader({
description={t('go_to_code_location')}
overlayProps={{ placement: 'bottom' }}
>
<OLIconButton
onClick={onSourceLocationClick}
variant="ghost"
icon="my_location"
accessibilityLabel={t('go_to_code_location')}
/>
{isDisabledDueToNetworkStall ? (
<span className="d-inline-block">
<OLIconButton
onClick={onSourceLocationClick}
variant="ghost"
icon="my_location"
accessibilityLabel={t('go_to_code_location')}
disabled
/>
</span>
) : (
<OLIconButton
onClick={onSourceLocationClick}
variant="ghost"
icon="my_location"
accessibilityLabel={t('go_to_code_location')}
/>
)}
</OLTooltip>
)}
{actionComponents.map(({ import: { default: Component }, path }) => (