Ratio of radii of two circles inscribed in a right isosceles triangle. There is a right isosceles triangle $\triangle ABC$ with the vertex $B$ facing the hypotenuse.
A circle is inscribed into the triangle with radius $r_1$, then another circle with radius $r_2$ is inscribed in the leftover space close to either $A$ or $C$ but not $B$

What is the ratio $\large{\frac{r_1}{r_2}}$ equal to?
My Attempt:

Let's call the circle with radius $r_1$, $C_1$ and the other circle with radius $r_2$, $C_2$


The smaller circle shall be closer to vertex $A$.


The Length from $A$ to $C_2$s tangents will be called $h_1$, and from these tangents to $C_1$s tangents will be called $h_2$. The length of the legs of the triangle will be called $x$.


If we draw a line from $C_1$ to $A$ we will see $r_1$ and $r_2$ are bases of similar triangles.



This means $\large{\frac{h_1}{r_2}=\frac{h_1+h_2}{r_1}}$


If we ignore $C_2$ we can see the triangle is made up of four smaller triangles and a square, since the sum of the area of these shapes will be equal to the area of the triangle: $$\large{2r_1(x-r_1)+r_1^2=\frac{x^2}{2}\\2xr_1-r_1^2=\frac{x^2}{2}\\-r_1^2+2xr_1-\frac{x^2}{2}=0}$$ From the quadratic equation:$$\large{\frac{-2x\mp\sqrt{4x^2-2x^2}}{-2}\\x\mp\frac{x}{\sqrt{2}}}$$ Since we know $r_1$ must be less than $x$
$$r_1=x-\frac{x}{\sqrt{2}}$$


$h_1+h_2$ is exactly half of the hypotenuse, this means $h_1+h_2=\frac{x}{\sqrt{2}}$


From this it follows that $$\large{\frac{h_1+h_2}{r_1}=\frac{\frac{x}{\sqrt{2}}}{x-\frac{x}{\sqrt{2}}}=\frac{1}{\sqrt{2}-1}}$$


Since $\large{\frac{h_1}{r_2}=\frac{h_1+h_2}{r_1}}$,  $\large{\frac{h_1}{r_2}=\frac{1}{\sqrt{2}-1}}$ and $\large{(\sqrt{2}-1)h_1=r_2}$


Because $h_1+h_2=\frac{r_1}{\sqrt{2}-1}$$$\large{h_2=\frac{r_1-r_2}{\sqrt{2}-1}}$$


If we extend a line like so...



We can see $\large{(h_2)^2+(r_1-r_2)^2=(r_1+r_2)^2}$



In $\triangle OPQ$, $ \displaystyle PQ = r_1 - r_2, OQ = r_1 + r_2, \angle POQ = \frac{\pi}{8}$
$\displaystyle \frac{r_1 - r_2}{r_1 + r_2} = \sin \frac{\pi}8$
$ \implies \displaystyle \frac{r_1}{r_2} = \frac{1 + \sin (\pi /8)}{1 - \sin (\pi /8)}$
