Skip to content

fix: add Gallery from gravity-ui, custom hook useGalleryOpen#653

Open
HelenVirtanen wants to merge 1 commit into
masterfrom
fix-gallery-img-video
Open

fix: add Gallery from gravity-ui, custom hook useGalleryOpen#653
HelenVirtanen wants to merge 1 commit into
masterfrom
fix-gallery-img-video

Conversation

@HelenVirtanen

Copy link
Copy Markdown
Contributor

Description

  • Added Gallery and GalleryCore components as a lightweight integration layer around @gravity-ui/components GalleryProvider.
  • Implemented a custom hook useGalleryOpen with global event delegation. This enables users to click on any image or embedded video hosting player (within the .dc-doc-page__main container) to open it in a rich full-screen slider modal with thumbnail navigation and link-sharing capabilities.
  • Added native support for embedded iframe video players inside the gallery by utilizing the interactive mode and custom view rendering to bypass native video tag constraints.
  • Filtered out service graphics, system icons, and contributor avatars (.dc-contributor-avatars__avatar) to ensure only core documentation media is aggregated.

@HelenVirtanen HelenVirtanen requested review from a team and diplodoc-bot as code owners June 15, 2026 15:59
@HelenVirtanen HelenVirtanen requested review from reazy015 and stenin-nikita and removed request for a team June 15, 2026 15:59
@yc-ui-bot

Copy link
Copy Markdown
Contributor

Visual Tests Report is ready.

@HelenVirtanen HelenVirtanen force-pushed the fix-gallery-img-video branch from c51ac14 to 3648832 Compare June 15, 2026 16:39
iframeEl: HTMLIFrameElement | null;
};

export function getGalleryItemVideo({index, iframeEl}: GetGalleryItemVideoArgs): GalleryItemProps {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks more like a hook than a simple utility function.

BTW all hooks should be placed in separate dir - hooks

Comment thread src/components/Gallery/useGalleryOpen.tsx
Comment thread src/components/Gallery/useGalleryOpen.tsx
Comment thread src/components/Gallery/useGalleryOpen.tsx
Comment thread src/components/Gallery/getGalleryItemVideo.tsx
Comment thread src/components/Gallery/Gallery.scss
Comment thread src/components/Gallery/useGalleryOpen.tsx
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.

3 participants