Skip to content

Commit 76ce664

Browse files
committed
Prevent preview overlay when committing into first lane
1 parent bf92c26 commit 76ce664

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/desktop/src/components/MultiStackView.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,14 @@
159159
});
160160
}}
161161
use:resizeObserver={(data) => {
162+
// An experiment in prevent content shift. Currently this mechanism
163+
// allows content shift if the main viewport is scrolled to the left,
164+
// because the content shift is most annoyin when there are many
165+
// lanes and you are e.g. making a commit to one of them.
162166
if (lastWidth && lanesScrollableEl) {
167+
// Only offset for sudden large changes.
163168
const diff = lastWidth - lanesScrollableEl.clientWidth;
164-
if (Math.abs(diff) > 100) {
169+
if (Math.abs(diff) > 300 && lanesScrollableEl.scrollLeft > 300) {
165170
lanesScrollableEl.scrollBy({ left: diff });
166171
}
167172
}

0 commit comments

Comments
 (0)