A law designed to promote dense housing at prices affordable for middle-class families won unanimous approval from the Board of Supervisors Tuesday. It was a hard-fought win for advocates who pushed the legislation for two years.

The “Home-SF” law will allow developers to build taller structures in exchange for making 30 percent of the units affordable. Supervisor Katy Tang first proposed the idea in 2015, but her initial version foundered under opposition from progressives, who said it pandered to developers, and west-side homeowners who feared an onslaught of new real estate in their neighborhoods.

Supervisor Norman Yee, who represents such west-side neighborhoods as Forest Hill and West Portal, rejected the ordinance when it first came up for a vote last week. He changed his vote Tuesday, saying he’d reacted emotionally after the board turned down his request to exempt the Ocean Avenue corridor in his district.

“I’m changing my vote to positive,” Yee said at the board meeting.

Tang projects the law will produce about 5,000 affordable units over the next 20 years, which she says is triple the amount expected from the city’s current requirement of 25 percent affordable housing.

Mayor Ed Lee praised the new law for protecting “teachers, first responders, nurses,” and others who are struggling to stay in the city.

— Rachel Swan

San Francisco has a new technology chief to oversee the clunky computer system that glues the city’s government together.

Linda Gerull, who previously served as the IT director for Pierce County, Wash., will oversee the 228-person Department of Technology. She will head efforts to install and maintain 240 miles of underground fiber-optic cable connecting city buildings also while managing the city’s data centers, cybersecurity and government TV station, along with other essential services.

Mayor Ed Lee praised her “proven track record of delivering technology solutions which improve government services.”

She’ll start the new job on July 17.

— Rachel Swan

Rachel Swan is a San Francisco Chronicle staff writer. Email: rswan@sfchronicle.com Twitter: @rachelswan