Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 7010472

Browse files
committed
feat(tab): enable Shift + Wheel to switch tabs
1 parent dd4cb7d commit 7010472

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

apps/client/src/widgets/tab_row.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,23 @@ export default class TabRowWidget extends BasicWidget {
399399
isScrolling = false;
400400
}
401401
};
402-
this.$tabScrollingContainer[0].addEventListener('wheel', (event) => {
403-
if (!event.shiftKey || event.deltaX === 0) {
402+
this.$tabScrollingContainer[0].addEventListener('wheel', async (event) => {
403+
if (!event.shiftKey && event.deltaX === 0) {
404404
event.preventDefault();
405405
// Clamp deltaX between TAB_CONTAINER_MIN_WIDTH and TAB_CONTAINER_MIN_WIDTH * 3
406406
deltaX += Math.sign(event.deltaY) * Math.max(Math.min(Math.abs(event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3), TAB_CONTAINER_MIN_WIDTH);
407407
if (!isScrolling) {
408408
isScrolling = true;
409409
stepScroll();
410410
}
411+
} else if (event.shiftKey) {
412+
event.preventDefault();
413+
if (event.deltaY > 0) {
414+
await appContext.tabManager.activateNextTabCommand();
415+
} else {
416+
await appContext.tabManager.activatePreviousTabCommand();
417+
}
418+
this.activeTabEl.scrollIntoView();
411419
}
412420
});
413421

0 commit comments

Comments
 (0)