refactor: remove text from YextField#1182
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 pull request systematically refactors field schema definitions across 30+ component files in the visual-editor package. The primary change converts field definitions from using the Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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: 1
🧹 Nitpick comments (1)
packages/visual-editor/src/editor/README.md (1)
253-255: Consider updating the Features bullets to reflect native text authoring.The Features section still lists
textamong standard Puck types "supported" byYextField, while the rest of the doc now directs users to authortext/textareanatively insideYextFields. Either addtext/textareato the native-authoring bullet or droptextfrom the YextField-supported list to keep the guidance consistent.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/visual-editor/src/editor/README.md` around lines 253 - 255, The Features bullets are inconsistent about where `text`/`textarea` should be authored; update the README so the guidance is consistent: either add "text/textarea can be authored natively inside YextFields" to the native-authoring bullet or remove `text` from the "supported by YextField" list. Locate the Features section mentioning `YextField`/`YextFields` and modify the bullets that reference standard Puck types (`text`, `array`, `object`) and the native Puck fields bullet so both clearly state that `text`/`textarea` are authored natively within YextFields (or alternatively remove `text` from the YextField-supported list), ensuring the two bullets do not contradict each other.
🤖 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/src/editor/YextField.test.tsx`:
- Line 100: The test uses expect(document.querySelector(...)).toBeDefined(),
which doesn't fail when the element is missing; replace those assertions with a
real presence check such as
expect(document.querySelector('input[type="text"]')).not.toBeNull() or,
preferably, use jest-dom's matcher
expect(getByDisplayValue(...)).toBeInTheDocument() (or
screen.getByRole/getByLabelText + toBeInTheDocument()) to verify the
input/textarea actually rendered; update the assertions referencing
document.querySelector and toBeDefined to one of these patterns (also apply the
same change for the other occurrence).
---
Nitpick comments:
In `@packages/visual-editor/src/editor/README.md`:
- Around line 253-255: The Features bullets are inconsistent about where
`text`/`textarea` should be authored; update the README so the guidance is
consistent: either add "text/textarea can be authored natively inside
YextFields" to the native-authoring bullet or remove `text` from the "supported
by YextField" list. Locate the Features section mentioning
`YextField`/`YextFields` and modify the bullets that reference standard Puck
types (`text`, `array`, `object`) and the native Puck fields bullet so both
clearly state that `text`/`textarea` are authored natively within YextFields (or
alternatively remove `text` from the YextField-supported list), ensuring the two
bullets do not contradict each other.
🪄 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: c911539f-39c2-43dd-b232-c04e86633c32
📒 Files selected for processing (34)
packages/visual-editor/src/components/Locator.tsxpackages/visual-editor/src/components/LocatorResultCard.tsxpackages/visual-editor/src/components/contentBlocks/CtaWrapper.tsxpackages/visual-editor/src/components/contentBlocks/MapboxStaticMap.tsxpackages/visual-editor/src/components/customCode/CustomCodeSection.tsxpackages/visual-editor/src/components/directory/Directory.tsxpackages/visual-editor/src/components/footer/ExpandedFooter.tsxpackages/visual-editor/src/components/footer/Footer.tsxpackages/visual-editor/src/components/footer/FooterExpandedLinkSectionSlot.tsxpackages/visual-editor/src/components/footer/FooterExpandedLinksWrapper.tsxpackages/visual-editor/src/components/footer/FooterLinksSlot.tsxpackages/visual-editor/src/components/footer/FooterLogoSlot.tsxpackages/visual-editor/src/components/footer/FooterSocialLinksSlot.tsxpackages/visual-editor/src/components/footer/FooterUtilityImagesSlot.tsxpackages/visual-editor/src/components/header/ExpandedHeader.tsxpackages/visual-editor/src/components/header/Header.tsxpackages/visual-editor/src/components/layoutBlocks/Grid.tsxpackages/visual-editor/src/components/pageSections/Breadcrumbs.tsxpackages/visual-editor/src/components/pageSections/CoreInfoSection.tsxpackages/visual-editor/src/components/pageSections/EventSection/EventSection.tsxpackages/visual-editor/src/components/pageSections/FAQsSection/FAQsSection.tsxpackages/visual-editor/src/components/pageSections/HeroSection.tsxpackages/visual-editor/src/components/pageSections/InsightSection/InsightSection.tsxpackages/visual-editor/src/components/pageSections/NearbyLocations/NearbyLocations.tsxpackages/visual-editor/src/components/pageSections/ProductSection/ProductSection.tsxpackages/visual-editor/src/components/pageSections/ProfessionalHeroSection.tsxpackages/visual-editor/src/components/pageSections/PromoSection/PromoSection.tsxpackages/visual-editor/src/components/pageSections/ReviewsSection/ReviewsSection.tsxpackages/visual-editor/src/components/pageSections/StaticMapSection.tsxpackages/visual-editor/src/components/pageSections/TeamSection/TeamSection.tsxpackages/visual-editor/src/components/pageSections/TestimonialSection/TestimonialSection.tsxpackages/visual-editor/src/editor/README.mdpackages/visual-editor/src/editor/YextField.test.tsxpackages/visual-editor/src/editor/YextField.tsx
💤 Files with no reviewable changes (1)
- packages/visual-editor/src/editor/YextField.tsx
auto-screenshot-update: true
Removes text as a YextField option and replaces all callers to use the Puck text/textarea fieldTypes directly.