It seems pretty clear to me that all Sansa cares about is herself, and in this case her revenge. She has treated Jon like shit their whole lives, and this episode was no different.
She knew full well that Jon would be manipulated by Ramsay, she knew that warning Jon would not change shit all too. She knew all along that Jon would lose the battle, and knew all along that she would have Littlefingers help.
Her attack didn't come at the eleventh hour by accident. She waited until Ramsay had fully commited his forces and could not easily retreat back to Winterfell with a sizeable force.
She struck when Ramsay had no option but to retreat almost alone, and knew Jon would do everything in his power to kill the fucker which is why she showed up before he could kill him as she knew he would stop once he saw her.
This whole thing was her plan so she could get her own revenge on Ramsay, and boy did she get it. That wry smile at the end says a lot about her descending into darkness and has been hinted at before this episode.
She was willing to let Jon die to achieve all of this. That says a lot.