From 2c61c196ae28294c0b545ea62d34c367ad11421e Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Wed, 18 Nov 2026 12:33:01 +0000 Subject: [PATCH] Retain layout regression coverage for purposeful workspace surfaces --- PlotLine.Tests/Browser/writer-layout-phase1.cjs | 2 +- PlotLine/Views/Writer/_WriterWrite.cshtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PlotLine.Tests/Browser/writer-layout-phase1.cjs b/PlotLine.Tests/Browser/writer-layout-phase1.cjs index 149078f3..989759bb 100644 --- a/PlotLine.Tests/Browser/writer-layout-phase1.cjs +++ b/PlotLine.Tests/Browser/writer-layout-phase1.cjs @@ -7,7 +7,7 @@ const paths=['Write','Explore','Plan','Review','Reflect']; if(identity){await p.goto(base+'/Account/Login');await p.locator('[name=Email]').fill(w.Email);await p.locator('[name=Password]').fill(w.Password);await Promise.all([p.waitForURL('**/Projects'),p.locator('button[type=submit]').click()]);} const expand=async()=>{const x=p.locator('[data-ribbon-collapse]');if(await x.getAttribute('aria-expanded')==='false')await x.click();await p.waitForFunction(()=>!document.querySelector('[data-ribbon-collapse]').disabled);}; const snap=async name=>{if(out&&pwa){await p.mouse.move(2,995);await p.waitForTimeout(200);fs.mkdirSync(out,{recursive:true});await p.screenshot({path:out+'/'+name+'.png',animations:'disabled'});}}; - for(const d of paths){await p.goto(`${base}/Writer/${d}?projectId=${w.project}&bookId=${w.book}`);await p.evaluate(()=>{for(const k of Object.keys(localStorage).filter(k=>k.startsWith('plotdirector.writerLayout.')))localStorage.removeItem(k)});await p.reload();if(!before)await expand();await p.waitForTimeout(150);const toggle=p.locator(before?'.writer3-layout-tools button':'[data-writer-companion-toggle]').first();assert(await p.locator('.writer3-reference').isVisible());const measure=()=>p.locator('.writer3-main').evaluate(n=>({working:(n.querySelector('.writer-objective-form,.writer3-explore-paths,.reader-controls,.writer3-stat-grid,.writer3-inset')||n).getBoundingClientRect().width,width:n.clientWidth,scroll:getComputedStyle(n).overflowY,child:[...n.children].filter(n=>n.getBoundingClientRect().width>0).map(n=>n.getBoundingClientRect().width),max:Math.max(...[...n.children].map(n=>n.getBoundingClientRect().width))}));const shown=await measure();await snap(d+'-shown');await toggle.click();await p.waitForTimeout(100);assert(await p.locator('.writer3-reference').isHidden());const hidden=await measure();await snap(d+'-hidden'); + for(const d of paths){await p.goto(`${base}/Writer/${d}?projectId=${w.project}&bookId=${w.book}`);await p.evaluate(()=>{for(const k of Object.keys(localStorage).filter(k=>k.startsWith('plotdirector.writerLayout.')))localStorage.removeItem(k)});await p.reload();if(!before)await expand();await p.waitForTimeout(150);if(!before&&['Explore','Plan','Reflect'].includes(d)){assert.equal(await p.locator('.writer3-reference').count(),0,d+' intentionally has one working surface without a Word/reference column');assert(await p.locator('[data-writer-companion-toggle]').isHidden());assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+2));assert.equal(await p.locator('.writer3-layout-tools').count(),0);assert.equal(await p.locator('.writer3-header .writer3-cover').count(),0);await snap(d+'-working-surface');results.push({pwa,d,layout:'phase2-purposeful-surface'});continue;}const toggle=p.locator(before?'.writer3-layout-tools button':'[data-writer-companion-toggle]').first();assert(await p.locator('.writer3-reference').isVisible());const measure=()=>p.locator('.writer3-main').evaluate(n=>({working:(n.querySelector('.writer-objective-form,.writer3-explore-paths,.reader-controls,.writer3-stat-grid,.writer3-inset')||n).getBoundingClientRect().width,width:n.clientWidth,scroll:getComputedStyle(n).overflowY,child:[...n.children].filter(n=>n.getBoundingClientRect().width>0).map(n=>n.getBoundingClientRect().width),max:Math.max(...[...n.children].map(n=>n.getBoundingClientRect().width))}));const shown=await measure();await snap(d+'-shown');await toggle.click();await p.waitForTimeout(100);assert(await p.locator('.writer3-reference').isHidden());const hidden=await measure();await snap(d+'-hidden'); if(!before){assert(hidden.width>shown.width+200);assert(hidden.working>shown.working+150,d+' internal working surface reflow');assert.equal(hidden.scroll,'visible');assert.equal(await p.locator('.writer3-layout-tools').count(),0);assert.equal(await p.locator('.writer3-header .writer3-cover').count(),0);assert.equal(await p.locator('.writer3-connection').count(),0);assert(await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+2));await p.reload();assert(await p.locator('.writer3-reference').isHidden());await p.locator('[data-writer-companion-toggle]').click();assert(await p.locator('.writer3-reference').isVisible());const divider=p.locator('.writer3-divider');await divider.focus();const a=await p.locator('.writer3-reference').evaluate(n=>n.getBoundingClientRect().width);await p.keyboard.press('ArrowLeft');const z=await p.locator('.writer3-reference').evaluate(n=>n.getBoundingClientRect().width);assert(z>=a+5);await p.locator('[data-help-key="writer3.layout"] button').click();await p.locator('.plotline-help-popover').waitFor();await p.keyboard.press('Escape');} results.push({pwa,d,shown,hidden}); } diff --git a/PlotLine/Views/Writer/_WriterWrite.cshtml b/PlotLine/Views/Writer/_WriterWrite.cshtml index 83aec8b0..ee54e396 100644 --- a/PlotLine/Views/Writer/_WriterWrite.cshtml +++ b/PlotLine/Views/Writer/_WriterWrite.cshtml @@ -19,13 +19,13 @@ +

Loading your recorded intentions…

@if(!Model.ActivityIsPrivate){ @if(focus != null && !editing){
}

Work sessions & Audio Review

Recording keeps your saved working focus. Audio Review is recorded for a chapter.

} else{

Work-session evidence is private to the book owner. Your chapter and scene tools remain available.

} -

Loading your recorded intentions…