I think you legally are in the US while at an American border crossing - at least if the crossing is on US land, which it was in this case. It might be more complicated for preclearance spots. It's just that normal rights are suspended there despite being in the US, even for citizens. Make of that what you will.

Your rights are not suspended, but border agents don’t need a reason to investigate you

And if you are a citizen, they can’t deny you entry. They can make it take a while, but you will be admitted.

...and then they start violating all your rights after starting the investigation lol. its just wordplay.

The Constitution makes no exemption for a suspension of rights at the border.

The Supreme court disagrees with you.

The supreme court is made of fallible humans

Have you read https://yalelawjournal.org/forum/customs-immigration-and-rig... ? Quoting from its abstract:

> While the Supreme Court has long recognized a border-search exception to the Fourth Amendment’s warrant requirement, it applies to only two interests: promoting the duty regime and preventing contraband from entering the country; and ensuring that individuals are legally admitted. The government’s recent use of the exception goes substantially beyond these matters.

None of these two interests apply to his targeted search. No duty applies here. By definition, no contraband can exist on an erased phone.

The Supreme Court often disagrees with itself.