From 7ed58510bcaea82086256048c0be15efef89231a Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Thu, 16 Jul 2026 00:59:01 +0000 Subject: [PATCH] fix(#6105): also close floating picker on breakpoint-crossing resize that reveals a drawer Codex found a sibling of the swipe-stacking edge: a direct landscape/tablet->phone resize can re-reveal an already-open mobile sidebar or workspace panel under the body-reparented picker (z-200 siblings, no click to trigger outside-close). The window resize handler now guardedly closes+restores the picker before re-syncing drawer state, gated on entering phone width AND a drawer/panel actually being open, so ordinary keyboard/URL-bar reflows don't dismiss the picker mid-use. --- static/boot.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/static/boot.js b/static/boot.js index b9265d48..7b32820b 100644 --- a/static/boot.js +++ b/static/boot.js @@ -2482,6 +2482,23 @@ function applyEmptyStateSuggestionPref(){ } window.addEventListener('resize',()=>{ + // #6105/#6080: the floating phone model picker is a child at z-index:200, + // the same level as the mobile sidebar drawer and the workspace panel. A direct + // landscape/tablet→phone resize can re-reveal an already-open drawer/panel + // *underneath* the picker (no click fires, so outside-click-close doesn't run). + // Close + restore the picker before we re-sync drawer state, but only when a + // phone-width layout will actually surface one of those z-200 siblings — so an + // ordinary keyboard/URL-bar reflow doesn't dismiss the picker mid-use. + try{ + if(typeof closeModelDropdown==='function' && !_isDesktopWidth()){ + const dd=document.getElementById('composerModelDropdown'); + if(dd&&dd.classList.contains('open')){ + const drawerOpen=!!document.querySelector('.sidebar.mobile-open'); + const panelOpen=(typeof _workspacePanelMode!=='undefined'&&_workspacePanelMode&&_workspacePanelMode!=='closed'); + if(drawerOpen||panelOpen) closeModelDropdown(); + } + } + }catch(_){} _syncWorkspacePanelInlineWidth(); syncWorkspacePanelState(); if(!window.visualViewport) _forceMobileViewportReflow();