Size the Scheduler panel from the height the dock reports, not one read mid-animation

.vv-ai-chat transitions its height, so measuring the dock straight after setting
it returns the height it is animating away from — the view was cut short for a
dock that had already shrunk, leaving the difference as dead panel underneath.
This commit is contained in:
Gmer4Lfe
2026-08-14 09:55:41 -04:00
parent b358dfcf58
commit c6b56d580e
2 changed files with 36 additions and 7 deletions
+21 -2
View File
@@ -1856,12 +1856,23 @@ vv_ai_profiles_script();
return b.offsetHeight + m;
}
// Returns the height it just applied, in pixels, or null when that is not a number this side
// can know — a placement sized in vh resolves only against the viewport, and one that has not
// been given heights yet has nothing to report.
//
// It reports rather than letting the caller measure because .vv-ai-chat transitions its height
// (see the rule in the stylesheet). offsetHeight read straight after this returns the height
// the box is animating FROM, not the one just asked for, and a page that sizes a sibling from
// that figure sizes it for a dock that no longer exists by the time anyone looks. On the
// Scheduler that left the panel's bottom third dead: the view was cut short for a tall dock,
// the dock then shrank to its collapsed share, and nothing re-measured — so the gap survived
// until an expand/collapse fired onResize and ran the fit again against a settled box.
function applyHeights() {
const el = chatEl();
const base = el.dataset.h || '';
const med = el.dataset.hTall || '';
const big2 = el.dataset.hLarge || med;
if (!base || !med) return;
if (!base || !med) return null;
const want = big ? (large ? big2 : med) : base;
// Subtracted, not added to. The height the page asked for is the height the whole window
// keeps; the list is taken out of the conversation's share of it. calc() because that height
@@ -1891,6 +1902,12 @@ vv_ai_profiles_script();
: 'Expanded is medium — click for large';
sizeBtn.classList.toggle('vv-ai-grow-on', large);
}
// Only a plain pixel figure can be resolved here; anything else is left to the caller to
// measure, which is correct for the placements whose height is not a transitioning number.
const n = parseFloat(want);
if (!Number.isFinite(n) || !/^\s*[\d.]+px\s*$/.test(want)) return null;
return k ? Math.max(56, n - k) : n;
}
// Named functions, because the buttons are no longer the only way in — the shortcuts below
// drive the same two.
@@ -2071,11 +2088,13 @@ vv_ai_profiles_script();
// Heights supplied after the fact, for a placement whose room is a share of a panel rather
// than a constant. Re-applies immediately at whichever of the two states is current, so a
// resize while expanded stays expanded instead of snapping back.
// Hands back the pixel height it settled on, so a caller sizing a sibling from it does not
// have to measure a box that is mid-transition. See applyHeights().
setHeights(base, tallMed, tallLarge) {
const el = chatEl();
el.dataset.h = base; el.dataset.hTall = tallMed;
if (tallLarge) el.dataset.hLarge = tallLarge;
applyHeights();
return applyHeights();
},
// Same contract, different subject — the Scheduler pointing the chat at another script, log