If zoomed out, and the viewport is past the left edge of the board, (or maybe far enough to the left, not sure if past the left edge is fully correct) and the mouse pointer is close to the left edge of the board, zooming in will eventually cause the viewport to jump to the right.
Similar behavior is observed when the the viewport is over the right edge of the board, though it seems to scroll quickly instead of jump. Which now that I’m messing around with it more, seems to be because the allowable range for the viewport is shrinking as I’m zooming in, making it seem like it’s “scrolling” in response to having zoomed in far enough.
What I’d expect in this case would be the zoom behavior doesn’t cause the user’s viewport to end up outside of the allowed ranges at the edges, so that the viewport doesn’t have to get moved at all as the user zooms in. Potentially a different way to solve this would be to more gradually narrow the allowed range of where the viewport can be so it gets moved more gradually instead of in a big jump or very rapidly.