feat(cms): add schema for Text component#189
Conversation
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a new CMS Text component and integrates it into relevant dynamic zones and GraphQL types, including schema, inputs, enums, and unions; also augments I18NLocale with additional metadata fields. (48 words) Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/cms/schema.graphql`:
- Line 442: You added ComponentSectionsText to the ExperienceSectionsDynamicZone
union but web consumers don't handle it: update the sections renderer (the
exhaustive switch in the component that handles ExperienceSectionsDynamicZone,
e.g., the function in ComponentSections index that switches on
component.__typename) to add a ComponentSectionsText case that renders the text
section, and update the content fetcher (the GraphQL fragments in the function
that builds the page content, e.g., the code that assembles "... on" fragments)
to include a ... on ComponentSectionsText fragment so the text fields are
requested; ensure the new case returns the same prop shape the fragment provides
and include it in the switch's type exhaustiveness checks.
In `@apps/cms/src/components/sections/text.json`:
- Around line 10-27: The Text schema is missing an explicit heading-level field;
add a new property (e.g., "headingLevel") to the schema as an optional
enumeration of heading tags ("h1" through "h6") so components can render
semantic headings; place it alongside "heading" and "variant", mark it required:
false (or provide a sensible default) and update any consumers of "heading"
(renderers using the "heading" property) to read "headingLevel" when deciding
which HTML heading tag to render.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b7318a8e-4d9d-4471-9089-ef7f827ad35e
📒 Files selected for processing (5)
apps/cms/schema.graphqlapps/cms/src/api/experience/content-types/experience/schema.jsonapps/cms/src/components/sections/container-slot.jsonapps/cms/src/components/sections/text.jsonpackages/graphql/src/graphql-env.d.ts
Review feedback addressed (5da3f0d)Fixed:
Not changed:
|
Resolves #144
Summary
Add Text section component schema with heading, subtitle, content (richtext), and variant. Register in Experience
sectionsdynamic zone and in Container slotcontentdynamic zone so editors can use Text in top-level sections and inside container slots. GraphQL schema and generated client updated.Contracts Changed
Regeneration Required
Validation
Made with Cursor
Summary by CodeRabbit
New Features
Other Changes