Skip to content

fix: complex fields in local editor - #1301

Open
benlife5 wants to merge 1 commit into
2026-custom-components-templatesfrom
local-editor-types
Open

fix: complex fields in local editor#1301
benlife5 wants to merge 1 commit into
2026-custom-components-templatesfrom
local-editor-types

Conversation

@benlife5

@benlife5 benlife5 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

We assume the types of the entity fields in local data because we do not have the authoritative stream definition. We were over-classifying any object with .image subfield as a Complex Image.

https://yext.slack.com/archives/C0AQSEXMZ3L/p1787940880994969?thread_ts=1787936147.451099&cid=C0AQSEXMZ3L

Tested with a local pack used in the services repo

Will port over to section-library after merge

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5bc156a4-6dfb-4458-8908-f1a9a0142f30

📥 Commits

Reviewing files that changed from the base of the PR and between eb5dbeb and 728ad00.

📒 Files selected for processing (2)
  • packages/visual-editor/src/vite-plugin/local-editor/entityFields.test.ts
  • packages/visual-editor/src/vite-plugin/local-editor/entityFields.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The image detection logic now separates direct images from nested image objects. Nested images are recognized only when an object contains exactly one image key with a direct image value. A regression test verifies that a content object remains an object and that its nested rich text, image, CTA, and title fields receive the expected types and display name.

Merge Risk: ⚪ Minimal · up to 728ad

This change adjusts local editor classification for complex fields and adds focused tests; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing complex field handling in the local editor.
Description check ✅ Passed The description explains the local field-type inference issue, the Complex Image over-classification, testing, and planned follow-up work.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch local-editor-types

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.

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.

1 participant