diff --git a/server/public/home.html b/server/public/home.html index 86e206a..8fd12a6 100644 --- a/server/public/home.html +++ b/server/public/home.html @@ -3423,8 +3423,10 @@ function setDraft(kind,id,val){ try{ if(val&&val.trim()) localStorage.setItem(dr // #14: GUARANTEED save of the currently-open chat's draft — called the instant we leave it (switching chats // OR going back to the list). The per-keystroke 'input' save can be missed on mobile (predictive text / a // fast tap-away fires no final input event), which lost the whole draft on switch-and-return. Snapshotting -// the composer value at leave-time makes it reliable regardless. Skipped while editing (that's not a draft). -function persistCurrentDraft(){ try{ if(selected && !editTarget){ const inp=document.getElementById('msgInput'); if(inp) setDraft(selected.kind, selected.id, inp.value); } }catch(_){} } +// the composer value at leave-time makes it reliable regardless. This ALSO covers leaving mid-EDIT: the edit +// is abandoned (openConvo clears editTarget), and whatever's in the composer is kept as that chat's draft so +// your typing isn't lost — it just returns as a normal draft (sending it posts a new message, not an edit). +function persistCurrentDraft(){ try{ if(selected){ const inp=document.getElementById('msgInput'); if(inp) setDraft(selected.kind, selected.id, inp.value); } }catch(_){} } // Compositor-only open slide (workflow-verified). armOpenSlide() runs AFTER openConvo's synchronous // render: it pins the pane off-screen (chat-opening), lets a frame paint it, then adds .chat-anim on a // double-rAF so the compositor runs the 300ms transform with the main thread idle. All scrollTop/innerHTML