From 8e8ce8ddd68669bc8ef09d07b908de675afe57b2 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 11 Jun 2026 17:13:15 +0900 Subject: [PATCH] Email reader: 'open in new tab' windows don't auto-dock left on Reply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replying from an email opened in a new tab was dragging that window to the left-sidebar dock — same treatment as the main email library, even though the user had explicitly opted to pop it into its own floating viewer. Annoying when the viewer is mid-screen and Reply yanks it. Add an early bail in _snapEmailModalToLeftSidebar for modals whose id starts with 'email-view-' (the 'open in new tab' reader). Compose still opens; the floating viewer just stays where it is, on top of the library. User can move/close it themselves. --- static/js/emailLibrary.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/js/emailLibrary.js b/static/js/emailLibrary.js index 6b5b522ff..9a6758d6b 100644 --- a/static/js/emailLibrary.js +++ b/static/js/emailLibrary.js @@ -1539,6 +1539,12 @@ function _makeDraggable(content, modal, fsClass) { function _snapEmailModalToLeftSidebar(modal) { if (!modal) return false; if (window.innerWidth < 900) return false; + // "Open in new tab" reader modals (id="email-view-…") are explicitly + // floating windows the user already positioned. Replying from one + // shouldn't yank it to the left edge — leave it on top in its current + // spot. Reply still opens the compose document; the user can drag the + // reader away or close it themselves. + if ((modal.id || '').startsWith('email-view-')) return false; const content = modal.querySelector('.modal-content'); if (!content) return false; // Only dock if currently fullscreen — for a manually-sized window the