- Add useEffect cleanup to abort in-flight fetch when ChatView unmounts
(e.g., session switch via key={id} remount). This triggers the existing
server-side cleanup chain: saves partial message to DB, auto-denies
pending permissions. Also resets streamingSessionId and
pendingApprovalSessionId global state to prevent stale UI.
- Add beforeunload handler during streaming to show browser confirmation
dialog when user attempts to close the window/tab, preventing accidental
data loss. Listener is automatically removed when streaming ends.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>