A block of mass $m$ is placed against an ideal spring as shown. Initially the spring (of force constant $k$) is compressed by a distance $s$. The block is then released and slides a distance d up the $53.1^\circ$ incline to point $P$. At $P$ the spring is relaxed and is no longer in contact with the block. There is friction between the block and the incline with coefficient $\mu_k.$
I am planning on teaching a course on Physics next year so I was going over a question from my final in undergrad. It appears as though I got full marks on this question, but in attempting the question again it seems that I completely missed something: the potential energy of the spring. If I were to re-do this question here is what I would do... $$K_{0}+(U_{s0}+U_{g0})+W=K_f+(U_{sf}+U_{gf})$$ $$\implies 0+(\frac{1}{2}ks^2+0)-\frac{3}{5}\mu_k mgd=\frac{1}{2}mv^2 +(0+\frac{4}{5}mgd)$$ $$\implies v=\sqrt{\frac{k}{m}s^2 -\frac{gd}{5} \left(6\mu_k+8\right)}$$ Admittedly, my solution from 5 years ago (i.e. $v=\sqrt{\frac{dg(5-3\mu_k)}{5}}$) looks much better which makes me suspicious that I have just lost all of my physics knowledge.
My question is this:
Is my current self correct or is my former self correct?
This type of question tends to get deemed as "illegal homework help" but I am genuinely wondering if both the potential energy done by the spring and the potential energy done by gravity must be involved here. If I was correct 5 years ago, then what allowed me to simply ignore the potential energy done by the spring?
EDIT AS PER REQUESTED: My question really boils down to the following:
If there are two types of potential energy, in this case elastic and gravitational, do we replace the $U$ in the conservation formula $$K_0+U_0+W=K_f+U_f$$ with $$U_0=U_{s0}+U_{g0} \text{?}$$