fix(composer): clear the live markdown overlay after send (LC-399) #415
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lc-399-overlay-stale-after-send"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
After sending a message, the live markdown overlay (LC-399, #414) kept showing the just-sent text behind the now-empty composer. Only a page reload cleared it.
Cause
The overlay re-rendered the
.lc-mdbackbackdrop only on the textarea'sinputevent. A successful send clears the box withta.value = ''inside the form'shx-on::after-requesthandler, and assigning.valueprogrammatically does not fire aninputevent, so the backdrop never re-rendered and held the stale HTML. The optimistic-echo Retry-restore path setsta.valuethe same way and had the same gap.Fix
Re-render the overlay on the form's
htmx:afterRequesttoo.schedule()is rAF-coalesced, so the render runs on the next frame, after the inline clear (or restore) has executed - independent of listener registration order. The extra renders triggered by the draft PUT and the autocompletehtmx.ajaxcalls that also bubble to the form are harmless no-ops (they just re-read the current value).Scope
Template-only: JS inside
server/templates/room/composer.html. No Rust, CSS, or contract change.Tests
just check,just test, andjust test-saasall pass.