feat: additional style options for Photo Gallery#1136
Conversation
|
Warning: Component files have been updated but no migrations have been added. See https://github.com/yext/visual-editor/blob/main/packages/visual-editor/src/components/migrations/README.md for more information. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughAdds an image fill type option across PhotoGallery components. Many locale files gain Sequence Diagram(s)sequenceDiagram
participant PhotoGallerySection
participant PhotoGalleryWrapper
participant Carousel
participant ImageItem
participant Image
PhotoGallerySection->>PhotoGalleryWrapper: pass styles.imageFillType (default "fill")
PhotoGalleryWrapper->>Carousel: pass imageFillType
Carousel->>ImageItem: pass imageFillType
ImageItem->>Image: apply style.objectFit based on imageFillType
alt imageFillType == "fit"
Image->>Image: objectFit = "contain"
else imageFillType == "fill"
Image->>Image: objectFit = "cover"
end
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGalleryWrapper.tsx (1)
61-61: Consider extracting a sharedImageFillTypealias.
"fill" | "fit"is repeated across multiple signatures; a single local type alias would reduce drift.Also applies to: 233-234, 274-275, 310-311, 397-397
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGalleryWrapper.tsx` at line 61, Extract a single type alias ImageFillType = "fill" | "fit" at the top of the file and replace every inline union occurrence (e.g., the imageFillType?: "fill" | "fit" prop in PhotoGalleryWrapper and the other repeated signatures) with this alias; update all component prop types and function signatures in this file to reference ImageFillType to avoid duplication and keep types consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/visual-editor/locales/platform/cs/visual-editor.json`:
- Line 346: The label for the "fill" key uses the infinitive "Vyplnit"; change
its value to an imperative Czech form to match the project's style (e.g.,
replace the value for the "fill" key from "Vyplnit" to an imperative like
"Naplňte" or another context-appropriate imperative phrase) so the translation
aligns with other imperative labels.
In `@packages/visual-editor/locales/platform/et/visual-editor.json`:
- Line 348: The "fit" translation key currently uses a descriptive form
("Sobivad"); change its value to the correct Estonian imperative form—replace
"Sobivad" with "sobi" for singular imperative or "sobige" for plural/formal
imperative to match other imperative labels (key: "fit"). Ensure the chosen form
is consistent with the UI context and other entries like "fill": "Täida".
---
Nitpick comments:
In
`@packages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGalleryWrapper.tsx`:
- Line 61: Extract a single type alias ImageFillType = "fill" | "fit" at the top
of the file and replace every inline union occurrence (e.g., the imageFillType?:
"fill" | "fit" prop in PhotoGalleryWrapper and the other repeated signatures)
with this alias; update all component prop types and function signatures in this
file to reference ImageFillType to avoid duplication and keep types consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 06d1ea9b-64cb-4ca0-8b8f-7f1cabb18f7c
⛔ Files ignored due to path filters (3)
packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[desktop] version 71 carousel variant with imageFillType fit and vertical image.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[mobile] version 71 carousel variant with imageFillType fit and vertical image.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**packages/visual-editor/src/components/testing/screenshots/PhotoGallerySection/[tablet] version 71 carousel variant with imageFillType fit and vertical image.pngis excluded by!**/*.png,!packages/visual-editor/src/components/testing/screenshots/**
📒 Files selected for processing (28)
packages/visual-editor/locales/platform/cs/visual-editor.jsonpackages/visual-editor/locales/platform/da/visual-editor.jsonpackages/visual-editor/locales/platform/de/visual-editor.jsonpackages/visual-editor/locales/platform/en-GB/visual-editor.jsonpackages/visual-editor/locales/platform/en/visual-editor.jsonpackages/visual-editor/locales/platform/es/visual-editor.jsonpackages/visual-editor/locales/platform/et/visual-editor.jsonpackages/visual-editor/locales/platform/fi/visual-editor.jsonpackages/visual-editor/locales/platform/fr/visual-editor.jsonpackages/visual-editor/locales/platform/hr/visual-editor.jsonpackages/visual-editor/locales/platform/hu/visual-editor.jsonpackages/visual-editor/locales/platform/it/visual-editor.jsonpackages/visual-editor/locales/platform/ja/visual-editor.jsonpackages/visual-editor/locales/platform/lt/visual-editor.jsonpackages/visual-editor/locales/platform/lv/visual-editor.jsonpackages/visual-editor/locales/platform/nb/visual-editor.jsonpackages/visual-editor/locales/platform/nl/visual-editor.jsonpackages/visual-editor/locales/platform/pl/visual-editor.jsonpackages/visual-editor/locales/platform/pt/visual-editor.jsonpackages/visual-editor/locales/platform/ro/visual-editor.jsonpackages/visual-editor/locales/platform/sk/visual-editor.jsonpackages/visual-editor/locales/platform/sv/visual-editor.jsonpackages/visual-editor/locales/platform/tr/visual-editor.jsonpackages/visual-editor/locales/platform/zh-TW/visual-editor.jsonpackages/visual-editor/locales/platform/zh/visual-editor.jsonpackages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGallerySection.test.tsxpackages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGallerySection.tsxpackages/visual-editor/src/components/pageSections/PhotoGallerySection/PhotoGalleryWrapper.tsx
jwartofsky-yext
left a comment
There was a problem hiding this comment.
nitpicks, but otherwise lgtm!
Oh I'll add people as reviewers when it is ready for review! I just set it to ready so CodeRabbit takes a look |
This is to support vertical images used among horizontal images.
Screen.Recording.2026-04-01.at.1.41.45.PM.mov
https://yext.slack.com/archives/C0A1G447MPD/p1774983039261999