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) ─────────────────────────────────────────────────