Skip to content

Feast Contextual Nudges#15752

Open
andresilva-guardian wants to merge 55 commits into
mainfrom
afs/feast-contextual-nudges
Open

Feast Contextual Nudges#15752
andresilva-guardian wants to merge 55 commits into
mainfrom
afs/feast-contextual-nudges

Conversation

@andresilva-guardian
Copy link
Copy Markdown
Contributor

@andresilva-guardian andresilva-guardian commented Apr 24, 2026

What does this change?

We add a new in-article component to Guardian recipe pages, FeastContextualNudge, an inline card injected after each recipe subheading when a RecipeBlockElement is present in the article body.

FeastContextualNudge is a Feast-branded card with a fixed heading ("Feast app: Your most useful kitchen utensil"), a short description, and a single "Open in the Feast app" CTA. The CTA deep-links to the specific recipe in the Feast app using environment-aware Adjust tracking tokens (PROD vs CODE). Dark mode is supported via CSS custom properties.

In ArticleRenderer, we group the article's body elements into per-recipe sections separated by SubheadingBlockElements. After each subheading, if a RecipeBlockElement is present in that section, we inject a FeastContextualNudge for it. The RecipeBlockElement is consumed by the nudge and not rendered as a standalone body element.

We also add the RecipeBlockElement type to the content model (src/types/content.ts) and its corresponding JSON schema definition (src/frontend/schemas/feArticle.json), and we update the Recipe fixture with a sample RecipeBlockElement so the nudge is visible in local dev and Storybook.

Files added/changed:

  • src/components/FeastContextualNudge.tsx + .stories.tsx
  • src/lib/ArticleRenderer.tsx (groups recipe elements by section, injects the nudge)
  • src/types/content.ts (RecipeBlockElement and RecipeFeaturedImage interfaces, added to FEElement union)
  • src/frontend/schemas/feArticle.json (RecipeBlockElement and RecipeFeaturedImage JSON schema definitions)
  • fixtures/generated/fe-articles/Recipe.ts (sample RecipeBlockElement added to the fixture)

Note for reviewers: There is no A/B test or dismissal logic in this iteration. The nudge renders for all recipe articles where a RecipeBlockElement is present. These are intended as follow-up steps.

Why?

Recipe articles are the highest-intent touchpoint for Feast app promotion. A reader actively cooking from a Guardian recipe on the web is already the ideal Feast user, and Cook Mode, unit conversion, and saved collections are all directly relevant to what they are doing at that moment.

This is contextual targeting rather than demographic targeting: we offer a relevant upgrade at the moment of highest intent rather than interrupting general browsing.

Screenshots

Before After
Screenshot 2026-05-28 at 10 18 54 Screenshot 2026-05-28 at 10 18 40
Screenshot 2026-05-28 at 10 19 19 Screenshot 2026-05-28 at 10 19 07
Screenshot 2026-05-28 at 10 24 19 Screenshot 2026-05-28 at 10 24 06

@github-actions
Copy link
Copy Markdown

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@andresilva-guardian andresilva-guardian marked this pull request as draft April 24, 2026 17:44
- Introduced RecipeCardInline component to display recipe details inline with dismiss functionality.
- Added RecipeCardLeftCol component for sticky left-column recipe display.
- Created stories for both components to showcase various states and dark mode.
- Updated ArticleRenderer to integrate new RecipeCard components, replacing previous FeastRecipeNudge components.
…ds for improved clarity and performance

refactor: simplify RecipeCardInline and RecipeCardLeftCol components by removing unused props and styles
fix: adjust ArticleRenderer to handle new RecipeJson structure for better data management
@andresilva-guardian andresilva-guardian added the feature Departmental tracking: work on a new feature label May 28, 2026
@andresilva-guardian andresilva-guardian marked this pull request as ready for review May 28, 2026 09:32
@andresilva-guardian andresilva-guardian added the run_chromatic Runs chromatic when label is applied label May 28, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label May 28, 2026
Comment thread dotcom-rendering/src/components/FeastContextualNudge.tsx Outdated
Comment thread dotcom-rendering/src/components/FeastContextualNudge.tsx Outdated
Comment thread dotcom-rendering/src/components/FeastContextualNudge.tsx Outdated
Comment thread dotcom-rendering/src/components/FeastContextualNudge.tsx Outdated
Comment thread dotcom-rendering/src/components/FeastContextualNudge.tsx Outdated
Comment thread dotcom-rendering/src/lib/ArticleRenderer.tsx
Copy link
Copy Markdown
Contributor

@j-ruda-guardian j-ruda-guardian left a comment

Choose a reason for hiding this comment

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

Looks good! Left a couple of comments that I hope are helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants