  In magic angle twisted bilayer graphene (MATBG), the moir\'e superlattice
potential gives rise to narrow electronic bands1 which support a multitude of
many-body quantum phases. Further richness arises in the presence of a
perpendicular magnetic field, where the interplay between moir\'e and magnetic
length scales leads to fractal Hofstadter subbands. In this strongly correlated
Hofstadter platform, multiple experiments have identified gapped topological
and correlated states, but little is known about the phase transitions between
them in the intervening compressible regimes. Here, using a scanning
single-electron transistor microscope to measure local electronic
compressibility, we simultaneously unveil novel sequences of broken-symmetry
Chern insulators (CIs) and resolve sharp phase transitions between competing
states with different topological quantum numbers and spin/valley flavor
occupations. Our measurements provide a complete experimental mapping of the
energy spectrum and thermodynamic phase diagram of interacting Hofstadter
subbands in MATBG. In addition, we observe full lifting of the degeneracy of
the zeroth Landau levels (zLLs) together with level crossings, indicating
moir\'e valley splitting. We propose a unified flavor polarization mechanism to
understand the intricate interplay of topology, interactions, and symmetry
breaking as a function of density and applied magnetic field in this system.
