No prime minister has lost a seat as swiftly as Boris Johnson in over a century. In 2017, the Tories won nearly half the vote in Brecon and Radnorshire and secured an 8,000 majority over the Liberal Democrats. To lose just two years later is very bad indeed. Labour slumped badly, leaving the party with a derisory vote share, but this is a seat the party hasn’t won since 1974, and in which it came third even in the 1997 landslide.

In any case, whether Labour is polling well or badly nationally, it often performs poorly in byelections which are straight fights between the Lib Dems and Tories. In 2000 – when Tony Blair was enjoying a seemingly never-ending honeymoon – Labour’s vote plummeted by 15 points in the Romsey byelection because of tactical voting which enabled the Lib Dems to wrest the seat from the Tories. It feels a bit unseemly to watch Lib Dems – who appealed for the votes of Labour supporters to stop the Tories – now crowing about Labour’s collapsed support.

For those who desire a Labour-led government, the result again reopens the debate about the best strategy to deal with the Lib Dems. Jo Swinson’s party is currently in a triumphant mood, having risen from the coalition ashes, but its bounce is sustained almost entirely by anger at Brexit. Lib Dem veterans should remember “Cleggmania”: in the 2010 election campaign, when pundits seriously discussed the party displacing Labour as the country’s main “progressive” force, and when one Times headline went so far as to announce that “Nick Clegg is nearly as popular as Winston Churchill”. The party went on to lose five seats.

A desire by Labour supporters to attack the Lib Dems is understandable, of course. The party spent five years propping up a Tory government: slash-and-burn austerity, attacks on disabled people, the bedroom tax, privatisation, tax handouts to big business and the rich, the trebling of tuition fees. But while it may be cathartic, it is mostly a waste of energy and precious resources. There are only two Labour-Lib Dem marginals in the country – Leeds North West and Sheffield Hallam, where a byelection will soon be held. The Lib Dems are overwhelmingly competing with the Tories for seats, largely those lost to a David Cameron-led party in 2015. In a general election campaign, the Lib Dems’ main focus will be attracting Tory remainers alienated by the party’s hard right no-deal leadership: and that means, on economic issues, Swinson will have to maintain the pivot to the right.

The principal danger facing Labour, of course, is in Tory-Labour marginals where voters defecting to the Lib Dems could hand the country to Johnson’s rightwing cabal, which will promptly fling us off a no-deal cliff. Sure, there is some role for highlighting the Lib Dems’ record in these circumstances, but most people remember it and are pricing it in already. The British public is now well used to voting tactically in general elections. Instead, Labour’s focus should be on who offers the most compelling alternative to Johnson’s government. While Labour’s attempt to broker a Brexit compromise has failed – and the party needs to pivot to an unequivocally remain position – it will also be able to offer a more inspiring vision than the Lib Dems. Labour will be able to ask: which party is offering a second referendum, as well as hiking taxes on the rich and big business to end austerity, scrapping tuition fees and bringing utilities under public ownership? It’s not the Liberal Democrats.

Labour has much to do; it needs to become far more visible and put itself in front of the public. It should spend the summer recess acting as though a general election is on, announce new popular policies, and pick fights with vested interests – not the Lib Dems. Attacks on Swinson’s party might feel good, but the focus has to be on Labour’s transformative programme of government. Ultimately, the Lib Dems winning Tory seats can only help Labour reach government – why waste energy on stopping them?

Owen Jones is a Guardian columnist