← back to Nationalrealestate
auto-save: 2026-07-30T09:16:33 (3 files) — cap_viewport.cjs herocap.cjs livetest.cjs
1dbfb572e0ca6278b761232bed832601e45a2d83 · 2026-07-30 09:16:34 -0700 · Steve Abrams
Files touched
A cap_viewport.cjsA herocap.cjsA livetest.cjs
Diff
commit 1dbfb572e0ca6278b761232bed832601e45a2d83
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Jul 30 09:16:34 2026 -0700
auto-save: 2026-07-30T09:16:33 (3 files) — cap_viewport.cjs herocap.cjs livetest.cjs
---
cap_viewport.cjs | 33 +++++++++++++++++++++++++++++++++
herocap.cjs | 12 ++++++++++++
livetest.cjs | 33 +++++++++++++++++++++++++++++++++
3 files changed, 78 insertions(+)
diff --git a/cap_viewport.cjs b/cap_viewport.cjs
new file mode 100644
index 0000000..e8a9ff3
--- /dev/null
+++ b/cap_viewport.cjs
@@ -0,0 +1,33 @@
+const { chromium, devices } = require('playwright');
+(async () => {
+ const url = process.argv[2] || 'https://corkwallcovering.com/';
+ const q = process.argv[3] || 'grasscloth';
+ const b = await chromium.launch();
+ const ctx = await b.newContext({ ...devices['iPhone 13'] });
+ const page = await ctx.newPage();
+ await page.goto(url, { waitUntil: 'networkidle', timeout: 30000 });
+ // scroll the search box into view like a user would, focus, type — but DON'T scroll to grid after
+ await page.$eval('#searchInput', el => el.scrollIntoView({block:'center'}));
+ await page.click('#searchInput');
+ await page.type('#searchInput', q, { delay: 110 });
+ await page.waitForTimeout(1600);
+ const info = await page.evaluate(() => {
+ const vh = window.innerHeight;
+ const si = document.getElementById('searchInput').getBoundingClientRect();
+ const gr = document.getElementById('grid').getBoundingClientRect();
+ const firstCard = document.querySelector('#grid .card, #grid a.card');
+ const fc = firstCard ? firstCard.getBoundingClientRect() : null;
+ return {
+ viewportH: vh,
+ searchTop: Math.round(si.top),
+ gridTop: Math.round(gr.top),
+ firstCardTop: fc ? Math.round(fc.top) : null,
+ gridBelowViewport: gr.top > vh,
+ firstCardBelowViewport: fc ? fc.top > vh : null,
+ statLine: (document.getElementById('statLine')||{}).textContent
+ };
+ });
+ console.log(JSON.stringify(info, null, 2));
+ await page.screenshot({ path: '/tmp/natural-viewport.png' }); // what the USER actually sees after typing
+ await b.close();
+})().catch(e => { console.error('ERR', e.message); process.exit(1); });
diff --git a/herocap.cjs b/herocap.cjs
new file mode 100644
index 0000000..241d0f0
--- /dev/null
+++ b/herocap.cjs
@@ -0,0 +1,12 @@
+const { chromium } = require('playwright');
+(async () => {
+ const b = await chromium.launch();
+ const page = await b.newPage({ viewport: { width: 1280, height: 720 } });
+ await page.goto('https://corkwallcovering.com/', { waitUntil:'networkidle', timeout:30000 });
+ await page.waitForTimeout(1500);
+ const livingTexture = await page.locator('text=Living Texture').count().catch(()=>0);
+ const heroImg = await page.evaluate(()=>{ const b=document.getElementById('heroBg'); return b?getComputedStyle(b).backgroundImage:'' ; });
+ console.log('"Living Texture" on page:', livingTexture, '| heroBg image:', heroImg.slice(0,60));
+ await page.screenshot({ path:'/tmp/cork-hero-live.png' });
+ await b.close();
+})().catch(e=>{console.error('ERR',e.message);process.exit(1)});
diff --git a/livetest.cjs b/livetest.cjs
new file mode 100644
index 0000000..bfc1ef6
--- /dev/null
+++ b/livetest.cjs
@@ -0,0 +1,33 @@
+const { chromium, devices } = require('playwright');
+(async () => {
+ const b = await chromium.launch();
+ const ctx = await b.newContext({ ...devices['iPhone 13'] });
+ const page = await ctx.newPage();
+ const errs=[]; page.on('pageerror',e=>errs.push(e.message.slice(0,90)));
+ page.on('console',m=>{if(m.type()==='error'&&!/502|404|Failed to load resource/.test(m.text()))errs.push('C:'+m.text().slice(0,80));});
+ const P=[];
+ const status = (await page.goto('https://corkwallcovering.com/',{waitUntil:'networkidle',timeout:30000})).status();
+ P.push(['page loads 200', status===200]);
+ await page.waitForTimeout(1200);
+ // 1 hero
+ const heroImg = await page.evaluate(()=>{const b=document.getElementById('heroBg');return b?getComputedStyle(b).backgroundImage:''});
+ P.push(['hero = room setting (hero-bg.jpg)', /hero-bg\.jpg/.test(heroImg)]);
+ P.push(['"Living Texture" heading gone', (await page.locator('text=Living Texture').count())===0]);
+ // 2 search scrolls results into view
+ await page.$eval('#searchInput', el=>el.scrollIntoView({block:'center'}));
+ await page.click('#searchInput'); await page.type('#searchInput','cork',{delay:110});
+ await page.waitForTimeout(1600);
+ const vp = await page.evaluate(()=>{const vh=innerHeight;const g=document.getElementById('grid').getBoundingClientRect();const c=document.querySelector('#grid .card, #grid a.card');return{gridTop:Math.round(g.top),vh,inView:c?c.getBoundingClientRect().top<vh&&c.getBoundingClientRect().top> -50:false, stat:(document.getElementById('statLine')||{}).textContent}});
+ P.push(['search results scroll INTO view', vp.inView]);
+ P.push(['search filtered (stat updated)', /matching "cork"/.test(vp.stat||'')]);
+ // 3 tap a result opens detail
+ let opened=false;
+ try{ await page.click('#grid .card, #grid a.card',{timeout:4000}); await page.waitForTimeout(500); await page.click('#grid .card.revealed, #grid a.card.revealed',{timeout:2000}).catch(()=>{}); await page.waitForTimeout(600); opened = await page.isVisible('#dwmDetails,.ns-modal.show,[id*=Detail]').catch(()=>false);}catch(e){}
+ P.push(['tap result opens detail (best-effort)', opened]);
+ console.log('STAT:', vp.stat, '| gridTop', vp.gridTop, '/ vh', vp.vh);
+ console.log('----- RESULTS -----');
+ P.forEach(([n,ok])=>console.log((ok?'✅':'❌'), n));
+ console.log('console/page errors:', errs.length?errs:'NONE');
+ await page.screenshot({path:'/tmp/live-search-test.png'});
+ await b.close();
+})().catch(e=>{console.error('ERR',e.message);process.exit(1)});
← e0d59e0 auto-save: 2026-07-30T08:16:08 (4 files) — cap_mobile.cjs ca
·
back to Nationalrealestate
·
Fix places-seed pickMetro CTE scope bug (r.name->name); unbl 153944d →