San Francisco is an up and coming metropolis—if you’re an angel investor or Silicon Valley mogul, that is. But for many long-time denizens, it’s all downhill: low wages make it a struggle to get by even with full-time work, and the rent is astronomical. Yet in this wildly polarized city, a coalition of labor and community activists has managed to push through landmark legislation to protect low-wage workers, including a paid sick days ordinance, a newly minted $15 minimum wage and, most recently, a landmark Retail Workers Bill of Rights (RWBoR), adding momentum to a nationwide push to strengthen workplace rights in retail.

The RWBoR, passed last week by the Board of Supervisors and now set to be fully adopted, lays out a basic code of rights for people working in supermarket, retail boutiques and other chain stores, covering all retailers in San Francisco with at least twenty branches nationwide, and which also employ twenty or more. Under the two pieces of legislation that constitute the Bill of Rights, employers must establish a baseline schedule of shifts and workdays before the worker starts the job. Workers are entitled to a biweekly schedule with two-weeks advance notice of any changes. Bosses will be penalized for making any changes to the schedule within a week of the scheduled shift. If workers take the shift, they receive “one hour of pay for each shift change made with less than seven days’ notice,” and two to four hours’ pay if the change comes a day in advance.

The penalties act as a check to ensure that employers actually adhere to the schedules that they post.

“It’s fine and great to get your schedule fourteen days in advance,” says Tsedeye Gebreselassie, staff attorney with the National Employment Law Project. “But if your employer can then change it up until the date of your shift and have no consequence for doing so, then it’s almost meaningless.” So when employers want to, say, add extra work by staying open after normal hours or filling extra orders, instead of forcing shift changes onto employees, they’ll now bear an extra cost for inconveniencing a worker.

The RWBoR adds protections for on-call workers, whose schedules are contingent by definition, entitling them to two to four hours pay if they’re “required to be ‘on-call’ for a specified shift but the employer cancels the shift” with less than a day’s notice.

Other provisions aim to protect part-time workers: mandating that employer can only hire new part-time workers after first offering more hours to existing part-timers. And part-timers will be entitled to equal access to certain full-timer benefits, like paid time off.

Such measures stirred grumbling from the business community about excessive regulation. But the final legislation included these measures as a crucial deterrent for bosses against exploiting part-timers as “disposable” labor without investing in workers’ long-term livelihoods.

The RWBoR won’t radically restructure the retail industry, but it will discourage bosses from externalizing the cost of unpredictability. San Francisco’s ties to the global economy, with fast sales and unpredictable hours, might work well for elite professionals who thrive on “flexibility,” but for retail workers, “flexibility” is an economic shackle, as jobs based on fast sales and erratic hours undermine family stability and intensify economic insecurity.

At a November legislative hearing, San Francisco retail workers told of wavering between irregular hours and stagnant pay. Grocery store worker Sandra Herrera testified about having to go without even seeing her five-year-old son in person “for a day or two, because he goes to school all day and I have to go to work in the afternoon,” and yet the paltry pay from her part-time hours left her scrimping for dinner—falling short on both time and money for her family.

Michelle Flores, another grocery part-timer and local college student, described in a testimonial a labor structure designed for chronic insufficiency:

Not having additional hours to work means I have to choose between milk or eggs, doing laundry or paying for a muni bus ride…. The managers at my store would rather hire more people and distribute less hours per person than allocate more hours to employees because it decreases the likelihood of overtime.

Letting workers reclaim control of work-time, by contrast, could promote a virtuous cycle by turning so-called dead-end jobs into steady livelihoods. Research by Susan Lambert at the University of Chicago on precarious schedules in various industries shows that although unpredictable scheduling practices are widespread, policies that give workers broader control over their labor conditions can go a long way toward enabling them to cope with caregiving needs and financial strain, along with reducing turnover and stabilizing the workforce in general.

For years, cities like San Francisco have trended the other way, as decent “middle-class” jobs evaporated amid massive gentrification and the rise of the precarious “gig” economy. As retail worker-activist Mark Ortiz wrote recently in the Huffington Post, “The work practices of companies have slowly forced workers to change their family practices and this means less time to invest in their children and families,” but policies like the RWBOR helps preserve the social fabric of the neighborhoods that have long supported working-class communities of color and immigrant enclaves. Similar federal legislation to protect retail workers’ rights, known as the Schedules that Work Act, has also been proposed, as John Nichols pointed out, together with paid leave legislation and higher minimum wages. And of course, retail workplaces that have unionized have helped lead the way with contracts that incorporate strong fair-scheduling policies.

In an announcement of the Board of Supervisors’ approval of the legislation, Flores looked forward to finally being able to allocate her time in a way that made sense with her life: “Now that this bill is going to pass, it will change my quality of life…. Having a more regular schedule will allow me to not only work for a living but also pursue my academic goals.”

San Francisco is abuzz with real-estate speculators and venture capital, but at the end of the day, real people make the city’s gears turn. Giving struggling retail workers some room to breathe in their schedules could start to breathe new life into a city in danger of losing its soul.