T7.4 - A2: one warning, said once, visible from anywhere

The same not-release-ready warning rendered three times on the creator:
1. the release banner under the context bar   - STAYS, and is now the only one
2. updateStickyStatus() in the sticky save bar - removed
3. a static field-hint under the status radios - removed

The count moved to a badge on the Constraints rail entry (D3's rail replaced
the tabs A2's "tab count badge" referred to). The rail is position:sticky at
BOTH widths, so the badge is on screen from any section at 390px and 1440px -
measured with the constraint table AND the banner both scrolled out of view.
The badge is a number, not a colour: the count is the content, and the rail
entry carries an aria-label saying it ("Constraints - 3 open").

The banner is now role="status" (the login.html aria-live pattern, per C1) and
only rewrites when its message actually changes - a live region that repaints
on every save announces on every save.

Duplicate 2 was not just noise. It wrote the warning with textContent into
the SAME span the B5 autosave indicator mounts into, destroying the indicator
on every count change. Removing the duplicate is what fixes that; the probe
pins the indicator's survival across banner updates.

Verification (each probe run alone): NEW tests/warning_check.py 17/17.
Regressions: hold_check 50/50, form_structure_check 50/51 (the standing F6
height gap, re-measured after T7.5 as recorded at T7.2).

Items: A2

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-19 10:20:12 -07:00
parent 2b597e68d8
commit 60434d452c
5 changed files with 286 additions and 17 deletions

View File

@@ -1006,8 +1006,11 @@ function updateReleaseBanner(){
txt+=` <button type="button" class="rb-act" onclick="urgentOverrideRelease()">Release now — audited override</button>`;
}
}
b.innerHTML=`<div class="rb-inner ${cls}">${txt}</div>`;
updateStickyStatus();
// A live region announces every rewrite, and this runs on saves and loads
// that change nothing - only touch the DOM when the message actually moved.
const html=`<div class="rb-inner ${cls}">${txt}</div>`;
if(b._rbLast!==html){ b._rbLast=html; b.innerHTML=html; }
updateConstraintBadge();
}
// Releasing with an unclosed predecessor is allowed but must be explained. The
// reason rides on the package (data.gateOverride) and the server writes it to the
@@ -1489,7 +1492,7 @@ function setFormChrome(on){
if(save) save.style.display = on ? 'flex' : 'none';
document.body.classList.toggle('has-sticky-save', !!on);
document.body.classList.toggle('has-sec-rail', !!on);
if(on){ initSectionNavAutoHide(); buildSectionRail(); updateStickyStatus(); }
if(on){ initSectionNavAutoHide(); buildSectionRail(); updateConstraintBadge(); }
else positionSectionNav();
}
// ── SECTION STRUCTURE (F6 / D3) ───────────────────────────────────────────────
@@ -1653,6 +1656,7 @@ function buildSectionRail(){
const want = (typeof WPUrl !== 'undefined' && WPUrl.get && WPUrl.get('section')) || '';
const target = cards.some(c => c.id === want) ? want : (cards[0] && cards[0].id) || '';
secApplyOpenState(target);
updateConstraintBadge();
secBindSpy();
}
@@ -1766,13 +1770,24 @@ function initSectionNavAutoHide(){
try { setExpandAll(localStorage.getItem(SEC_EXPAND_KEY) === '1'); } catch(e){}
}
function updateStickyStatus(){
const el=document.getElementById('sticky-status'); if(!el) return;
const r=readiness(); const st=getRadio('status');
if(st==='Issue'){ el.className='sticky-status ss-hold'; el.textContent=`⛔ On hold — ${r.open} constraint${r.open===1?'':'s'} reopened`; }
else if(r.ready){ el.className='sticky-status ss-ready'; el.textContent=`✓ Release-ready — all ${r.total} constraints cleared`; }
else if(r.constraintsClear){ el.className='sticky-status ss-notready'; el.textContent=`⚠ Waiting on ${r.blocking.length} predecessor${r.blocking.length===1?'':'s'}`; }
else { el.className='sticky-status ss-notready'; el.textContent=`${r.open} of ${r.total} constraint${r.open===1?'':'s'} open`+(r.blocking.length?` · ${r.blocking.length} predecessor${r.blocking.length===1?'':'s'}`:''); }
// A2: the count badge on the Constraints rail entry. The rail is sticky at every
// width, so this is the thing a user can see from ANY section - the top banner
// is the warning, this is the pointer to it. It replaced updateStickyStatus(),
// which wrote the same warning a second time into the sticky save bar - and
// destroyed the B5 autosave indicator mounted in the same span every time it did.
function updateConstraintBadge(){
const btn=document.querySelector('.sec-rail-item[data-sec="constraint-card"]');
if(!btn) return;
let badge=btn.querySelector('.sec-badge');
if(!badge){
badge=document.createElement('span');
badge.className='sec-badge';
btn.appendChild(badge);
}
const open=readiness().open;
badge.hidden = open===0;
badge.textContent = open || '';
btn.setAttribute('aria-label', 'Constraints'+(open?`${open} open`:''));
}
// ── LOCATION (CR-004 / T6.3) ─────────────────────────────────────────────────

View File

@@ -96,8 +96,12 @@
<div class="ctx-bar" id="ctx-bar"></div>
<!-- RELEASE READINESS BANNER -->
<div class="release-banner" id="release-banner"></div>
<!-- RELEASE READINESS BANNER - the ONE readiness warning on the page (A2).
role="status" is a polite live region, the login.html pattern: a change in
the open-constraint count is announced without stealing focus. The two
duplicates this page used to render (the sticky bar's copy and the static
hint under the status control) are gone; the rail badge carries the count. -->
<div class="release-banner" id="release-banner" role="status"></div>
<!-- F6/D3: the jump-link strip stood here. It was a row of `<span onclick>` chips
that scrolled you somewhere inside a 5,399px page and then told you nothing
@@ -194,7 +198,6 @@
<label class="radio-pill" data-val="QC"><input type="radio" name="status"><span class="dot"></span>QC</label>
<label class="radio-pill" data-val="Closed"><input type="radio" name="status"><span class="dot"></span>Closed</label>
</div>
<div class="field-hint">Cannot move to <strong>Issued</strong> or beyond until all constraints are cleared.</div>
</div>
</div>
<div class="notice">WP number builds automatically from these scope fields + the WP type (per the SOP naming format):</div>
@@ -523,7 +526,10 @@
<input type="file" id="cmt-import" accept="application/json" style="display:none" onchange="importComments(event)"></div></div>
</aside>
<!-- STICKY SAVE BAR (always-visible save + release status) -->
<!-- STICKY SAVE BAR. The status span belongs to the B5 autosave indicator and
nothing else: the readiness text that used to be written here was duplicate
two of the A2 warning, and writing it via textContent destroyed the mounted
indicator every time the count changed. -->
<div class="sticky-save" id="sticky-save" style="display:none">
<span class="sticky-status" id="sticky-status"></span>
<div class="sticky-actions">

View File

@@ -762,6 +762,12 @@
.sec-rail-item:hover { color: var(--accent); border-color: var(--border); }
/* Not colour alone: the current entry is bolder, keeps a left marker and is the
one carrying aria-current. */
/* A2: the open-constraint count. Red chip + a number - the number is the
content, so the state is never colour-only. Sized to stay legible at 390px. */
.sec-badge { display:inline-block; margin-left:8px; min-width:18px; padding:1px 6px;
border-radius:9px; background:var(--red); color:var(--cds-text-on-color);
font-size:12px; font-weight:700; line-height:16px; text-align:center; }
.sec-badge[hidden] { display:none; }
.sec-rail-item.is-current {
color: var(--accent); font-weight: 700;
background: var(--accent-dim);
@@ -1017,9 +1023,6 @@
border-top:1px solid var(--border-strong); box-shadow:var(--wp-shadow-sticky); }
.sticky-save .sticky-status{ font-size:13px; font-weight:600; }
.sticky-save .sticky-actions{ display:flex; gap:10px; }
.ss-ready{ color:var(--accent-green); }
.ss-notready{ color:var(--accent-amber); }
.ss-hold{ color:var(--red); }
body.has-sticky-save .main{ padding-bottom:74px; }
/* Disciplines + per-discipline scope */