Skip to content

fix(detail): stop switch/load flicker — pin image height, letterbox blur, keep tone panel (on top of #535) - #536

Merged
Zheaoli merged 1 commit into
mainfrom
fix/detail-flicker-on-535
Jun 12, 2026
Merged

fix(detail): stop switch/load flicker — pin image height, letterbox blur, keep tone panel (on top of #535)#536
Zheaoli merged 1 commit into
mainfrom
fix/detail-flicker-on-535

Conversation

@Zheaoli

@Zheaoli Zheaoli commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Rebuilt on top of #535 (which removed the preview fade animation). #535 alone didn't fix the dominant detail-view flicker because it kept object-contain md:max-h-[90vh] and didn't touch the info panel. This adds the remaining verified fixes (supersedes #534, which was based on pre-#535 main and conflicted):

  1. Image height pinned<img> (preview + high-res) md:max-h-[90vh]object-contain w-full sm:h-full, and the ProgressiveImage root wrapper relativerelative sm:h-full so the height:100% chain resolves (container sm:h-[90vh] → viewport → slide → wrapper → img). The img element stays a constant 90vh for every aspect instead of resizing ~607↔1366px and overflowing on each switch. Verified live: injecting the wrapper height made the slide img go 607 → 810px.

  2. Blur placeholder letterboxedstyle={{ objectFit: 'contain' }} on the preview image. next/image derives the blur's background-size from style.objectFit (get-img-props.js: backgroundSize = imgStyle.objectFit), not the className — without it the blur filled the fixed box via cover while the real image letterboxed smaller = a load flash (worst for portraits). Confirmed live (was background-size: cover).

  3. Tone analysis kept on switchif (loading)if (loading && !toneData). It returned a spinner unconditionally, so each switch collapsed the tone section and shifted the whole info panel's layout (rows below jumped up/back) = "info panel flashes on switch". Mirrors the histogram guard from fix(detail): stop the switch + zoom-load flicker #532, which was never applied to tone analysis.

Not touched / not regressed

Verification plan

Deploy this branch HEAD → I confirm deployed == HEAD on live (img constant 810 across aspects + tone doesn't collapse on switch) → Manjusaka real-device verifies switch + load → Impl walks the height chain + measures the panel on switch.

…letterbox blur, keep tone panel)

Rebuilt on top of #535 (which removed the preview fade animation). #535 alone
did not fix the dominant flicker because it kept `object-contain md:max-h-[90vh]`
and didn't touch the info panel. This adds the remaining, verified fixes:

- Image height: `<img>` (preview + high-res) `md:max-h-[90vh]` →
  `object-contain w-full sm:h-full`, and the ProgressiveImage root wrapper
  `relative` → `relative sm:h-full` so the height:100% chain resolves
  (container sm:h-[90vh] → viewport → slide → wrapper → img). The img element
  then stays a constant 90vh for every aspect ratio instead of resizing
  ~607↔1366px and overflowing on each switch. Verified live: injecting the
  wrapper height made the slide img go 607→810px.

- Blur placeholder: `style={{ objectFit: 'contain' }}` on the preview image so
  next/image renders the blur with `background-size: contain` (it reads
  style.objectFit, not the className) — otherwise the blur filled the fixed box
  via `cover` and the real image shrank to letterbox on load = a load flash.

- Tone analysis panel: `if (loading)` → `if (loading && !toneData)` so a switch
  keeps the previous tone values rendered instead of collapsing to a spinner and
  shifting the whole info panel's layout. Mirrors the histogram guard from #532
  (which was never applied to tone analysis).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
picimpact Ready Ready Preview, Comment Jun 12, 2026 2:20pm

@Zheaoli
Zheaoli merged commit 9576fd6 into main Jun 12, 2026
6 checks passed
@Zheaoli
Zheaoli deleted the fix/detail-flicker-on-535 branch June 12, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant