Since winning the UK’s general election in July, Labour has faced sharp swings in the economic outlook and a shifting public mood.