Controlling moving interfaces in solid-state batteries