From 8dee207b8cccf61dc4ea12e0d0c3547588b5985c Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Fri, 17 Oct 2025 15:12:03 -0700 Subject: [PATCH] WorkflowTabs: cleanup scroll/overflow handling and watcher disposal (#6080) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Refactor and cleanup `WorkflowTabs` scroll/overflow handling to improve stability, ensure proper watcher disposal, and keep the active tab in view more reliably. note: honestly a nit, can drop if review is too annoying ## Changes - **What**: - Replace `ScrollPanel` ref with `containerRef` and query `.p-scrollpanel-content` within the container. - Add computed `scrollContent` to centralize access to the scrollable element. - Add `ensureActiveTabVisible({ waitForDom })` option to skip `nextTick` when not needed. - Rework watchers with explicit `WatchStopHandle`s and `onCleanup` to stop previous watchers and dispose `overflowObserver` correctly when `scrollContent` changes. - Update arrow enable logic by watching `arrivedState.left/right` together and setting `leftArrowEnabled`/`rightArrowEnabled` immediately. - Only measure and re-ensure visibility when overflowing; call `scrollState.measure()` and `ensureActiveTabVisible({ waitForDom: false })` after arrows update. - **Breaking**: None - **Dependencies**: None ## Review Focus - Correctness of watcher lifecycle and cleanup when `scrollContent` changes - Arrow enablement behavior at scroll boundaries - Reliability of `ensureActiveTabVisible` across tab selection and overflow changes - Regressions in scroll performance and tab visibility ## Screenshots (if applicable) N/A ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6080-WorkflowTabs-cleanup-scroll-overflow-handling-and-watcher-disposal-28d6d73d3650819cba6de70fb10354ad) by [Unito](https://www.unito.io) --- src/components/topbar/WorkflowTabs.vue | 113 +++++++++++++++---------- 1 file changed, 70 insertions(+), 43 deletions(-) diff --git a/src/components/topbar/WorkflowTabs.vue b/src/components/topbar/WorkflowTabs.vue index 66b1f3573..da3b89876 100644 --- a/src/components/topbar/WorkflowTabs.vue +++ b/src/components/topbar/WorkflowTabs.vue @@ -1,5 +1,6 @@