Were you going to try to fit Yosemite into your San Francisco time, or were you going to add another couple of nights there?
Yosemite is quite a drive from San Francisco. It can be done as a very long day trip, but you would only just scratch the surface of what it has to offer. Plus, if you only have 2 nights in San Francisco, this would be your entire day, and you wouldn't get to see any of the city! I would definitely spend at least one night, preferably two. If you can't do that, there are redwood areas closer to the city that you could visit in half a day, like Muir Woods (just on the other side of the Golden Gate), or places further down the coast.
As for San Francisco itself, we stayed 3 nights, and it really wasn't enough. Having said that, we 'wasted' a lot of time just walking around. It's a nice place to walk around though! We stayed in the Fisherman's Wharf area, and arrived in the evening, too late to really do anything that day. Our first day we walked up to Chinatown and went to the Cable Car Museum, then walked to the crooked street, then back to the Fisherman's Wharf for our Alcatraz night tour. The night tour was good in that there was only one boat load of people on the island, we got to see the city skyline light up as the sun set, and we got to see the hospital, which is off limits to day visitors. The second day we walked to and about halfway over the Golden Gate Bridge (long, long walk, but lovely). We then got lost in the Presidio area looking for the Walt Disney Family Museum, which was closed when we got there anyway as it was a Tuesday

It was actually a nice place to get lost, and we saw a heap of stuff I bet very few tourists see. Apart from views and general scenery, we saw some old military housing/buildings, what appeared to be police horse headquarters/stables, and a beautiful cemetery. After finding the museum was closed, we went to a nearby cafe for drinks and nibbles, and had a great time there chatting with the barman. We'd had enough of walking by then and caught a bus back to the hotel

The next day we left early in the morning.