I know that few in Europe and the US believed in a all-encompassing ‘white’ race during WW1. In the 1930’s, the Nazis supported ‘pan-germanism’, or unity of all Germanic peoples. Yet during the US African-American Civil Rights movement, it appears as though the old divisions between ethnic Italians, Germans, Poles, and English had disappeared and it was just ‘white vs black.’ We take it for granted today that ‘white’ is a uniform and distinct race. I have never heard of anyone working to ‘unite the whites’ in the 1940’s and 1950’s and 1960’s, but that is exactly what happened.
Hey, History Grad student here writing on mobile so if it looks weird I apologise. The best book that I can recommend on the formation of whiteness in the United States is "How the Irish Became White" by Noel Ignayiev. The author agrues that European immigrants found it advantageous to align themselves with existing white Americans. At the beginning of the American colony the Irish were heavily discriminated in the North. A fact that was informed by the situation between England and Ireland. This sort of pan Irish identity formed around a struggle for rights in Ireland and the Untied States. The US racial structure in the 19th was a black white binary. White at the beginning of the 19th century meant Western European and not Irish, Eastern or Southern European. Because of this many Irish were labelled as "Black Irish" meaning they can trace their family back to the early colony.
As the 19th century progressed the children of immigrants from non-western European countries could assimilate easy. They were already a similar skin tone, spoke English, and had a multi generational claim as "American." New immigrants were still being discriminated heavily, often times by other white Americans.
The idea of a united whiteness actually first grew in the South as a response to the slave system. Poor whites helped enforce slavery because they felt Superior to slaves because of their whiteness. After the Civil War, Freedman and women were given the right to vote (at least in theory), which threatened the power dynamics of the United States. The codification of whiteness we can say formed in response of a perceived threat from the newly freed Black communities.
I hope that helps and also explains why immigrants have been treated poorly by their fellow white people.