From 60434d452c307f7a831cc3ce073a904d52c65c2a Mon Sep 17 00:00:00 2001 From: "n.siegfried" Date: Wed, 19 Aug 2026 10:20:12 -0700 Subject: [PATCH] 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 --- docs/reference/file-map.md | 1 + html/wp-creation-app.js | 35 ++++-- html/wp-creation-index.html | 14 ++- html/wp-creation-styles.css | 9 +- tests/warning_check.py | 244 ++++++++++++++++++++++++++++++++++++ 5 files changed, 286 insertions(+), 17 deletions(-) create mode 100644 tests/warning_check.py diff --git a/docs/reference/file-map.md b/docs/reference/file-map.md index 9de4147..e157e8b 100644 --- a/docs/reference/file-map.md +++ b/docs/reference/file-map.md @@ -278,6 +278,7 @@ Wave 7 adds these: python tests/frame_check.py # B7/T7.1/D1 - is the iframe actually gone? 39 checks python tests/form_structure_check.py # F6/D3 - rail, disclosure, one open section 51 checks python tests/hold_check.py # CR-015/A1/D4 - the hold clears, gates hold 50 checks +python tests/warning_check.py # A2 - one warning, a badge from anywhere 17 checks ``` **Three probes were re-pointed at `T7.1`.** `sections_check.py` 5b drove the live diff --git a/html/wp-creation-app.js b/html/wp-creation-app.js index 78e7ca8..f95aec9 100644 --- a/html/wp-creation-app.js +++ b/html/wp-creation-app.js @@ -1006,8 +1006,11 @@ function updateReleaseBanner(){ txt+=` `; } } - b.innerHTML=`
${txt}
`; - 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=`
${txt}
`; + 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) ───────────────────────────────────────────────── diff --git a/html/wp-creation-index.html b/html/wp-creation-index.html index a4d41c1..29e5452 100644 --- a/html/wp-creation-index.html +++ b/html/wp-creation-index.html @@ -96,8 +96,12 @@
- -
+ +
+