Yeah it's weird. If rebuilding a house but keeping the old foundations means it's a new house, then keeping the riverbank but different water in it should mean it's a new river - but it's not.

I personally think our brains are wired so that the continuity over time is what matters, unless the change is too significant.

So you can change every single part and the thing (body, house, whatever) is still the same as long as you do it slowly enough that each part assumes the identity of the whole before the next change. If you do it too fast or all at once then it's not the same because you perceive it to be different.