As Kitanji Brown Jackson pointed out in her dissent though, it is not that the supreme court is ruling that the president is immune per se. It’s that they want to be the arbiters of when the president can be prosecuted.
And there will be a simple mapping between party and SC majority decision.