Nancy Pelosi’s decision marks the end of an era for Democrats, and triggers a search for a new generation of leadership for her caucus.