Separate whether the chat is expanded from how big expanded is
One is an action taken constantly and the other a preference set once, so the banner names the size and the composer keeps the toggle.
This commit is contained in:
@@ -232,8 +232,12 @@ if (is_dir('/var/log/varaverk')) {
|
||||
// most room, so it rests taller than the Monitor card and expands to most of the viewport.
|
||||
vv_ai_chat_markup('vv-ai', [
|
||||
'profile' => 'varaverk',
|
||||
// All three stated rather than derived. Large is at the viewport cap here, and leaving medium
|
||||
// to be worked out from the resting height would land it on that same cap — two settings
|
||||
// doing the same thing.
|
||||
'height' => '52vh',
|
||||
'tall' => '85vh',
|
||||
'tall' => '68vh',
|
||||
'tallLarge' => '85vh',
|
||||
'empty' => "Ask Varaverk about itself. Answers come only from this installation's own "
|
||||
. 'documentation, with sources.',
|
||||
'placeholder' => 'e.g. what stops rsync and the mover running at once?',
|
||||
|
||||
@@ -360,13 +360,12 @@ $_vv_doc_vars = array_merge(vv_conf_vars(), ['SCRIPTS_DIR' => SCRIPTS_DIR]);
|
||||
wrapper that still carries the #vv-ai-dock id, and two elements answering to that name
|
||||
on one page would be a trap the day anything queries it globally. -->
|
||||
<div class="vv-card" id="vv-ai-assistant-card">
|
||||
<h3>
|
||||
<span style="display:flex;align-items:center;gap:5px;">
|
||||
<span class="vv-ico"><svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="#aaa" stroke-width="1.1" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="5"/><path d="M4.4 4.6C4.4 3.7 5.1 3.1 6 3.1C6.9 3.1 7.6 3.7 7.6 4.5C7.6 5.9 6 5.7 6 7"/><circle cx="6" cy="8.8" r="0.6" fill="#888" stroke="none"/></svg></span>
|
||||
Assistant
|
||||
</span>
|
||||
</h3>
|
||||
<?php
|
||||
// No <h3> of its own, unlike every other card here. The component draws its own banner now
|
||||
// — it carries the size control — and a card heading above that banner would be the same
|
||||
// words twice. The banner is styled as a card heading so the row still reads level with the
|
||||
// cards beside it.
|
||||
//
|
||||
// Starts on General Chat, unlike the AI tab. This is the box you type an idle question
|
||||
// into while watching the dashboard, and the worker escalates anything about this install
|
||||
// to the assistant on its own — so landing on the strict profile here would refuse
|
||||
@@ -374,7 +373,15 @@ $_vv_doc_vars = array_merge(vv_conf_vars(), ['SCRIPTS_DIR' => SCRIPTS_DIR]);
|
||||
vv_ai_chat_markup('vv-mon-ai', [
|
||||
'profile' => 'chat',
|
||||
'compact' => true,
|
||||
'title' => 'Assistant',
|
||||
'icon' => '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="#aaa" stroke-width="1.1" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="5"/><path d="M4.4 4.6C4.4 3.7 5.1 3.1 6 3.1C6.9 3.1 7.6 3.7 7.6 4.5C7.6 5.9 6 5.7 6 7"/><circle cx="6" cy="8.8" r="0.6" fill="#888" stroke="none"/></svg>',
|
||||
// Deliberately unchanged. The control is wired in so the card behaves like every other
|
||||
// instance, but the numbers are the ones this card has always used: 300px collapsed and
|
||||
// 750px expanded, which is now Large. Medium is provisional and sits between them until
|
||||
// this card gets the same re-cut the Scheduler's shares just had.
|
||||
'height' => '300px',
|
||||
'tall' => '500px',
|
||||
'tallLarge' => '750px',
|
||||
'empty' => 'Ask anything. Questions about this installation are handed to the '
|
||||
. 'Varaverk assistant automatically.',
|
||||
'placeholder' => 'Ask the assistant…',
|
||||
|
||||
@@ -1224,10 +1224,11 @@ function vvFitRight() {
|
||||
// its floor, and nothing ever raised it again.
|
||||
const availH = Math.max(80, lf.getBoundingClientRect().top - 32
|
||||
- toolbar.getBoundingClientRect().bottom);
|
||||
// A fifth of the panel at rest, two fifths expanded. Both were double this, which made the
|
||||
// assistant the largest thing in the panel before it had been asked anything — and the view
|
||||
// above is what the question is usually about. Expanded still leaves the majority to the log,
|
||||
// conf or script being discussed, so a follow-up does not need the panel handed back first.
|
||||
// Three shares of the panel: 13% collapsed, 20% expanded at Medium, 40% at Large. Collapsed is
|
||||
// deliberately small — enough to see the last exchange and type, while the log, conf or script
|
||||
// being discussed keeps the panel, which is what you are usually asking about. Medium is for
|
||||
// following an answer without giving up the view; Large is for sitting and reading one, and
|
||||
// still leaves the majority above it so a follow-up does not need the panel handed back first.
|
||||
//
|
||||
// It grows upward: the panel is pinned at the bottom and everything above it is sized from what
|
||||
// is left, a few lines down. So the top edge rises and the thing being read stays where it is.
|
||||
@@ -1250,7 +1251,8 @@ function vvFitRight() {
|
||||
// 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',
|
||||
vvSchedChat.setHeights(Math.min(room, Math.max(60, Math.round(availH * 0.13))) + 'px',
|
||||
Math.min(room, Math.max(100, 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.
|
||||
|
||||
Reference in New Issue
Block a user