Open the dashboard chat collapsed, every time
A size remembered from days ago would push the cards below it down on every load, with nothing on the page to explain why.
This commit is contained in:
@@ -685,8 +685,13 @@ vv_ai_profiles_script();
|
|||||||
|
|
||||||
// ── Expand / collapse ────────────────────────────────────────────────
|
// ── Expand / collapse ────────────────────────────────────────────────
|
||||||
// Both heights come from the markup, so the page decides them and this only switches
|
// Both heights come from the markup, so the page decides them and this only switches
|
||||||
// between them. Remembered per instance: the dashboard chat and the tab's are different
|
// between them.
|
||||||
// sizes for different reasons, and a shared key would make one of them wrong.
|
//
|
||||||
|
// Deliberately not remembered. The only instance with this control lives on the Monitor
|
||||||
|
// dashboard, which is a page you open to glance at something else — a chat left expanded
|
||||||
|
// days ago would push every card below it down on each load, and the cause would be
|
||||||
|
// invisible to whoever eventually wondered why. Expanding is for the reading being done
|
||||||
|
// now, so the page always opens collapsed.
|
||||||
//
|
//
|
||||||
// Scroll position is pinned to the bottom afterwards. Growing the box leaves the transcript
|
// Scroll position is pinned to the bottom afterwards. Growing the box leaves the transcript
|
||||||
// scrolled where it was, which puts the newest answer off-screen at the exact moment you
|
// scrolled where it was, which puts the newest answer off-screen at the exact moment you
|
||||||
@@ -696,7 +701,6 @@ vv_ai_profiles_script();
|
|||||||
const el = chatEl();
|
const el = chatEl();
|
||||||
const base = el.dataset.h || '';
|
const base = el.dataset.h || '';
|
||||||
const tall = el.dataset.hTall || '';
|
const tall = el.dataset.hTall || '';
|
||||||
const KEY = 'vv-ai-tall-' + P;
|
|
||||||
const apply = big => {
|
const apply = big => {
|
||||||
if (!base || !tall) return;
|
if (!base || !tall) return;
|
||||||
el.style.height = big ? tall : base;
|
el.style.height = big ? tall : base;
|
||||||
@@ -705,12 +709,7 @@ vv_ai_profiles_script();
|
|||||||
growBtn.classList.toggle('vv-ai-grow-on', big);
|
growBtn.classList.toggle('vv-ai-grow-on', big);
|
||||||
scroll();
|
scroll();
|
||||||
};
|
};
|
||||||
growBtn.addEventListener('click', () => {
|
growBtn.addEventListener('click', () => apply(el.style.height !== tall));
|
||||||
const big = el.style.height !== tall;
|
|
||||||
localStorage.setItem(KEY, big ? '1' : '0');
|
|
||||||
apply(big);
|
|
||||||
});
|
|
||||||
if (localStorage.getItem(KEY) === '1') apply(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Surface any script error into the transcript. Without it a throw anywhere on the page is
|
// Surface any script error into the transcript. Without it a throw anywhere on the page is
|
||||||
|
|||||||
Reference in New Issue
Block a user