Let the Scheduler's views shrink so the assistant can grow into them
Flex items default to min-height:auto, so a view holding a log ignored the height it was given and pushed the composer out of a panel that clips instead of scrolling.
This commit is contained in:
@@ -145,6 +145,12 @@ body.vv-fullscreen #displaybox { padding-left: 1rem !important; padding-top: .5r
|
||||
#vv-sched-left { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-self: flex-start; }
|
||||
#vv-sched-cards { flex: 1; }
|
||||
#vv-sched-right { display: none; flex: 1 1 0; min-width: 0; flex-direction: column; overflow: hidden; align-self: flex-start; }
|
||||
/* Flex items default to min-height:auto, which resolves to their content size — so a view with a
|
||||
long log in it refuses to shrink. The assistant below it is flex-shrink:0 and this panel is a
|
||||
fixed height with overflow:hidden, so whatever will not fit is not scrolled, it is clipped off
|
||||
the bottom: the assistant's own composer, which is the last thing in the panel. vvFitRight()
|
||||
sizes these explicitly and this is what lets that size actually take effect. */
|
||||
#vv-sched-right > * { min-height: 0; }
|
||||
#vv-sched-right.vv-panel-visible { display: flex; }
|
||||
.vv-log-card { flex: 1; display: flex; flex-direction: column; padding-bottom: 0; }
|
||||
.vv-log-right-pre { max-height: none; overflow-y: auto; }
|
||||
|
||||
@@ -1237,12 +1237,23 @@ function vvFitRight() {
|
||||
// expanded at the new panel size instead of snapping back to the resting share. The floors keep
|
||||
// the same 1:2 relationship, or on a very short viewport the two states would clamp to the same
|
||||
// number and the control would appear to do nothing.
|
||||
if (vvSchedChat) {
|
||||
vvSchedChat.setHeights(Math.max(70, Math.round(availH * 0.20)) + 'px',
|
||||
Math.max(140, Math.round(availH * 0.40)) + 'px');
|
||||
const dock = document.getElementById('vv-ai-dock');
|
||||
if (vvSchedChat && dock) {
|
||||
// The share is of the transcript, but what the panel has to find room for is the whole
|
||||
// assistant — composer, control row, padding. Measured rather than assumed, because it is a
|
||||
// wrapped row of buttons whose height depends on how narrow the panel is.
|
||||
const chatBox = document.getElementById('vv-sched-ai-chat');
|
||||
const chrome = chatBox ? Math.max(0, dock.offsetHeight - chatBox.offsetHeight) : 0;
|
||||
// Hard ceiling, not a preference. This panel is a fixed height with overflow:hidden, so a
|
||||
// transcript that asks for more than is left is not scrolled into place — it pushes its own
|
||||
// composer out of the panel and the panel cuts it off. VIEW_MIN keeps the thing being
|
||||
// discussed on screen too; a chat that covers it entirely is not worth the room it took.
|
||||
const VIEW_MIN = 90;
|
||||
const room = Math.max(60, availH - VIEW_MIN - chrome);
|
||||
vvSchedChat.setHeights(Math.min(room, Math.max(70, Math.round(availH * 0.20))) + 'px',
|
||||
Math.min(room, Math.max(140, Math.round(availH * 0.40))) + 'px');
|
||||
}
|
||||
// Measured after the heights are applied, so this reads the clamped height, not the natural one.
|
||||
const dock = document.getElementById('vv-ai-dock');
|
||||
const dockH = dock ? dock.offsetHeight : 0;
|
||||
const contentH = Math.max(80, availH - dockH);
|
||||
if (pre.style.display !== 'none') {
|
||||
|
||||
Reference in New Issue
Block a user