causal-inspector 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,7 +56,13 @@ function InfiniteScrollSentinel({ onVisible, loading }) {
|
|
|
56
56
|
const ref = useRef(null);
|
|
57
57
|
const onVisibleRef = useRef(onVisible);
|
|
58
58
|
onVisibleRef.current = onVisible;
|
|
59
|
+
// Re-create observer when loading finishes so it re-checks visibility.
|
|
60
|
+
// Without this, if loaded events collapse into one group row the sentinel
|
|
61
|
+
// stays visible but the observer never fires again (it only fires on
|
|
62
|
+
// enter/leave transitions).
|
|
59
63
|
useEffect(() => {
|
|
64
|
+
if (loading)
|
|
65
|
+
return;
|
|
60
66
|
const el = ref.current;
|
|
61
67
|
if (!el)
|
|
62
68
|
return;
|
|
@@ -64,7 +70,7 @@ function InfiniteScrollSentinel({ onVisible, loading }) {
|
|
|
64
70
|
onVisibleRef.current(); }, { rootMargin: "200px" });
|
|
65
71
|
observer.observe(el);
|
|
66
72
|
return () => observer.disconnect();
|
|
67
|
-
}, []);
|
|
73
|
+
}, [loading]);
|
|
68
74
|
return (_jsx("div", { ref: ref, className: "flex items-center justify-center py-4", children: loading && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-indigo-500/50 animate-pulse" }), _jsx("span", { className: "text-[10px] text-muted-foreground/60", children: "Loading" })] })) }));
|
|
69
75
|
}
|
|
70
76
|
export function TimelinePane({ onInvestigate } = {}) {
|