Skip to content

feat: render rich text from contentful#27658

Merged
VGR-GIT merged 4 commits into
mainfrom
Render-rich-text-from-contentful
Mar 19, 2026
Merged

feat: render rich text from contentful#27658
VGR-GIT merged 4 commits into
mainfrom
Render-rich-text-from-contentful

Conversation

@sophieqgu
Copy link
Copy Markdown
Contributor

@sophieqgu sophieqgu commented Mar 18, 2026

Description

Render contentful rich text

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Simulator Screenshot - E2E Test  - 2026-03-18 at 17 27 27 Simulator Screenshot - E2E Test  - 2026-03-18 at 17 27 20

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Adds a new rich-text renderer and switches rewards screens to render Contentful-provided documents and open links via in-app browser navigation, which may affect UI rendering and link handling for live campaign content.

Overview
Enables Rewards UI to render Contentful rich text documents (paragraphs, headings, lists, text marks, and hyperlinks) via a new ContentfulRichText component, with hyperlinks opening in the in-app browser.

Updates CampaignMechanicsView to render howItWorks.notes only when it is a valid Contentful document (removing the previous structured-notes parsing and related testIDs), and updates CampaignOptInSheet to prefer campaign.termsAndConditions rich text with a static fallback.

Adds comprehensive unit tests for the new rich-text renderer and adjusts existing tests for the new rendering/navigation behavior.

Written by Cursor Bugbot for commit 70a7760. This will update automatically on new commits. Configure here.

@sophieqgu sophieqgu requested a review from a team as a code owner March 18, 2026 21:37
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-rewards Rewards team label Mar 18, 2026
@github-actions github-actions Bot added size-L risk-low Low testing needed · Low bug introduction risk labels Mar 18, 2026
@sophieqgu sophieqgu changed the title Render rich text feat: render rich text from contentful Mar 18, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 18, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/UI/Rewards/Views/CampaignMechanicsView.tsx
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 19, 2026
@github-actions github-actions Bot removed the risk-low Low testing needed · Low bug introduction risk label Mar 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR modifies only the Rewards feature UI components:

  1. ContentfulRichText.tsx (new file): A new renderer for Contentful CMS rich text documents. Purely a UI utility component scoped to the Rewards feature.

  2. CampaignMechanicsView.tsx: Refactored to use ContentfulRichText instead of a custom notes parser. The notes section now renders Contentful documents instead of hardcoded structured data.

  3. CampaignOptInSheet.tsx: Updated to support ContentfulRichText for terms & conditions, and changed the terms link handler from Linking.openURL() to in-app browser navigation.

Why no E2E tags are selected:

  • None of the available E2E test tags cover the Rewards/Campaigns feature area. There are no E2E test specs referencing CampaignOptInSheet, CampaignMechanicsView, ContentfulRichText, or the Rewards campaign flows.
  • The changes are entirely scoped to the Rewards UI feature — no shared infrastructure (TabBar, navigation stack, modals, controllers, Engine) is modified.
  • The behavioral change (Linking.openURL → in-app browser navigation) is contained within the Rewards opt-in sheet and doesn't affect any other tested flows.
  • The test files changed are unit tests (.test.tsx), not E2E specs.
  • No controller, Engine, or core module changes are present.

The risk is low as these are isolated UI component changes with unit test coverage, and no existing E2E tests cover this feature area.

Performance Test Selection:
The changes are limited to UI component refactoring within the Rewards feature. No performance-sensitive code paths are affected: no list rendering changes, no state management modifications, no data loading or API call changes, no account/network selectors, and no app startup/initialization code. The ContentfulRichText component is a simple recursive renderer for CMS content, not a performance-critical path.

View GitHub Actions results

@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Mar 19, 2026
@sonarqubecloud
Copy link
Copy Markdown

@VGR-GIT VGR-GIT added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 7176f71 Mar 19, 2026
66 checks passed
@VGR-GIT VGR-GIT deleted the Render-rich-text-from-contentful branch March 19, 2026 09:20
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 19, 2026
@metamaskbot metamaskbot added the release-7.71.0 Issue or pull request that will be included in release 7.71.0 label Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.71.0 Issue or pull request that will be included in release 7.71.0 risk-low Low testing needed · Low bug introduction risk size-L team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants