A San Francisco supervisor is pushing legislation that she hopes will encourage developers to build housing rather than office space in the city’s eastern neighborhoods. The proposal comes at a time when soaring commercial rents have made tech-oriented office the most lucrative real estate development sector.

Under the legislation that Supervisor Hillary Ronen will introduce this week, the development of new upper-floor office space would be banned in parts of the Mission District, Potrero Hill and Dogpatch.

“The crisis we have in the city and in the Mission is housing, especially affordable housing,” Ronen said. “We don’t have an office space crisis.”

The law would apply to areas in those neighborhoods zoned “mixed-use-urban,” which is meant to create a buffer between residential neighborhoods and industrial areas. Developers would still be allowed to create ground-floor office spaces.

The legislation was prompted in part by a proposed development at 2300 Harrison St. in the Mission, where the property owner wants to add 24 housing units and 27,000 square feet of office space to an existing office building. The six-story addition, built on a surface parking lot, would create a 95,000-square-foot office building with 24 apartments, six of which would be affordable. Without the new office space, the parking lot at 2300 Harrison would accommodate about 80 apartments.

The Planning Commission approved the project in December, but it has been appealed to the Board of Supervisors.

Critics of the Harrison Street project objected to the fact that the builder is seeking to take advantage of a state density bonus laws, which allows developers increased height in exchange for making some housing units affordable.

“We are seeing examples of projects exploiting state density bonus laws by building a tiny amount of housing in order to get more of what turns the biggest profit, which is office space,” Ronen said. “Our zoning should reflect what we need as a city, not what turns the highest profit.”

Carlos Bocanegra, an attorney with United to Save the Mission, appealed the 2300 Harrison project. He said gentrification pressures in the Mission largely come from the influx of high-income earners and that the Harrison Street project would add to the problem.

“This is an office project that treats housing as an afterthought,” he said. “You will have 700 upscale, high-income earners coming into the neighborhood and just 20 market-rate units to house them.”

Tuija Catalano, an attorney for the developer, said the project includes six affordable units, three of which would be affordable to people making $43,000 to $68,000 a year. The project would also pay $3.6 million in fees, some of which would go toward affordable housing.

Catalano said that the Planning Commission has approved other office projects that only contribute jobs-housing linkage fees and don’t build any housing.

Critics say that the reason developers prefer to build office space is that local officials have made it so difficult and expensive to build housing. Rather than putting up barriers to commercial development, the city should focus on making it easier, cheaper and faster to build housing throughout the city, said Laura Foote, executive director of YIMBY Action,

“Every week the Board of Supervisors pass laws making it harder and harder to build housing all over the city,” Foote said. “Deincentivizing office development is missing the point.”

J.K. Dineen is a San Francisco Chronicle staff writer. Email: jdineen@sfchronicle.com Twitter: @sfjkdineen