Skip to content

JS-9749: image loader fixes for chat attachments and editor image block#2211

Merged
ra3orblade merged 1 commit into
developfrom
js-9749-images-loader
May 7, 2026
Merged

JS-9749: image loader fixes for chat attachments and editor image block#2211
ra3orblade merged 1 commit into
developfrom
js-9749-images-loader

Conversation

@requilence

@requilence requilence commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Chat image attachments now show the standard <Loader> while the gateway request is in flight, mirroring the editor image block pattern.
  • Fixes a recently introduced regression in the editor image block (JS-9425) where the wrap collapsed to 0×0 during load on un-resized blocks: display: inline-block + only aspect-ratio (no width) cannot resolve dimensions, so the loader had no area to render in. Now the wrap is reserved with the natural widthInPixels (capped by max-width: 100%) when no user-set width is present.
  • Loader overlay sits centered on a themed light-grey background (--color-shape-highlight-light) with rounded corners while loading, and vanishes the moment onLoad fires.

Retry/reload behavior on failed loads is intentionally out of scope and will land in a separate PR.

Test plan

  • Send an image in chat — loader appears while gateway request is pending, image swaps in cleanly on load.
  • Open a page with a freshly inserted (un-resized) image block — wrap reserves correct aspect-ratio space immediately, loader is centered on the light-grey background, image fills the same box on load with no jump.
  • Open a page with a previously-resized image block — user width is preserved, no regression.
  • Verify in dark mode — loader background uses the dark theme variant (rgba(255,255,255,0.03)).
  • Verify chat multi-image grid layouts (2/3/4/5+ attachments) — loaders render correctly inside each cell.

…lapse

- Chat attachment now shows the standard <Loader> while the gateway
  image is in flight, mirroring the editor image block pattern.
- Editor image block: when widthInPixels/heightInPixels are known but
  the user hasn't resized (no block.fields.width), reserve the wrap
  with the natural pixel width so aspect-ratio can compute height.
  The inline-block wrap was previously collapsing to 0×0 during load
  (introduced by JS-9425), hiding the loader entirely.
- Loader overlay sits centered on a themed light-grey background with
  rounded corners while loading; vanishes on onLoad.
@requilence requilence requested a review from ra3orblade May 7, 2026 11:51
@ra3orblade ra3orblade merged commit 801d568 into develop May 7, 2026
3 checks passed
@ra3orblade ra3orblade deleted the js-9749-images-loader branch May 7, 2026 11:53
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants