Skip to content

Render the attachment carousel with a private headless carousel package instead of react-film - #5968

Closed
Eugene (OEvgeny) wants to merge 4 commits into
mainfrom
OEvgeny/fix-carousel-without-react-film
Closed

Eugene (OEvgeny) wants to merge 4 commits into
mainfrom
OEvgeny/fix-carousel-without-react-film

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stage 1 of 3 of moving Web Chat off react-film, related to #5552.

Changelog Entry

Changed

  • attachment carousel no longer uses react-film, related to #5552, in PR #5968, by @OEvgeny

Description

react-film imports render from react-dom, adds ~14 KB gzip and its own emotion instance, and misses resizes. A private headless carousel package (1.8 KB gzip) now drives the attachment carousel; stage 2 moves suggested actions, stage 3 removes react-film.

Design

Defaults taken, each a question for review:

  • Private package component-carousel inlined into component, not code in component/src?
  • Keep react-film__* class names, unstyled and deprecated?
  • Re-center via CSS scroll-snap-type: x proximity, not mandatory or JS?
  • RTL flippers in logical order (Tab reaches "Previous" first)?

Specific Changes

  • Review by commit: 1 converts CarouselFilmStrip to TSX only, 2 adds the package, 3 swaps react-film
  • component-carousel: CarouselComposer, 5 hooks, specs for the scroll math
  • CarouselLayout, CarouselFlipper, CarouselFilmStrip (to TSX): same looks, existing snapshots unchanged, old class names kept
  • Tests and helpers use the new class names
  • flipperButton.resize.html: snapshots 1–3, flippers appear after narrowing
  • autoCenter.html: snapshot 1, snapping centers card 2 after a wheel scroll
  • flipperButton.tabOrder(.rtl).html: snapshots 1–4, card, button, "Previous", "Next"
  • I have added tests and executed them locally
  • I have added .changelog/<PR#>-<slug>.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov added 4 commits October 22, 2026 16:34
Props are validated with valibot in development builds instead of
PropTypes, the activity is narrowed by type before reading message fields,
and the component is memoized. No change in rendering.
@msinternal/botframework-webchat-component-carousel tracks a horizontally
scrolling element and its items (overflow, edges, scrolling flag) and
scrolls item by item, in LTR and RTL. It has no markup and no styles and
will replace react-film in Web Chat.
The carousel uses the new headless carousel package and renders its own
flippers (CarouselFlipper). Auto-center after a manual scroll becomes CSS
scroll snapping (proximity). Flippers now appear after a resize without
hovering, and are in logical order (previous, next) in RTL.

The react-film__* class names are still emitted on the same elements,
without styles. Tests and test helpers use the new class names.
@OEvgeny

Copy link
Copy Markdown
Collaborator Author

Doesn't seem wild, I'll continue on top of this branch.

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