President Donald Trump’s trade salvo was years in the making. The details came down to the final moments.