(This will help. They re-arranged the story.)
It’s unclear whether Putin gave Xi a heads up over his plans for the invasion. But if he did, likely Xi assumed any war would be short and limited, and would inevitably result in Russia’s victory (and would, in the process, provide a swift kick in the face for the US and its Nato allies). As the war dragged on, Xi probably saw some advantage in Russia and Nato sapping each other’s strengths.
Something seems to have changed.
China’s foreign minister has unveiled a 12-point peace plan on the one-year anniversary of the invasion on 24 February. Xi’s plans for a trip to Moscow next week were then unveiled, and a call reportedly lined up with President Zelensky of Ukraine after his meeting with Putin. China now
seems to want peace, and is willing to try and broker that.
What has changed? Likely Xi has concluded from Putin’s failed offensive in Bakhmut that Russia cannot win – and may now fear that a devastating defeat for Putin in Ukraine could threaten regime change in Moscow. It is extremely unlikely, but would be a nightmare scenario for Beijing as the emergence of a pro-Western administration in Moscow would leave China encircled. As such, Xi would want a peace in Ukraine which can save Putin’s skin.
Russia and China are now aligned, but no deal is possible without the agreement of Ukraine; and Ukraine still feels it can win this war. But China's
12-point peace plan did include some elements that Kyiv appreciated, including talk of "territorial integrity".
"A sticking point could well be Ukraine giving up on ambitions for Nato membership, but that might well be assuaged by US-Israel style security guarantees from senior Nato states. The problem here is that Putin invaded Ukraine not because of its Nato aspirations, but simply because he
wants Ukraine.
Agreement over Nato member security guarantees for Ukraine would mean, in effect, Russia has lost Ukraine forever. Is Putin so desperate to save his own skin as to accept that? We might soon find out."
https://www.independent.co.uk/voices/china-xi-putin-peace-talks-b2304828.html