After two years of relying on broad, hard-edged lockdowns to control Covid-19, Chinese leader Xi Jinping tried something new in Shanghai. Mindful of the economic toll and public anger from China’s zero-Covid strategy, Mr. Xi gave the city leeway to tackle local outbreaks, people close to the government’s decision-making said. The idea was to let Shanghai target only affected neighborhoods with lockdowns. If successful, the approach would offer a template for coexisting with the virus in the years ahead.