The images of Joe Biden and fellow G7 leaders chatting at close quarters on a Cornish beach as they enjoyed barbecued lobster may not have been the best advert for social-distancing rules in times of pandemic. But the beach cookout was designed to send another message: under renewed American leadership, the world’s leading western democracies are back in business.

After four years of Donald Trump’s presidency, when diplomatic shouting matches were more likely features at G7 summits than cosy alfresco dining, there was a collective sigh of relief. “This is the first time in four years they’ve actually got along,” said one British official.

The warmth towards Biden was reflected in the bonhomie between the US president and France’s Emmanuel Macron, walking along the white sand of Carbis Bay, arms draped around each other. “The US is back,” Biden said. Macron shot back: “Yeah definitely.”

UK prime minister Boris Johnson, revelling in the role of host after Brexit, called the three-day meeting “historic”. After the disruption of the Trump years, there was genuine agreement on global issues among the leaders of what Johnson called the Democracy XI: the US, the UK, Canada, France, Germany, Italy, Japan and guests from Australia, South Korea and South Africa. India’s Narendra Modi attended virtually.

In what appeared to mark an apparent shift to social democracy from the world’s leading capitalist economies, the G7 backed Biden’s call to “meet the moment and support the economy” with more spending; Johnson spoke of the need to fight inequality.

But while there was agreement on extra funding for vaccines for the developing world, a plan to fight future pandemics, funding for girls’ education and agreement on the need to fund “clean, green” projects in the developing world, there were divergences of views.

Biden said he saw the summit as the moment the west toughened its stance towards China, developing a “democratic” alternative to China’s Belt and Road Initiative, which Washington believes is spreading Beijing’s influence — including unsustainable debt and poor labour standards — across the world.

“I think you are going to see just straightforward dealing with China,” Biden told journalists after the summit.

But while White House officials said the first G7 session on Saturday was focused on China, Britain sought to avoid framing it in those terms, saying it was about “building back better” after the pandemic.

Johnson declined to mention China in his closing press conference, and one EU diplomat said that Johnson, Canada’s Justin Trudeau and Italy’s Mario Draghi argued that the G7’s emphasis should be on making a positive case for the west rather than deliberately antagonising China.

EU countries were keen to emphasise what they say is a more nuanced view towards relations with Beijing. “Our approach is we need to co-operate with China on issues like climate change, compete in areas like global supply chains and contest China’s record in areas like human rights,” said one European diplomat.

Johnson’s recent UK foreign policy review reflects a wider European effort to ride two horses at once: it talks of seeking “deeper trade links and more Chinese investment in the UK”, while challenging China in other areas.

Biden declared himself “satisfied” with the summit communiqué — agreed by officials at 1.30am on Sunday morning and mentioning China three times, including on human rights abuse in Xinjiang. But US officials have insisted the west needs to go further in countering Xi Jinping’s Belt and Road Initiative with a package to finance global infrastructure, not just green schemes.

Even on what British officials called the “greenbelt and road” plan, there was little new money. Downing Street said it was more about “aligning” promises Britain and other western countries had already made to fund environmental projects in poor countries.

For Johnson, who sought to use the summit as the moment Britain broke free of five years of introspection over Brexit and faced the world as a key convening power, the Carbis Bay summit was only a partial success.

As with other big summer national events — like the 2012 Olympics or a royal wedding — the UK showed its mastery of televisual spectacles and creating “feel-good” events.

Against the backdrop of blue skies and white sand beaches, leaders met Queen Elizabeth at a futuristic environmental park, while their partners and spouses were taken to a Cornish clifftop theatre. The RAF’s Red Arrows pirouetted above the beach barbecue. Compared with recent G7 summits, the event was bathed in goodwill.

But Brexit continued to dog Johnson’s attempt to project the image of a confident “convening” country bringing the world back together. The prime minister was instead drawn back into rhetorical battles with the UK’s closest trading partners in Europe.

Biden had urged Johnson before the summit to cool the language over Northern Ireland. But the UK prime minister ramped it up — triggering the ire of the French delegation.

His foreign secretary Dominic Raab accused EU leaders of acting as though Northern Ireland was “somehow a different country from the UK”. David Frost, Britain’s EU minister, turned up at meetings wearing union jack socks, while British officials pointed out that HMS Tamar, a Royal Navy vessel patrolling the waters off Carbis Bay, was the ship recently dispatched to the Channel Islands in a fishing dispute with France.

Johnson insisted at the closing press conference that Brexit was only a “vanishingly small” part of the G7 discussions. The first face-to-face meeting of western leaders for almost two years was rather an occasion of “fantastic harmony”.

This was certainly no repeat of the 2018 G7, when Trump disowned the summit communiqué and called the host, Canada’s Justin Trudeau, “weak and dishonest”. But the leaders flying out of Carbis Bay on Sunday left behind plenty of unfinished business.