I think the important part of it was “consensual search”. It really doesn’t matter why the cop started talking to you if you consent to a search you have waived your 4th amendment rights.
The ruling was in light of the stop, not the search specifically. Roberts’ wording is what is troubling.
Read my post above yours, consent is immaterial to this case. The reason for the search, and consent to said search, was immaterial. The court was looking at the legality of the stop.