Show the terse control list when the help block is collapsed

This commit is contained in:
Gmer4Lfe
2026-08-05 17:58:29 -04:00
parent 2ad3a1bfed
commit aeb8c01370
2 changed files with 90 additions and 22 deletions
+16 -5
View File
@@ -508,16 +508,21 @@ $runningScripts = array_unique($runningScripts);
also what the AI tab retrieves, so the panel you read and the answer the
assistant gives are the same text and cannot drift — the same argument that
makes this page parse script PURPOSE blocks instead of restating them.
Everything lives inside the collapsible body, and collapsed means gone. An
earlier version kept the reference tables permanently visible below the fold
line: 33 table rows that pushed Next Runs, Recent Errors, Activity, Locks and
the rest off the bottom of a fixed-height panel. Reference material must not
outrank the live state of the machine on the page you watch it from. -->
Two views of one file, swapped rather than stacked. Collapsed shows the terse
one-line-per-control list this help used to be — short enough that Next Runs and
the error blocks stay on screen, which an earlier always-visible tier of 33
table rows was not. Expanding replaces it with the full document.
.vv-sug-brief is the inverse of .vv-sug-body; vvToggleSug() and
vvRestoreSugStates() drive both. -->
<div class="vv-sug-body vv-info-body">
<div class="vv-doc">
<?= vv_docs_render('Plugin/unraid/pages/readme/scheduler-readme.md', $_vv_doc_vars) ?>
</div>
</div>
<ul class="vv-info-cols vv-sug-brief vv-info-body" style="display:none">
<?= vv_docs_brief('Plugin/unraid/pages/readme/scheduler-readme.md', $_vv_doc_vars,
fn($h) => is_string($h) && str_starts_with($h, 'Reference —')) ?>
</ul>
</div>
<!-- ── Next Runs ── -->
@@ -2104,6 +2109,10 @@ function vvToggleSug(header) {
body.style.display = open ? 'none' : '';
chevron.textContent = open ? '▸' : '▾';
const block = header.closest('[data-save-key]');
// Optional collapsed-state summary: shown exactly when the body is hidden. Lets a block put
// something terse on screen while shut instead of nothing, without a second toggle to manage.
const brief = block && block.querySelector('.vv-sug-brief');
if (brief) brief.style.display = open ? '' : 'none';
if (block) localStorage.setItem('vv-sug-' + block.dataset.saveKey, open ? '0' : '1');
}
@@ -2117,6 +2126,8 @@ function vvRestoreSugStates() {
const open = saved === '1';
body.style.display = open ? '' : 'none';
if (chevron) chevron.textContent = open ? '▾' : '▸';
const brief = block.querySelector('.vv-sug-brief');
if (brief) brief.style.display = open ? 'none' : '';
});
}