Skip to content

feat(cms): add schema for Text component#189

Merged
Ur-imazing merged 7 commits intomainfrom
feat/144-text
Mar 4, 2026
Merged

feat(cms): add schema for Text component#189
Ur-imazing merged 7 commits intomainfrom
feat/144-text

Conversation

@Ur-imazing
Copy link
Copy Markdown
Contributor

@Ur-imazing Ur-imazing commented Mar 4, 2026

Resolves #144

Summary

Add Text section component schema with heading, subtitle, content (richtext), and variant. Register in Experience sections dynamic zone and in Container slot content dynamic zone so editors can use Text in top-level sections and inside container slots. GraphQL schema and generated client updated.

Contracts Changed

  • yes

Regeneration Required

  • yes

Validation

  • Contracts validated
  • Generated code verified (no manual edits)
  • Tests and build passed
  • Terraform plan reviewed (if infra change)

Made with Cursor

Summary by CodeRabbit

  • New Features

    • New Text section component: rich text content with optional heading, heading level (h1–h6), subtitle, and three styling variants (default, lead, small). Usable in experiences and container slots.
  • Other Changes

    • Locale metadata extended with creation, update, document ID, and publish timestamps.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a71ec74a-0277-4c85-a59c-75cfe162c964

📥 Commits

Reviewing files that changed from the base of the PR and between dcb6853 and 5da3f0d.

📒 Files selected for processing (3)
  • apps/cms/schema.graphql
  • apps/cms/src/components/sections/text.json
  • packages/graphql/src/graphql-env.d.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/cms/src/components/sections/text.json

Walkthrough

Adds 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

Cohort / File(s) Summary
Text Component Schema
apps/cms/src/components/sections/text.json
New component JSON defining attributes: heading, headingLevel (h1–h6), subtitle, content (richtext, required), and variant (default/lead/small).
Dynamic Zone Registrations
apps/cms/src/api/experience/content-types/experience/schema.json, apps/cms/src/components/sections/container-slot.json
Registered sections.text in the sections dynamic zone for Experience and in the content dynamic zone for ContainerSlot alongside existing components.
GraphQL schema
apps/cms/schema.graphql
Added ComponentSectionsText type, ComponentSectionsTextInput, ComponentSectionsTextFiltersInput, enums ENUM_COMPONENTSECTIONSTEXT_HEADINGLEVEL and ENUM_COMPONENTSECTIONSTEXT_VARIANT; updated unions ContainerSlotContentDynamicZone, ExperienceSectionsDynamicZone, and GenericMorph; added fields to I18NLocale.
GraphQL typings
packages/graphql/src/graphql-env.d.ts
Added TypeScript GraphQL definitions for ComponentSectionsText, its input/filter types, enums, and updated unions to include the new type.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cms): add schema for Text component' directly and clearly describes the main change: adding a Text component schema to the CMS, which aligns with the primary objective of the pull request.
Linked Issues check ✅ Passed The pull request fulfills all coding requirements from issue #144: a Text component schema with content, heading, headingLevel, subtitle, and variant attributes has been added; the component is registered in Experience sections [#144] and ContainerSlot content [#144] dynamic zones; and GraphQL schema and types have been regenerated [#144].
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the Text component as specified in issue #144: schema definition, registration in dynamic zones, and GraphQL regeneration. No unrelated or extraneous modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/144-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.

@Ur-imazing
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 73ce0b4 and dcb6853.

📒 Files selected for processing (5)
  • apps/cms/schema.graphql
  • apps/cms/src/api/experience/content-types/experience/schema.json
  • apps/cms/src/components/sections/container-slot.json
  • apps/cms/src/components/sections/text.json
  • packages/graphql/src/graphql-env.d.ts

Comment thread apps/cms/schema.graphql
Comment thread apps/cms/src/components/sections/text.json
@Ur-imazing
Copy link
Copy Markdown
Contributor Author

Review feedback addressed (5da3f0d)

Fixed:

  • Text schema headingLevel: Added optional headingLevel enumeration (h1–h6) to the Text component schema (text.json) so components can render semantic heading tags. Updated schema.graphql (type, filters, input + ENUM_COMPONENTSECTIONSTEXT_HEADINGLEVEL) and regenerated packages/graphql client.

Not changed:

  • Web sections renderer / GraphQL fragments for ComponentSectionsText: Epic #175 and issue #144 scope this PR to CMS schema and codegen only; the epic explicitly says "no web UI changes in this epic". Web implementation of the Text section (renderer + ... on ComponentSectionsText fragment) is tracked in #154 (feat(web): add Text component). The web SectionRenderer switch already omits other schema types (e.g. ComponentSectionsVideoHero, ComponentSectionsContainer) that are not yet implemented; adding a ComponentSectionsText case will be done in the web epic.

@Ur-imazing Ur-imazing merged commit 747668e into main Mar 4, 2026
12 of 13 checks passed
@Ur-imazing Ur-imazing deleted the feat/144-text branch March 4, 2026 20:55
Kneesal pushed a commit to Kneesal/forge that referenced this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cms): add schema for Text component

1 participant