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
Some checks failed
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Failing after 7m50s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Has been skipped

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 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-30 16:40:05 -03:00
parent 07e56eaa7c
commit 1a35dea7a5
3 changed files with 19 additions and 3 deletions

View File

@@ -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(`(()=>{

View File

@@ -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}

View File

@@ -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}