Skip to content

[DCUBESDQLR-2356] Add custom content slot to FullscreenImageCarousel#1098

Merged
qroll merged 11 commits intomasterfrom
fullscreen-carousel-custom-content
Apr 17, 2026
Merged

[DCUBESDQLR-2356] Add custom content slot to FullscreenImageCarousel#1098
qroll merged 11 commits intomasterfrom
fullscreen-carousel-custom-content

Conversation

@mparramont
Copy link
Copy Markdown
Contributor

@mparramont mparramont commented Apr 15, 2026

(Draft pending desk check)

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing apis or functionality to change)

Description of changes

  • Link to ticket
  • Link to Figma (pending)
  • This change is so that we can support rendering PDFs with preview in the carousel
  • New renderContent per-item prop: when provided, the consumer owns the entire slide content (e.g. iframe, PDF viewer, embed)
  • New itemLabel per-item prop for accessible aria-label overrides (e.g. "PDF" → "Delete PDF")
  • When any item sets itemLabel, carousel-level aria-labels switch to generic wording ("Carousel", "Previous item", etc.)
  • Magnifier/zoom controls auto-hidden for custom content slides
  • Thumbnail strip falls back to a placeholder when custom item has no src/thumbnailSrc

Checklist

  • Changes follow the project guidelines in CONTRIBUTING.md and CONVENTIONS.md
  • Looks good on mobile and tablet
  • Updated documentation
  • Added/updated tests

Screenshots

Video showing a custom item (PDF) rendering a preview of the PDF, and another custom item with no thumbnailSrc, which shows the placeholder:

Screen.Recording.2026-04-15.at.3.55.55.PM.mov

…arousel

- Add discriminated union FullscreenCarouselItemProps (ImageCarouselItemProps | CustomCarouselItemProps)
- Add renderContent per-item render prop for custom slide content
- Add itemLabel per-item prop for accessible aria-label overrides
- Hide magnifier button for custom content slides
- Fall back to SlidePlaceholderImage in thumbnail strip when no src available
- Update carousel-level aria-labels to generic wording when any item uses itemLabel
…slot

- Add WithCustomContent story with PDF iframe and pdf-icon thumbnail
- Update props-table with renderContent and itemLabel docs
- Add tests for renderContent, itemLabel aria-labels, magnifier hide, thumbnail placeholder
- Remove fileName/fileSize from this branch (belongs to file-info-bar branch)
- Add pdf-icon.svg asset from sgw-dl
- Custom items only need thumbnailSrc for the thumbnail strip
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for per-slide custom rendering in FullscreenImageCarousel, enabling non-image slides (e.g. iframes/PDF viewers) while updating accessibility labeling, thumbnails, docs, and tests to support mixed item types.

Changes:

  • Introduces a discriminated union for carousel items (ImageCarouselItemProps | CustomCarouselItemProps) with a new renderContent render-prop and itemLabel.
  • Updates carousel rendering to support custom slides, hide zoom controls for them, and show thumbnail placeholders when needed.
  • Adds Storybook docs/story coverage plus unit tests for custom content and updated aria-label behaviors.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/fullscreen-image-carousel/fullscreen-image-carousel.tsx Implements custom-slide rendering, generic aria-label mode, magnifier hiding, and thumbnail placeholder behavior.
src/fullscreen-image-carousel/types.ts Updates the public item props type to a union and adds renderContent/itemLabel.
tests/fullscreen-image-carousel/fullscreen-image-carousel.spec.tsx Adds tests for custom content rendering, magnifier visibility, thumbnail placeholder, and aria-label wording.
stories/fullscreen-image-carousel/fullscreen-image-carousel.stories.tsx Adds a “WithCustomContent” example using iframe/PDF content and a custom thumbnail.
stories/fullscreen-image-carousel/fullscreen-image-carousel.mdx Documents the new custom content capability and itemLabel impact on aria-labels.
stories/fullscreen-image-carousel/props-table.tsx Documents new item props and updated union semantics in the props table.
public/img/pdf-icon.svg Adds a PDF thumbnail icon used by the Storybook example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx Outdated
Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx Outdated
Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx
Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx Outdated
Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx Outdated
Comment thread src/fullscreen-image-carousel/types.ts Outdated
- fix leading punctuation in aria-labels when alt/itemLabel is empty
- lazy-render custom content only for active and adjacent slides
- trim empty itemLabel in delete button aria-label
- rename hasCustomItemLabel to hasAnyItemLabel
- keep FullscreenCarouselItemProps as base interface for backward compat
@mparramont mparramont force-pushed the fullscreen-carousel-custom-content branch from 193cfa8 to d90b3cb Compare April 15, 2026 09:18
@mparramont mparramont requested a review from Copilot April 15, 2026 09:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx
Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx Outdated
Comment thread src/fullscreen-image-carousel/types.ts Outdated
Copilot stopped work on behalf of mparramont due to an error April 15, 2026 09:43
Comment thread stories/fullscreen-image-carousel/fullscreen-image-carousel.stories.tsx Outdated
Comment thread src/fullscreen-image-carousel/fullscreen-image-carousel.tsx Outdated
Comment thread stories/fullscreen-image-carousel/fullscreen-image-carousel.stories.tsx Outdated
Comment thread stories/fullscreen-image-carousel/fullscreen-image-carousel.mdx Outdated
Comment thread src/fullscreen-image-carousel/types.ts Outdated
Comment thread src/fullscreen-image-carousel/types.ts
Comment thread tests/fullscreen-image-carousel/fullscreen-image-carousel.spec.tsx Outdated
Comment thread tests/fullscreen-image-carousel/fullscreen-image-carousel.spec.tsx Outdated
@qroll qroll added the type: enhancement New feature or request label Apr 15, 2026
- rename types: CarouselItemProps -> FullscreenImageCarouselItemProps, CustomCarouselItemProps -> FullscreenImageCarouselCustomItemProps
- deprecate FullscreenCarouselItemProps in favour of FullscreenCarouselImageItemProps
- add type discriminants (type?: "image" | type: "custom")
- rename isAdjacent to isActiveOrAdjacent
- update story: remove first image item, fix thumbnail URL
- update mdx docs wording for itemLabel
- fix test name, add src fallback thumbnail test
- update props-table with new type names and type field
@mparramont mparramont requested a review from qroll April 16, 2026 10:02
@mparramont
Copy link
Copy Markdown
Contributor Author

@qroll all comments addressed, can you re-review please? 🙇

@qroll qroll added this to the v3.4.0-canary.1 milestone Apr 16, 2026
qroll
qroll previously approved these changes Apr 16, 2026
Copy link
Copy Markdown
Contributor

@qroll qroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated some documentation and renamed FullscreenImageCarouselImageItemProps (my bad, typo in the original comment)

@qroll
Copy link
Copy Markdown
Contributor

qroll commented Apr 16, 2026

the svg file is currently MIA, I'll check in with the dev. it should have been uploaded to our static assets folder as part of this PR

@qroll qroll merged commit bcd67f7 into master Apr 17, 2026
1 check failed
@qroll qroll deleted the fullscreen-carousel-custom-content branch April 17, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants