From de4f0f7d6f1bc2fa3d05aef8f06a045053d84ef6 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Mon, 9 Jun 2025 11:33:16 +0800 Subject: [PATCH 1/3] fix(tab-row): Simplify scrolling logic --- apps/client/src/widgets/tab_row.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts index 776f379a9..3c2fce86a 100644 --- a/apps/client/src/widgets/tab_row.ts +++ b/apps/client/src/widgets/tab_row.ts @@ -285,6 +285,7 @@ const TAB_ROW_TPL = ` overflow-y: hidden; scrollbar-width: none; /* Firefox */ } + /* Chrome/Safari */ .tab-row-widget-scrolling-container::-webkit-scrollbar { display: none; @@ -391,11 +392,7 @@ export default class TabRowWidget extends BasicWidget { return; } event.preventDefault(); - - const delta = Math.sign(wheelEvent.deltaX + wheelEvent.deltaY) * - Math.min(Math.abs(wheelEvent.deltaX + wheelEvent.deltaY), TAB_CONTAINER_MIN_WIDTH * 2); - - this.scrollTabContainer(delta, "instant"); + event.currentTarget.scrollLeft += wheelEvent.deltaY + wheelEvent.deltaX; }); this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200)); From 949ff17776ea77377d167ca56ffe7ff6d6e13ba1 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Mon, 9 Jun 2025 13:59:52 +0800 Subject: [PATCH 2/3] fix(tab-row): Simplify scrolling logic --- apps/client/src/widgets/tab_row.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts index 3c2fce86a..ba718b3f7 100644 --- a/apps/client/src/widgets/tab_row.ts +++ b/apps/client/src/widgets/tab_row.ts @@ -392,6 +392,7 @@ export default class TabRowWidget extends BasicWidget { return; } event.preventDefault(); + event.stopImmediatePropagation(); event.currentTarget.scrollLeft += wheelEvent.deltaY + wheelEvent.deltaX; }); From f48d17cb22c407137bbd7f24b59c2ef8fd0a3480 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Mon, 9 Jun 2025 14:06:15 +0800 Subject: [PATCH 3/3] fix(tab-row): Make the default distance include margin --- apps/client/src/widgets/tab_row.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts index ba718b3f7..9d868a811 100644 --- a/apps/client/src/widgets/tab_row.ts +++ b/apps/client/src/widgets/tab_row.ts @@ -396,8 +396,8 @@ export default class TabRowWidget extends BasicWidget { event.currentTarget.scrollLeft += wheelEvent.deltaY + wheelEvent.deltaX; }); - this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200)); - this.$scrollButtonRight[0].addEventListener('click', () => this.scrollTabContainer(200)); + this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-210)); + this.$scrollButtonRight[0].addEventListener('click', () => this.scrollTabContainer(210)); this.$tabScrollingContainer[0].addEventListener('scroll', () => { clearTimeout(this.updateScrollTimeout); @@ -729,7 +729,7 @@ export default class TabRowWidget extends BasicWidget { const scorllContainerBounds = this.$tabScrollingContainer[0]?.getBoundingClientRect(); const pointerX = pointer.pageX; - const scrollSpeed = 100; // The increment of each scroll. + const scrollSpeed = 105; // The increment of each scroll. // Check if the mouse is near the edge of the container and trigger scrolling. if (pointerX < scorllContainerBounds.left) { this.scrollTabContainer(- scrollSpeed);