Mode-coupling theory (MCT) predicts the arrest of colloids in terms of their volume fraction, and the range and depth of the interparticle attraction. We discuss how the effective values of these parameters evolve under cluster aggregation. We argue that weak gelation in colloids can be idealized as a two-stage ergodicity breaking: first at short scales (approximated by the bare MCT) and then at larger scales (governed by MCT applied to clusters). The competition between the arrest and phase separation is considered in relation to recent experiments. We predict a long-lived "semiergodic" phase of mobile clusters, showing logarithmic relaxation close to the gel line.