In preparation for some voice refactoring that I'm doing, this PR cleans up the message partial. Notable changes:
The key change is that the message-scroller stimulus controller that exists per message (within _message partial) needs to be reconnected each time the partial updates with a streaming response. However, in the next PR I'm going to land, there is a new playback stimulus controller which should NOT reconnect each time the partial updates. The _message partial already has an outer most div and an inner div. Currently, both are replaced each time we do broadcast_turbo_replace so I change this to be broadcast_turbo_update in the worker. Replace does the whole div whereas update does the innerHTML of the div. I then move the existing message-scroller to the inner div.
Move some _message logic into message_helper
Version bump stimulus rails
Rename a method in composer_controller for clarity
This PR is part of the set: #464, #469, ...
In preparation for some voice refactoring that I'm doing, this PR cleans up the message partial. Notable changes:
broadcast_turbo_replace
so I change this to bebroadcast_turbo_update
in the worker. Replace does the whole div whereas update does the innerHTML of the div. I then move the existing message-scroller to the inner div.