From 57acd46d96ad92d51571c447cdc3b2d49ddda073 Mon Sep 17 00:00:00 2001 From: Ichhabal Singh Date: Wed, 15 Jul 2026 12:22:13 +0530 Subject: [PATCH 1/2] fix(compare): lift z-index of model-picker-wrap when picker is open to prevent rendering under compare/tool overlays --- static/js/modelPicker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/js/modelPicker.js b/static/js/modelPicker.js index a7b1ac64ce..ac63ae1554 100644 --- a/static/js/modelPicker.js +++ b/static/js/modelPicker.js @@ -5,6 +5,7 @@ import { providerLogo } from './providers.js'; import uiModule from './ui.js'; import settingsModule from './settings.js'; import { sortModelObjects } from './modelSort.js'; +import { topPortalZ } from './toolWindowZOrder.js'; const API_BASE = window.location.origin; @@ -193,6 +194,7 @@ function _initModelPickerDropdown() { menu.classList.remove('closing'); menu.classList.add('hidden'); search.value = ''; + wrap.style.removeProperty('z-index'); }, { once: true }); // Fallback if animationend doesn't fire setTimeout(() => { @@ -200,6 +202,7 @@ function _initModelPickerDropdown() { menu.classList.remove('closing'); menu.classList.add('hidden'); search.value = ''; + wrap.style.removeProperty('z-index'); } }, 200); } @@ -655,6 +658,7 @@ function _initModelPickerDropdown() { if (menu.classList.contains('hidden') || menu.classList.contains('closing')) { // Force-clear any in-progress close animation menu.classList.remove('closing', 'hidden'); + wrap.style.setProperty('z-index', String(topPortalZ()), 'important'); _populate(''); if (window.modelsModule && window.modelsModule.refreshModels) { window.modelsModule.refreshModels().then(() => { From bf406b4296b585e52f774249463e5f78b358e3f9 Mon Sep 17 00:00:00 2001 From: Ichhabal Singh Date: Wed, 15 Jul 2026 15:35:07 +0530 Subject: [PATCH 2/2] fix(compare): lift z-index of chat-input-bar to escape container query stacking context --- static/js/modelPicker.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/static/js/modelPicker.js b/static/js/modelPicker.js index ac63ae1554..e286f0bdee 100644 --- a/static/js/modelPicker.js +++ b/static/js/modelPicker.js @@ -183,6 +183,24 @@ function _initModelPickerDropdown() { const refreshBtn = document.getElementById('model-picker-refresh-btn'); if (!wrap || !btn || !menu || !search || !listEl) return; + function _liftInputBar() { + wrap.style.setProperty('z-index', String(topPortalZ()), 'important'); + const bar = document.querySelector('.chat-input-bar'); + if (bar) { + bar.style.setProperty('position', 'relative', 'important'); + bar.style.setProperty('z-index', String(topPortalZ()), 'important'); + } + } + + function _restoreInputBar() { + wrap.style.removeProperty('z-index'); + const bar = document.querySelector('.chat-input-bar'); + if (bar) { + bar.style.removeProperty('position'); + bar.style.removeProperty('z-index'); + } + } + function _close() { if (menu.classList.contains('hidden')) return; // Restore scroll button @@ -194,7 +212,7 @@ function _initModelPickerDropdown() { menu.classList.remove('closing'); menu.classList.add('hidden'); search.value = ''; - wrap.style.removeProperty('z-index'); + _restoreInputBar(); }, { once: true }); // Fallback if animationend doesn't fire setTimeout(() => { @@ -202,7 +220,7 @@ function _initModelPickerDropdown() { menu.classList.remove('closing'); menu.classList.add('hidden'); search.value = ''; - wrap.style.removeProperty('z-index'); + _restoreInputBar(); } }, 200); } @@ -658,7 +676,7 @@ function _initModelPickerDropdown() { if (menu.classList.contains('hidden') || menu.classList.contains('closing')) { // Force-clear any in-progress close animation menu.classList.remove('closing', 'hidden'); - wrap.style.setProperty('z-index', String(topPortalZ()), 'important'); + _liftInputBar(); _populate(''); if (window.modelsModule && window.modelsModule.refreshModels) { window.modelsModule.refreshModels().then(() => {