diff --git a/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js b/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js
index 6060a0e5d8..eb5fb47e26 100644
--- a/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js
+++ b/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js
@@ -67,12 +67,12 @@ function PreviewLogEntryHeader({
}) {
const { t } = useTranslation()
const logLocationSpanRef = useRef()
- const [showLocationTooltip, setShowLocationTooltip] = useState(false)
+ const [locationSpanOverflown, setLocationSpanOverflown] = useState(false)
useResizeObserver(
logLocationSpanRef,
- showLocationTooltip,
- setTooltipForLogLocationLinkIfNeeded
+ locationSpanOverflown,
+ checkLocationSpanOverflow
)
const file = sourceLocation ? sourceLocation.file : null
@@ -95,10 +95,10 @@ function PreviewLogEntryHeader({
location: file + (line ? `, ${line}` : ''),
})
- function setTooltipForLogLocationLinkIfNeeded(observedElement) {
+ function checkLocationSpanOverflow(observedElement) {
const spanEl = observedElement.target
- const shouldShowTooltip = spanEl.scrollWidth > spanEl.clientWidth
- setShowLocationTooltip(shouldShowTooltip)
+ const isOverflowing = spanEl.scrollWidth > spanEl.clientWidth
+ setLocationSpanOverflown(isOverflowing)
}
const locationLinkText =
@@ -132,11 +132,12 @@ function PreviewLogEntryHeader({
) : null
- const locationTooltip = showLocationTooltip ? (
-