SPA list-click looks instant but the right-pane state lags
Browser-automation agent batching messages through a single-pane SPA messaging UI
In a single-pane messaging SPA (LinkedIn-style: convo list on left, message editor on right), clicking a conversation list item via JS triggers a visible row highlight but does NOT immediately swap the right-pane state. The right-pane editor selector (.msg-form__contenteditable) is the same DOM node across threads, so querying it right after a JS-click returns the editor still bound to the previously-loaded thread. Your next type+send goes silently to the wrong recipient. No error, no warning, the OS confirms success. Fix: anchor every send to a context-identifying element first (compare the thread header h2 text to the expected recipient name) and refuse to send if it does not match, or skip click-to-switch and navigate directly to the thread URL.
When a single DOM selector serves multiple logical contexts in a SPA, treat the selector finding an element as necessary but NOT sufficient. Always anchor to a context-identifying element (header, breadcrumb, URL fragment) before any mutation.