-
Notifications
You must be signed in to change notification settings - Fork 0
fix: footer logo empty state and body font family for banner and hours table #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
WalkthroughThis PR updates styling in multiple visual-editor components and restructures localized text data. Changes include: adding a font-family utility class to hoursStatus styling, replacing a div wrapper with a Body component in HoursTable, adding a fixed width class to FooterLogoSlot's placeholder div, importing and using getDefaultRTF for Banner default text, and converting plain string localized values in defaultLayoutData to structured objects with json and html representations. No modifications to logic or control flow—only presentation elements and data shape are affected. Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/visual-editor/src/components/footer/FooterLogoSlot.tsx (1)
38-40: Good fix for the empty state visibility.Adding
w-[100px]prevents the placeholder from collapsing to zero width in editing mode.Note: The width is hardcoded to 100px. If you want the placeholder to reflect the user-configured width, consider using
styles.widthdynamically (with a fallback for thewidth: 0default case).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/visual-editor/src/components/atoms/hoursStatus.tsx(1 hunks)packages/visual-editor/src/components/contentBlocks/HoursTable.tsx(2 hunks)packages/visual-editor/src/components/footer/FooterLogoSlot.tsx(1 hunks)packages/visual-editor/src/components/pageSections/Banner.tsx(2 hunks)packages/visual-editor/src/vite-plugin/defaultLayoutData.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/visual-editor/src/components/pageSections/Banner.tsx (1)
packages/visual-editor/src/editor/TranslatableRichTextField.tsx (1)
getDefaultRTF(98-103)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: call_unit_test / unit_tests (18.x)
- GitHub Check: call_unit_test / unit_tests (20.x)
- GitHub Check: semgrep/ci
🔇 Additional comments (7)
packages/visual-editor/src/components/pageSections/Banner.tsx (2)
15-15: LGTM!The
getDefaultRTFimport is correctly added to support the new RTF default value structure.
224-241: Good fix for RTF default value.Using
getDefaultRTFensures the default banner text has the proper{ json, html }structure required by RTF components, enabling correct body theme application. This is consistent with the structured localization pattern used indefaultLayoutData.ts.packages/visual-editor/src/components/atoms/hoursStatus.tsx (1)
37-40: LGTM!Adding
font-body-fontFamilycompletes the body theme styling, ensuring the hours status text uses the configured body font family consistent with the existingfont-body-fontWeightandtext-body-lg-fontSizeutilities.packages/visual-editor/src/components/contentBlocks/HoursTable.tsx (2)
14-14: LGTM!The
Bodyimport is correctly added to support wrappingadditionalHoursText.
131-140: Good fix for body theme application.Wrapping
additionalHoursTextin theBodycomponent ensures the text inherits the body theme styling (font family, weight, etc.), consistent with the PR objective.packages/visual-editor/src/vite-plugin/defaultLayoutData.ts (2)
275-281: LGTM!The BannerSection default text is correctly updated to the structured RTF format with
jsonandhtmlrepresentations, ensuring proper body theme application. This matches the output ofgetDefaultRTFused inBanner.tsx.
653-659: Consistent RTF structure applied throughout.The structured RTF format with
jsonandhtmlrepresentations is correctly applied to all rich text fields across PromoSection, ProductCard, FAQSlot, InsightCard, and EventCard components. This ensures body theme styling is consistently applied to all default content.
...sting/screenshots/HeroSection/[desktop] [classic] version 17 props using constant values.png
Show resolved
Hide resolved
asanehisa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm I wonder if i we should adjust our test theme config so it is more obvious when things aren't applied correctly hmmm
|
hmm yeah. One idea would be to add a test case for the full default layout and apply multiple themes to it. Might be a flaky mess though haha |
The default value for the Banner was plain text even though it is an RTF component so the body theme wasn't being applied
Additional hours text was missing the body theme
The footer logo empty state was being rendered with 0 width