fix: refine presentation slides 2, 5 and 7
Build and publish Eldorado documentation / build (pull_request) Successful in 56s
Build and publish Eldorado documentation / build (pull_request) Successful in 56s
This commit is contained in:
1 parent
46bb8b2b48
commit
499049eff3
6 files changed
+57
-10
No files matched your search
@@ -1,4 +1,5 @@
|
||||
const {chromium}=require('playwright');
|
||||
const staircaseFits=require('./presentation-staircase.cjs');
|
||||
const assert=require('node:assert/strict');const fs=require('node:fs');
|
||||
(async()=>{
|
||||
const base=process.argv[2]||'http://127.0.0.1:43853';const root=base+'/eldorado-v1/documentation/';
|
||||
@@ -22,7 +23,8 @@ const assert=require('node:assert/strict');const fs=require('node:fs');
|
||||
for(let i=0;i<23;i++){
|
||||
assert.equal(await f.evaluate(()=>Reveal.getIndices().h),i);visited.push(await f.evaluate(()=>Reveal.getCurrentSlide().id));
|
||||
const bad=await f.evaluate(()=>{const r=Reveal.getCurrentSlide().getBoundingClientRect();return [...Reveal.getCurrentSlide().querySelectorAll('svg,text,.journey,.learning-loop,.contribution-grid,h1,h2,p,li,table,.flow,.roles,.timeline')].filter(e=>!e.closest('.notes')&&e.getBoundingClientRect().width>0).filter(e=>{const b=e.getBoundingClientRect();return b.bottom>r.bottom+1||b.right>r.right+1||b.left<r.left-1}).map(e=>e.textContent)});assert.deepEqual(bad,[]);
|
||||
if(i===4)assert(await f.evaluate(()=>[...document.querySelectorAll('#contributors .contribution-grid>div')].every(e=>{const a=e.querySelector('span').getBoundingClientRect(), arrow=e.querySelector('i').getBoundingClientRect(), b=e.querySelector('b').getBoundingClientRect();return a.bottom<=arrow.top+2&&arrow.bottom<=b.top+2&&Math.abs((a.left+a.right-b.left-b.right)/2)<2&&getComputedStyle(e.querySelector('i')).transform==='matrix(0, 1, -1, 0, 0, 0)'})),'contribution arrows must point down to their own phase');
|
||||
if(i===6)assert(await f.evaluate(staircaseFits),'staircase aligns each arrow with its intended steps');
|
||||
if(i===4)assert(await f.evaluate(()=>[...document.querySelectorAll('#contributors .contribution-grid>div')].every(e=>{const a=e.querySelector('span').getBoundingClientRect(), arrow=e.querySelector('i').getBoundingClientRect(), b=e.querySelector('b').getBoundingClientRect();return a.bottom<=arrow.top+2&&arrow.bottom<=b.top+2&&Math.abs((a.left+a.right-b.left-b.right)/2)<2&&getComputedStyle(e.querySelector('i')).transform==='matrix(0, 1, -1, 0, 0, 0)'})),'contribution arrows must point down to their own phase');
|
||||
await iframe.screenshot({path:`${out}/${viewport.width}-${i+1}.png`});
|
||||
if(i<22)await p.keyboard.press('ArrowRight');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Browser-side geometry contract, shared by standalone and embedded acceptance.
|
||||
module.exports = function staircaseFits() {
|
||||
const els=[...document.querySelectorAll('#learning-loop .learning-loop>*')];
|
||||
const b=els.map(e=>e.getBoundingClientRect());
|
||||
const center=r=>({x:(r.left+r.right)/2,y:(r.top+r.bottom)/2});
|
||||
const close=(a,b)=>Math.abs(a-b)<2;
|
||||
return [[0,1,2],[4,5,6],[8,9,10]].every(([a,arrow,c])=>
|
||||
close(center(b[a]).y,center(b[c]).y)&&close(center(b[a]).y,center(b[arrow]).y)&&
|
||||
b[a].right<=b[arrow].left+2&&b[arrow].right<=b[c].left+2
|
||||
)&&[[2,3,4],[6,7,8]].every(([a,arrow,c])=>
|
||||
close(center(b[a]).x,center(b[c]).x)&&close(center(b[a]).x,center(b[arrow]).x)&&
|
||||
b[a].bottom<=b[arrow].top+2&&b[arrow].bottom<=b[c].top+2
|
||||
)&&els.filter(e=>e.tagName==='SPAN').every(e=>e.scrollWidth<=e.clientWidth+1);
|
||||
};
|
||||
@@ -1,4 +1,5 @@
|
||||
const {chromium}=require('playwright');
|
||||
const staircaseFits=require('./presentation-staircase.cjs');
|
||||
const fs=require('node:fs'); const assert=require('node:assert/strict');
|
||||
(async()=>{
|
||||
const base=process.argv[2]||'http://127.0.0.1:4179'; const root='/eldorado-v1/documentation/';const url=base+root+'presentations/less-prompting-more-shipping/';
|
||||
@@ -20,7 +21,8 @@ const fs=require('node:fs'); const assert=require('node:assert/strict');
|
||||
const slide=Reveal.getCurrentSlide(),r=slide.getBoundingClientRect();
|
||||
return [...slide.querySelectorAll('svg,text,.journey,.learning-loop,.contribution-grid,h1,h2,p,li,td,th,.rail,.gate,.facts,.flow,.roles,.timeline,.capacity,.measure-list,.contrast,.comparison,.choices,.ledger')].filter(e=>!e.closest('.notes')&&e.getBoundingClientRect().width>0).filter(e=>{const b=e.getBoundingClientRect();return b.bottom>r.bottom+1||b.right>r.right+1||b.left<r.left-1||b.top<r.top-1}).map(e=>e.textContent.slice(0,60));
|
||||
});
|
||||
if(i===4)assert(await page.evaluate(()=>[...document.querySelectorAll('#contributors .contribution-grid>div')].every(e=>{const a=e.querySelector('span').getBoundingClientRect(), arrow=e.querySelector('i').getBoundingClientRect(), b=e.querySelector('b').getBoundingClientRect();return a.bottom<=arrow.top+2&&arrow.bottom<=b.top+2&&Math.abs((a.left+a.right-b.left-b.right)/2)<2&&getComputedStyle(e.querySelector('i')).transform==='matrix(0, 1, -1, 0, 0, 0)'})),'contribution arrows must point down to their own phase');
|
||||
if(i===6)assert(await page.evaluate(staircaseFits),'staircase aligns each arrow with its intended steps');
|
||||
if(i===4)assert(await page.evaluate(()=>[...document.querySelectorAll('#contributors .contribution-grid>div')].every(e=>{const a=e.querySelector('span').getBoundingClientRect(), arrow=e.querySelector('i').getBoundingClientRect(), b=e.querySelector('b').getBoundingClientRect();return a.bottom<=arrow.top+2&&arrow.bottom<=b.top+2&&Math.abs((a.left+a.right-b.left-b.right)/2)<2&&getComputedStyle(e.querySelector('i')).transform==='matrix(0, 1, -1, 0, 0, 0)'})),'contribution arrows must point down to their own phase');
|
||||
bounds.push({slide:i+1,overflow:bad});
|
||||
await page.screenshot({path:`${out}/${viewport.width}-slide-${String(i+1).padStart(2,'0')}.png`});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,26 @@ test('deck preserves assignment coverage, 35+15 timing and traceable notes',()=>
|
||||
for(const id of ['experiment']) assert.match(slides.find(s=>s.id===id).body,/fictional/i);
|
||||
assert.match(slides.find(s=>s.id==='qualification').notes,/separately authorizes/);
|
||||
});
|
||||
test('starting point keeps content without the two removed headings',()=>{
|
||||
const body=slides.find(s=>s.id==='starting-point').body;
|
||||
assert.doesNotMatch(body,/Assignment facts|Unknown until discovery/);
|
||||
for(const text of ['Solo architect → CTO','No formal authority over teams','Stack, tools, process, baselines','Capacity and actual bottlenecks'])assert(body.includes(text));
|
||||
assert.doesNotMatch(body,/<p><br>/);
|
||||
});
|
||||
test('contributors explains human-controlled AI tools below the diagram',()=>{
|
||||
const body=slides.find(s=>s.id==='contributors').body;
|
||||
const definition='AI Agent = Claude, Cline, ChatGPT or a similar tool, used under human control.';
|
||||
assert(body.includes(definition));
|
||||
assert(body.indexOf(definition)>body.indexOf('contribution-grid'));
|
||||
assert(body.includes('Dashed ⇢ contribution from outside the cycle.'));
|
||||
});
|
||||
test('learning loop staircase preserves the original semantic sequence',()=>{
|
||||
const body=slides.find(s=>s.id==='learning-loop').body;
|
||||
const loop=body.split('</div>')[0];
|
||||
assert.deepEqual([...loop.matchAll(/<span>(.*?)<\/span>/g)].map(m=>m[1]),['Understand work','Measure + baseline','Engineer topology','Use in real work','Collect results','Reassess']);
|
||||
assert.deepEqual([...loop.matchAll(/<i>(.*?)<\/i>/g)].map(m=>m[1]),['→','↓','→','↓','→']);
|
||||
assert(body.includes('↻ Repeat within each phase.'));
|
||||
});
|
||||
test('build emits local pinned Reveal assets, stable IDs and no production CDN',()=>{
|
||||
execFileSync(process.execPath,['scripts/build-presentations.mjs']);
|
||||
const dir='static/presentations/less-prompting-more-shipping'; const html=read(`${dir}/index.html`);
|
||||
|
||||
Reference in new issue
Block a user