From 252d3f173eb8ea8977ecf4266f054cc2439dc0a3 Mon Sep 17 00:00:00 2001 From: ZDDC Date: Fri, 5 Jun 2026 16:14:03 -0500 Subject: [PATCH] fix(browse): tighten vertical space above Title in the .zddc form The first section's heading top margin (.6rem) stacked with the intro paragraph's bottom margin (.8rem), leaving ~1.4rem of dead space above the Title label. Drop the heading's top margin for the first section (new `tight` flag in section()) and trim the intro's bottom margin to .5rem. Later sections keep their inter-section gap. Co-Authored-By: Claude Opus 4.8 (1M context) --- browse/js/preview-zddc-form.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/browse/js/preview-zddc-form.js b/browse/js/preview-zddc-form.js index 6b5efd8..000898a 100644 --- a/browse/js/preview-zddc-form.js +++ b/browse/js/preview-zddc-form.js @@ -163,18 +163,21 @@ } var help = el('p', 'help'); - help.style.cssText = 'color:var(--color-text-muted,#666);font-size:.85rem;margin:.3rem 0 .8rem;'; + help.style.cssText = 'color:var(--color-text-muted,#666);font-size:.85rem;margin:.3rem 0 .5rem;'; help.textContent = editable ? 'Fill in the project options below. Structure (the folder shape, WORM, tools) is managed by the baseline and shown read-only — edit it via raw YAML if you must.' : 'Read-only — you need admin authority over this path to edit it.'; shell.appendChild(help); // ── OPTION fields ─────────────────────────────────────────────────── - function section(title, hint) { + function section(title, hint, tight) { var s = el('section', 'zf-section'); s.style.cssText = 'margin:0 0 1rem;'; var h = el('h3', null, title); - h.style.cssText = 'font-size:1em;margin:.6rem 0 .2rem;'; + // `tight` drops the heading's top margin for the FIRST section so + // it doesn't stack with the intro's bottom margin (the gap above + // Title was reading as excessive). Later sections keep the gap. + h.style.cssText = 'font-size:1em;margin:' + (tight ? '0' : '.6rem') + ' 0 .2rem;'; s.appendChild(h); if (hint) { var p = el('p', 'help', hint); @@ -186,7 +189,7 @@ } // title - var titleSec = section('Title', desc('title')); + var titleSec = section('Title', desc('title'), true); var titleInput = el('input'); titleInput.type = 'text'; titleInput.value = (typeof data.title === 'string') ? data.title : '';