WhoBuilt

Bridging the Platform UI Gap with GenAI

Sep 8, 2025· 20 min· 670 views·Watch on YouTube

Speaker

Ohans Emmanuel, staff engineer at HelloFresh, explains how his team used GenAI to migrate a complex shopping flow from web to React Native at React Universe Conf 2025, hosted by Callstack.

A complex component to migrate

Emmanuel’s team was moving native iOS and Android shopping flows to React Native, using the web implementation as a reference. The product card alone had about 13,000 lines of code, many delivery and subscription states, and visual experiments. A one-shot rewrite with Cursor or Gemini failed, even with a 200K-token context window.

Give agents selective context

The team needed agents to understand both the web and React Native repositories without loading everything. They used a multi-root workspace and Cursor rules to narrow what the agent could see. They then split work into focused tasks and used Git worktrees so multiple agent sessions could work independently.

Build self-correcting workflows

To make agent output more reliable, Emmanuel had agents write a failing test first, confirm it failed, and only then implement the change and verify the test passed. For visual checks, agents could run a web server in a chosen product-card state, take screenshots with Puppeteer MCP, and compare them with the implementation.

Make valid UI states explicit

The team replaced loose combinations of booleans, which could represent contradictory states such as success and error at once, with explicit variants modeled as TypeScript discriminated unions. Exhaustive switches let TypeScript flag missing cases. Agents could use those types to validate their work and correct errors.

Results and guiding principles

Emmanuel summarized the approach as selective context and self-correcting agent workflows. With these methods, the team converted web components into mobile UI and streamlined work that might have taken weeks or months into a few hours.

Takeaways

  • Give coding agents only the repository context and files needed for the task.
  • Split large migrations into focused tasks that can run in separate Git worktrees.
  • Ask agents to prove a test fails before implementing, then verify it passes.
  • Use screenshot checks to compare mobile implementations with a running web reference.
  • Model UI states with discriminated unions and exhaustive checks to prevent invalid combinations.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • metric
    HelloFresh: World's largest meal kit company
    “the world's largest meal kit company”
    YouTube
    Unverified1 source· Talk
  • role at
    Ohans Emmanuel is staff engineer at HelloFresh
    “I work as a staff engineer for HelloFresh”
    YouTube
    Unverified1 source· Talk
  • metric
    HelloFresh: The web repository has about 10,000 React components
    “The web repository has about 10,000 React components”
    YouTube
    Unverified1 source· Talk
  • metric
    HelloFresh: The shopping journey has about 500 React components
    “The shopping journey we cared about has about 500 React components”
    YouTube
    Unverified1 source· Talk
  • uses
    “Git worktrees ... helped us ... have the agents all work across them”
    YouTube
    Unverified1 source· Talk
  • feature
    Puppeteer MCP: Take screenshots for visual validation
    “use the Puppeteer MCP tool to take screenshots and validate them”
    YouTube
    Unverified1 source· Talk
  • feature
    TypeScript: Discriminated unions and exhaustive switches can catch missing cases and prevent invalid UI states
    “if ... I removed any of these cases, TypeScript is going to yell”
    YouTube
    Unverified1 source· Talk
  • metric
    HelloFresh: The team streamlined work that would have taken weeks or months into a few hours
    “streamline what would have taken us weeks—some would say months—into a few hours”
    YouTube
    Unverified1 source· Talk

Related talks