From 1a35dea7a580cce9ed392e188bacd348a2825f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 30 Nov 2026 16:40:05 -0300 Subject: [PATCH] fix: contract checks of D7 and B9: a small vertical floating video, the whole art in Minha conta, and the home card's play and pause in the browser test Found checking D7/B9 in the browser: the vertical floating player could reach 70% of the screen over the buy box (now 150 px wide, at most 44vh); the saved sheet's picture was cropped. The browser test now checks that a home card plays when on screen and pauses off it (its Chrome decodes no video, so it records the play and pause the page asks for). Co-Authored-By: Claude Opus 5.5 --- tests/artwork_browser_test.mjs | 15 +++++++++++++++ web/portal.css | 2 +- web/site-v2.css | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/artwork_browser_test.mjs b/tests/artwork_browser_test.mjs index 2f6e442..b56a2f1 100644 --- a/tests/artwork_browser_test.mjs +++ b/tests/artwork_browser_test.mjs @@ -128,6 +128,21 @@ try{ await call('Input.dispatchKeyEvent',{type:'keyDown',key:'Escape',code:'Escape',windowsVirtualKeyCode:27}); assert.equal(await evaluate(`document.querySelector('.videoModal').hidden && document.activeElement.classList.contains('videoCard')`),true); + // A home card plays muted and in loop only while it is on screen (Rodada 5, + // D7). Chrome here decodes no video, so the test records what the page asks + // of the card's player: play when it enters the screen, pause when it leaves. + await evaluate(`(()=>{window.cardCalls=[];const P=HTMLMediaElement.prototype; + window.realPlay=P.play;window.realPause=P.pause; + P.play=function(){if(this.closest('.videoCard'))cardCalls.push('play');return Promise.resolve();}; + P.pause=function(){if(this.closest('.videoCard'))cardCalls.push('pause');}; + VIDEOS[0].src='/preview.mp4';videosSection();})()`); + assert.deepEqual(await evaluate(`(()=>{const v=document.querySelector('#videosGrid .videoCard video');return {muted:v.muted,loop:v.loop,inline:v.playsInline};})()`), + {muted:true,loop:true,inline:true}); + await evaluate(`window.scrollTo({top:document.querySelector('#videosGrid .videoCard').getBoundingClientRect().top+scrollY-200,behavior:'instant'})`); + await waitFor(()=>evaluate(`cardCalls.at(-1)==='play'`),'home video card plays on screen'); + await evaluate(`window.scrollTo({top:0,behavior:'instant'})`); + await waitFor(()=>evaluate(`cardCalls.at(-1)==='pause'`),'home video card pauses off screen'); + await evaluate(`HTMLMediaElement.prototype.play=realPlay;HTMLMediaElement.prototype.pause=realPause`); await evaluate(`VIDEOS[0].src=null;videosSection()`); // Observe the actual engine, without replacing its placement or rendering. await evaluate(`(()=>{ diff --git a/web/portal.css b/web/portal.css index 8733a0a..dc366e7 100644 --- a/web/portal.css +++ b/web/portal.css @@ -145,7 +145,7 @@ button:disabled{opacity:.6;cursor:default} .folhas{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px;padding:14px} .folhaCard{display:flex;flex-direction:column;border:1px solid var(--linha);border-radius:var(--raio2);background:#fff;overflow:hidden} .folhaPic{aspect-ratio:4/3;background:var(--cinza);border-bottom:1px solid var(--linha)} -.folhaPic img{display:block;width:100%;height:100%;object-fit:cover} +.folhaPic img{display:block;width:100%;height:100%;object-fit:contain;padding:10px;box-sizing:border-box} .folhaPic .semFoto{width:100%;height:100%;background:repeating-linear-gradient(135deg,var(--cinza),var(--cinza) 10px,#EDEDED 10px,#EDEDED 20px)} .folhaBody{display:flex;flex-direction:column;gap:4px;padding:14px 16px 6px} .folhaNome{font-family:"Inter",sans-serif;font-size:16px;font-weight:800;overflow-wrap:anywhere} diff --git a/web/site-v2.css b/web/site-v2.css index c6f67ed..9c3e2d6 100644 --- a/web/site-v2.css +++ b/web/site-v2.css @@ -73,8 +73,9 @@ section+section{border-top:0} .videoCard[data-soon="1"]:hover{border-color:var(--linha)} .videoFloat{position:fixed;right:max(22px,env(safe-area-inset-right));bottom:max(22px,env(safe-area-inset-bottom));z-index:70;width:min(280px,calc(100vw - 32px));border-radius:14px;overflow:hidden;background:var(--preto);box-shadow:0 14px 40px rgba(3,6,11,.35)} .videoFloat video{display:block;width:100%;height:auto;aspect-ratio:16/9;background:#000} -.videoFloat.vertical{width:min(180px,40vw);max-height:70vh} -.videoFloat.vertical video{aspect-ratio:9/16} +/* Vertical, it stays small: tall enough to read, never over the buy box's button. */ +.videoFloat.vertical{width:min(150px,36vw)} +.videoFloat.vertical video{aspect-ratio:9/16;max-height:44vh;object-fit:contain} .videoFloat .vfActions{position:absolute;top:8px;right:8px;display:flex;gap:8px} .videoFloat .vfActions button{width:44px;height:44px;padding:0;border:0;border-radius:999px;background:rgba(0,0,0,.62);color:#fff;font-size:20px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center} .videoFloat .vfActions button:focus-visible{outline:3px solid var(--laranja);outline-offset:2px}