Fix edgecase with modal animation and tweak ui for mjtrim