feat: add comprehensive CTA#1221
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. |
|
Warning Review limit reached
More reviews will be available in 15 minutes and 30 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR introduces a comprehensive CTA (Call-to-Action) system for the visual editor. It extends the base Sequence Diagram: ComprehensiveCTA Data FlowsequenceDiagram
participant User as Editor User
participant Field as ComprehensiveCTAField
participant Schema1 as YextAutoField (Data)
participant Schema2 as YextAutoField (Styles)
participant Component as ComprehensiveCTA
participant CTA as CTA Atom
User->>Field: open/edit Comprehensive CTA field
Field->>Schema1: render Data schema
Field->>Schema2: render Styles schema
User->>Schema1: modify actionType/customId
Schema1->>Field: onChange updates data subtree
User->>Schema2: change variant/color
Schema2->>Field: onChange updates styles subtree
Field->>Component: pass normalized ComprehensiveCTAValue
Component->>Component: resolveComponentData (localize) & compute styles
Component->>CTA: render with merged props (including style)
CTA->>CTA: spread style prop into Button/Link
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
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/visual-editor/src/fields/styledFields/ComprehensiveCTAField.tsx`:
- Around line 17-39: The data shape declared in ComprehensiveCTAValue is missing
the normalizeLink property that defaultComprehensiveCTAValue includes, causing a
type mismatch; update the ComprehensiveCTAValue.data type to include a
normalizeLink field (with the same type used in
defaultComprehensiveCTAValue.data.normalizeLink) so the declared type matches
the default value (and apply the same addition where else the data type is
declared/used).
🪄 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: c6f27204-a958-48df-bae5-8ac02adfd31a
📒 Files selected for processing (8)
packages/visual-editor/src/components/atoms/cta.tsxpackages/visual-editor/src/components/contentBlocks/ComprehensiveCTA.tsxpackages/visual-editor/src/components/contentBlocks/index.tspackages/visual-editor/src/fields/fieldOverrides.tspackages/visual-editor/src/fields/fields.tspackages/visual-editor/src/fields/styledFields/ComprehensiveCTAField.test.tsxpackages/visual-editor/src/fields/styledFields/ComprehensiveCTAField.tsxpackages/visual-editor/src/fields/styledFields/index.ts
auto-screenshot-update: true
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/visual-editor/locales/platform/nb/visual-editor.json`:
- Line 284: fields.linkStyles currently uses "Koble stiler", which is
inconsistent with the repository’s "Lenke/Lenker" terminology; update the
translation value for fields.linkStyles to use the link-consistent wording (for
example "Lenkestiler" or "Lenke-stiler") so it matches other keys using
"Lenke"/"Lenker" in the same locale file.
🪄 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: 2fd779dd-7099-40e3-8e32-75113fb25a7f
⛔ Files ignored due to path filters (1)
packages/visual-editor/src/components/testing/screenshots/Locator/[tablet] latest version default props.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/atoms/cta.tsxpackages/visual-editor/src/components/contentBlocks/ComprehensiveCTA.tsxpackages/visual-editor/src/fields/styledFields/ComprehensiveCTAField.test.tsx
💤 Files with no reviewable changes (2)
- packages/visual-editor/src/components/contentBlocks/ComprehensiveCTA.tsx
- packages/visual-editor/src/fields/styledFields/ComprehensiveCTAField.test.tsx
✅ Files skipped from review due to trivial changes (19)
- packages/visual-editor/locales/platform/da/visual-editor.json
- packages/visual-editor/locales/platform/en-GB/visual-editor.json
- packages/visual-editor/locales/platform/sv/visual-editor.json
- packages/visual-editor/locales/platform/fi/visual-editor.json
- packages/visual-editor/locales/platform/sk/visual-editor.json
- packages/visual-editor/locales/platform/hr/visual-editor.json
- packages/visual-editor/locales/platform/pl/visual-editor.json
- packages/visual-editor/locales/platform/ja/visual-editor.json
- packages/visual-editor/locales/platform/ro/visual-editor.json
- packages/visual-editor/locales/platform/pt/visual-editor.json
- packages/visual-editor/locales/platform/de/visual-editor.json
- packages/visual-editor/locales/platform/zh-TW/visual-editor.json
- packages/visual-editor/locales/platform/it/visual-editor.json
- packages/visual-editor/locales/platform/nl/visual-editor.json
- packages/visual-editor/locales/platform/en/visual-editor.json
- packages/visual-editor/locales/platform/lv/visual-editor.json
- packages/visual-editor/locales/platform/es/visual-editor.json
- packages/visual-editor/locales/platform/lt/visual-editor.json
- packages/visual-editor/locales/platform/hu/visual-editor.json
Our CTA props, resolution, and rendering are split across many components and slots. This attempts to create a single field type and React component with all the major CTA behavior. This should simplify it for the skill while leaving the existing complex OOTB behavior unaffected.
Screen.Recording.2026-05-26.at.2.47.24.PM.mov