Obviously OP lived there (by choice) but one of the reasons many business visitors get a bad impression of SF is that they're probably staying and attending an event in, shall we say, not the greatest part of town.
The history of Detroit suggests that that can change very quickly.
My experience is now 10 years old so factor that in. Even then the Lower Haight was still very bad, its just that it wasn't quite as bad as so many other areas. I lived there, trust me. If automatic gunfire, seeing women beaten on the sidewalk by guys jumping out of cars to steal their phones/purses, people pissing everywhere in clear view and vagrants yelling at you trying to start shit sound "normal" to you then you will love the place.
Hayes Valley turned to poo in the time I was there or so it appeared to my eyes. I've been chased by drug addicts who looked like they had leprosy in Columbus area (curiously they operated as a pack with one of them running distraction while the others tried to come up from behind - organized such that we had to literally run from the bunch of them). Even then I didn't like SOMA in general and doubly so for Market street. Walking around in the mornings seeing the cars that had been broken into on the daily. Stepping over people on the sidewalks on my way home at night. Kicking a vagrant out of my girlfriends parking garage (Bay Street - Marina area - the Nice Part).
Want to sit at some out door place with a coffee and be left alone? Forget about that. There were people coming into coffee shops and beating people out of their laptops even. At the time I was a 220 lb male who spent much time in the gym and it was obvious. That didn't stop multiple lunatics from trying to start trouble with me. The BART? Forget about the BART. One lunatic accosted my girlfriend right in front of me and his day ended poorly (this didn't happen just once either).
Want a nice walk through Golden Gate Park - HA!!! Surrounded by the roughest looking bunch of vagrants you've ever seen such that there's no way in hell I'm walking in there. Try walking out of the Safeway grocery market at 2020 Market St sometime with a decent haul of supplies (they're waiting for you).
I suppose if you wanted to live in Cow Hollow/The Marina area and literally never leave it you might have a minimally invasive experience. Not "nothing" mind you, just less than other areas nearby.
A friend invited me to join her on a trip to The City in August and I gave it a hard pass.
I'm sure someone here will pipe up and say Im hyperbolizing here but this was my experience - no - this was a fraction of my experience. 10 years ago it was every bit as bad as this and I have every reason to believe it kept on getting worse after I threw in the towel. Im shocked the pain tolerance of the city has been so high that its just getting attention in the past few years.
"The city's actually really safe if you completely ignore this whole area that sits in the middle of it otherwise all bets are off" isn't exactly an endorsement.
1. shoplifting at that Safeway you mentioned.
2. There are still occasional grab & runs (ie. of laptops from cafes), this is one block from me and they pull a gun in a crowded cafe [0]
Obviously more still needs to be done but I don't find this impacts my day to day that much.
[0]: https://sfstandard.com/wp-content/uploads/2023/02/SFS_Robber...