  Let $p$ be a fixed odd prime, and let $K$ be a finite extension of
$\mathbb{Q}_p$ with ring of integers $\mathcal{O}_K$. The Emerton-Gee stack for
$\mathrm{GL}_2$ is a stack of $(\varphi, \Gamma)$-modules. The stack, denoted
$\mathcal{X}_2$, can be interpreted as a moduli stack of representations of the
absolute Galois group of $K$ with $p$-adic coefficients. The reduced part of
the Emerton-Gee stack, denoted $\mathcal{X}_{2, \text{red}}$, is an algebraic
stack defined over a finite field of characteristic $p$ and can be viewed as a
moduli stack of Galois representations with mod $p$ coefficients. The
irreducible components of $\mathcal{X}_{2, \text{red}}$ are labelled in a
natural way by Serre weights, which are the irreducible mod $p$ representations
of $\mathrm{GL}_2(\mathcal{O}_K)$. Each irreducible component of
$\mathcal{X}_{2, \text{red}}$ has dimension $[K:\mathbb{Q}_p]$.
  Motivated by the conjectural categorical $p$-adic Langlands programme, we
find representation-theoretic criteria for codimension one intersections of the
irreducible components of $\mathcal{X}_{2, \text{red}}$. The methods involve
two separate computations and a final comparison between the two. The first of
these computations determines extension groups of Serre weights and the second
determines all the pairs of irreducible components that intersect in
codimension one. We show that a non-trivial extension of a pair of
non-isomorphic Serre weights implies a codimension one intersection of the
corresponding irreducible components. The converse of this statement is also
true when the Serre weights are chosen to be sufficiently generic. Furthermore,
we show that the number of top-dimensional components in a codimension one
intersection is related to the nature of the extension group of corresponding
Serre weights.
