Skip to content

refactor: remove text from YextField#1182

Merged
mkilpatrick merged 7 commits intomainfrom
text
Apr 24, 2026
Merged

refactor: remove text from YextField#1182
mkilpatrick merged 7 commits intomainfrom
text

Conversation

@mkilpatrick
Copy link
Copy Markdown
Collaborator

Removes text as a YextField option and replaces all callers to use the Puck text/textarea fieldTypes directly.

@github-actions
Copy link
Copy Markdown
Contributor

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

Walkthrough

This 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 YextField(...) helper wrapper to inline field object definitions for text fields. The YextField helper itself is simplified by removing support for type: "text" configurations. Documentation is updated to demonstrate native field authoring patterns, and tests are adjusted to validate the new approach using YextAutoField directly.

Possibly related PRs

Suggested labels

create-dev-release

Suggested reviewers

  • briantstephan
  • jwartofsky-yext
  • asanehisa
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: remove text from YextField' directly and clearly summarizes the main objective of the changeset: removing text field support from the YextField helper and replacing it with native Puck field definitions across all files.
Description check ✅ Passed The description 'Removes text as a YextField option and replaces all callers to use the Puck text/textarea fieldTypes directly' is directly related to the changeset and accurately describes the core refactoring work performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch text

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 text among standard Puck types "supported" by YextField, while the rest of the doc now directs users to author text/textarea natively inside YextFields. Either add text/textarea to the native-authoring bullet or drop text from 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

📥 Commits

Reviewing files that changed from the base of the PR and between cd397a2 and 71f7412.

📒 Files selected for processing (34)
  • packages/visual-editor/src/components/Locator.tsx
  • packages/visual-editor/src/components/LocatorResultCard.tsx
  • packages/visual-editor/src/components/contentBlocks/CtaWrapper.tsx
  • packages/visual-editor/src/components/contentBlocks/MapboxStaticMap.tsx
  • packages/visual-editor/src/components/customCode/CustomCodeSection.tsx
  • packages/visual-editor/src/components/directory/Directory.tsx
  • packages/visual-editor/src/components/footer/ExpandedFooter.tsx
  • packages/visual-editor/src/components/footer/Footer.tsx
  • packages/visual-editor/src/components/footer/FooterExpandedLinkSectionSlot.tsx
  • packages/visual-editor/src/components/footer/FooterExpandedLinksWrapper.tsx
  • packages/visual-editor/src/components/footer/FooterLinksSlot.tsx
  • packages/visual-editor/src/components/footer/FooterLogoSlot.tsx
  • packages/visual-editor/src/components/footer/FooterSocialLinksSlot.tsx
  • packages/visual-editor/src/components/footer/FooterUtilityImagesSlot.tsx
  • packages/visual-editor/src/components/header/ExpandedHeader.tsx
  • packages/visual-editor/src/components/header/Header.tsx
  • packages/visual-editor/src/components/layoutBlocks/Grid.tsx
  • packages/visual-editor/src/components/pageSections/Breadcrumbs.tsx
  • packages/visual-editor/src/components/pageSections/CoreInfoSection.tsx
  • packages/visual-editor/src/components/pageSections/EventSection/EventSection.tsx
  • packages/visual-editor/src/components/pageSections/FAQsSection/FAQsSection.tsx
  • packages/visual-editor/src/components/pageSections/HeroSection.tsx
  • packages/visual-editor/src/components/pageSections/InsightSection/InsightSection.tsx
  • packages/visual-editor/src/components/pageSections/NearbyLocations/NearbyLocations.tsx
  • packages/visual-editor/src/components/pageSections/ProductSection/ProductSection.tsx
  • packages/visual-editor/src/components/pageSections/ProfessionalHeroSection.tsx
  • packages/visual-editor/src/components/pageSections/PromoSection/PromoSection.tsx
  • packages/visual-editor/src/components/pageSections/ReviewsSection/ReviewsSection.tsx
  • packages/visual-editor/src/components/pageSections/StaticMapSection.tsx
  • packages/visual-editor/src/components/pageSections/TeamSection/TeamSection.tsx
  • packages/visual-editor/src/components/pageSections/TestimonialSection/TestimonialSection.tsx
  • packages/visual-editor/src/editor/README.md
  • packages/visual-editor/src/editor/YextField.test.tsx
  • packages/visual-editor/src/editor/YextField.tsx
💤 Files with no reviewable changes (1)
  • packages/visual-editor/src/editor/YextField.tsx

Comment thread packages/visual-editor/src/editor/YextField.test.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