The Mission District alone is almost 2 square miles. Add in a couple more decent neighborhoods (particularly the Sunset and the Richmond), and you're probably at half of SF's 49 square miles.
At some point, nice is subjective. And Mission definitely has some sketch spots. But Castro, Eureka, Noe border it and are even nicer; then there's Hayes and the Haight and Alamo Square; head west on Haight and you get to Cole Valley and the Inner Sunset; north of Haight you'd hit a few patchy blocks on Fillmore but then come to Japantown, Pac Heights, the Marina. And that list is not even close to exhaustive: the point is that there are large contiguous areas that are nice, walkable, and safe.
The Norteńo and Sureńo gangs had running machine gun battles in the Outer and South Mission just a decade ago, until the Feds took them down using the gang enhancements so decried by progressives like Chesa Boudin.