fix(ui): keep minimized windows above composer (#1197)

This commit is contained in:
red person
2026-06-02 17:31:09 +03:00
committed by GitHub
parent 0db441b191
commit 69ab350919
3 changed files with 53 additions and 2 deletions

View File

@@ -165,6 +165,39 @@ window.addEventListener('pageshow', clearFreshComposerRestore);
window.addEventListener('resize', _sync);
}
/* Keep minimized tool chips above the composer. Both the current modalManager
dock and the legacy fallback dock consume this root-level clearance. */
{
const root = document.documentElement;
const chatBar = document.querySelector('.chat-input-bar');
const attachStrip = document.getElementById('attach-strip');
const chatContainer = document.getElementById('chat-container');
const _syncComposerClearance = () => {
let top = window.innerHeight;
for (const el of [attachStrip, chatBar]) {
if (!el) continue;
const rect = el.getBoundingClientRect();
if (rect.height > 0) top = Math.min(top, rect.top);
}
const clearance = Math.max(12, Math.ceil(window.innerHeight - top + 8));
root.style.setProperty('--composer-clearance', clearance + 'px');
};
requestAnimationFrame(_syncComposerClearance);
if (typeof ResizeObserver !== 'undefined') {
const ro = new ResizeObserver(_syncComposerClearance);
if (chatBar) ro.observe(chatBar);
if (attachStrip) ro.observe(attachStrip);
}
if (chatContainer && typeof MutationObserver !== 'undefined') {
new MutationObserver(_syncComposerClearance).observe(chatContainer, {
attributes: true,
attributeFilter: ['class'],
});
}
if (chatBar) chatBar.addEventListener('transitionend', _syncComposerClearance);
window.addEventListener('resize', _syncComposerClearance);
}
/* ---- Resizable sidebar — drag edge to resize, collapse if small, drag rail edge to expand ---- */
{
const sidebar = document.getElementById('sidebar');

View File

@@ -838,7 +838,7 @@ body.bg-pattern-sparkles {
#tile-ghost.visible { opacity: 1; transform: scale(1); }
/* Bottom dock — chip per minimized modal */
#minimized-dock {
position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
position: fixed; bottom: var(--composer-clearance, 12px); left: 50%; transform: translateX(-50%);
display: flex; gap: 6px; flex-wrap: wrap;
max-width: calc(100vw - 24px);
padding: 4px;
@@ -4901,7 +4901,7 @@ body.bg-pattern-sparkles {
/* Bottom dock for minimized modals */
#modal-dock {
position:fixed;
bottom:0;
bottom:var(--composer-clearance, 0px);
left:0;
right:0;
display:flex;