@octaviaflow/core 3.0.18-beta.33 → 3.0.18-beta.34

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.
package/dist/index.js CHANGED
@@ -12662,6 +12662,7 @@ function ExecutionConsole({
12662
12662
  }) {
12663
12663
  const logEndRef = useRef23(null);
12664
12664
  const logsRef = useRef23(null);
12665
+ const lastScrollTopRef = useRef23(0);
12665
12666
  const [query, setQuery] = useState22("");
12666
12667
  const [activeLevels, setActiveLevels] = useState22(() => new Set(ALL_LEVELS));
12667
12668
  const [activeNode, setActiveNode] = useState22("all");
@@ -12699,9 +12700,13 @@ function ExecutionConsole({
12699
12700
  const handleLogsScroll = () => {
12700
12701
  const el = logsRef.current;
12701
12702
  if (!el) return;
12702
- const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
12703
- if (distance > 60 && autoScroll) setAutoScroll(false);
12703
+ const prev = lastScrollTopRef.current;
12704
+ const curr = el.scrollTop;
12705
+ const distance = el.scrollHeight - curr - el.clientHeight;
12706
+ const userScrolledUp = curr < prev - 1;
12707
+ if (userScrolledUp && distance > 60 && autoScroll) setAutoScroll(false);
12704
12708
  if (distance <= 8 && !autoScroll) setAutoScroll(true);
12709
+ lastScrollTopRef.current = curr;
12705
12710
  };
12706
12711
  const toggleLevel = (level) => {
12707
12712
  setActiveLevels((prev) => {