Skip to content

fix(item-catalog): prevent first-open layout flash by reserving tile min-height#425

Open
ActiveInAI wants to merge 1 commit into
pascalorg:mainfrom
ActiveInAI:contrib/item-catalog-loading-flash
Open

fix(item-catalog): prevent first-open layout flash by reserving tile min-height#425
ActiveInAI wants to merge 1 commit into
pascalorg:mainfrom
ActiveInAI:contrib/item-catalog-loading-flash

Conversation

@ActiveInAI

Copy link
Copy Markdown

What

Reserve a min-height on the item-catalog tile's square thumbnail wrapper so tiles keep a stable footprint from the first paint.

Why

On the first open of the item catalog, the auto-fill, minmax(90px, 1fr) grid has no resolved column width for a frame and the <img loading="eager"> thumbnails haven't decoded yet, so the aspect-square wrappers collapse to near‑zero height. The labels then stack into a cramped two‑row text layout that visibly reflows into the normal grid once the images arrive (a brief FOUC). Subsequent opens look fine because the images are cached.

Fix

Add min-h-[90px] (matching the column min) to the thumbnail wrapper in item-catalog.tsx. Each tile now reserves its footprint before images load, so the grid renders in its final shape immediately. No change to the steady state once thumbnails are loaded.

Notes

Single-line change. Verified on the standalone editor (apps/editor, dev) — the first-open flash is gone and the loaded grid is unchanged.

…ut flash

On first open of the item catalog, grid tiles briefly collapse before
their thumbnails load (the auto-fill columns have no resolved width yet),
so labels stack into a cramped two-row text layout that reflows once
images arrive. Reserving a min-height on the square thumbnail wrapper
keeps each tile's footprint stable from the first paint, eliminating the
flash. No visual change once images are loaded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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