From 9d6ceae4f1b70a5aac53e6be64dc84495aa85675 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Wed, 18 Mar 2026 19:36:22 +0300 Subject: [PATCH] fix(web-test): showImage scaling and full preset improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use min-width/min-height 50% to upscale small images (was showing tiny 225px images at native size instead of scaling up) - Keep max-width/max-height 92% for large images (no regression) - Change full preset from cover to contain — no content cropping, black bars instead of cutting off edges Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/skills/web-test/scripts/browser.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/skills/web-test/scripts/browser.mjs b/.claude/skills/web-test/scripts/browser.mjs index 5f58a2a8..be714a78 100644 --- a/.claude/skills/web-test/scripts/browser.mjs +++ b/.claude/skills/web-test/scripts/browser.mjs @@ -4253,7 +4253,7 @@ export async function showImage(imagePath, opts = {}) { blur: { bg: '#222', fit: 'contain', shadow: true, blur: true }, dark: { bg: '#2a2a2a', fit: 'contain', shadow: true, blur: false }, light: { bg: '#ffffff', fit: 'contain', shadow: true, blur: false }, - full: { bg: '#000', fit: 'cover', shadow: false, blur: false }, + full: { bg: '#000', fit: 'contain', shadow: false, blur: false }, }; const preset = presets[style] || presets.blur; @@ -4316,7 +4316,7 @@ export async function showImage(imagePath, opts = {}) { const shadowCss = shadow ? 'box-shadow:0 4px 40px rgba(0,0,0,0.5);' : ''; const sizeCss = isFull ? `width:100%;height:100%;object-fit:${fit};` - : `max-width:${maxSize};max-height:${maxSize};object-fit:${fit};`; + : `max-width:${maxSize};max-height:${maxSize};min-width:50%;min-height:50%;object-fit:${fit};`; html += ``; div.innerHTML = html;