agent: Improve generating dots display (#32421)

Previously, upon hitting the "Continue" button to restart an interrupted
thread due to consecutive tool calls reaching its limit, you wouldn't
see the loading dots and the UI would be a weird state. This PR improves
when these loading dots actually show up, including in their conditional
a check for `message.is_hidden`.

Also took advantage of the opportunity to quickly organize some of these
variables. The `render_message` function could potentially be chopped up
in more smaller pieces. Lots of things going on here.

Release Notes:

- N/A
3db00384f4Danilo Leal committed on 6/9/2025, 11:52:50 PM· committed by GitHubparent3dfbd9e
1 file changedLine totals unavailable