Commercial and residential buildings have different building codes. It would take years/decades to get approval and actually retrofit buildings. Cities like San Francisco chose to suppress residential housing and focused on commercial buildings because it was cheaper and required less infrastructure and made the city more money through payroll taxes. I'm glad they are being punished for their poor long term planning. Hopefully other cities learn from their mistakes and start to allow mixed use zoning, etc.