Skip to content

[EMAIL-PREVIEW-2] PLU-386: Enable RichTextEditor to substitute variables#1653

Open
ogp-weeloong wants to merge 1 commit into
claude/email-preview-modalfrom
claude/substitute-for-preview
Open

[EMAIL-PREVIEW-2] PLU-386: Enable RichTextEditor to substitute variables#1653
ogp-weeloong wants to merge 1 commit into
claude/email-preview-modalfrom
claude/substitute-for-preview

Conversation

@ogp-weeloong

@ogp-weeloong ogp-weeloong commented May 28, 2026

Copy link
Copy Markdown
Contributor

Problem

We want pipe owners to be able to preview their email across a variety of email clients (Outlook, Yahoo etc).

High-level Approach

See #1652 for more details.

This PR

Enables RichTextEditor to substitute variables with real values. It walks the DOM tree and:

  • Replaces variable / tableVariable spans with their resolved value (from varInfo, falling back to data-value)
  • Applies simpleSubstitute to any remaining text nodes to clean up legacy {{step.…}} patterns

Tests

Only regression tests as this is a no-op.

  • Check that I can still compose postman emails with variables in the rich text editor
  • Check that I can still view email with actual values past executions

Full test in later PR

ogp-weeloong commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label lfg to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ogp-weeloong ogp-weeloong changed the title feat: add substituteForPreview helper for RichTextEditor HTML [EMAIL-PREVIEW-1] PLU-386: Enable RichTextEditor to substitute variables May 28, 2026
@linear

linear Bot commented May 28, 2026

Copy link
Copy Markdown

PLU-386

@ogp-weeloong ogp-weeloong changed the title [EMAIL-PREVIEW-1] PLU-386: Enable RichTextEditor to substitute variables [EMAIL-PREVIEW-2] PLU-386: Enable RichTextEditor to substitute variables May 28, 2026
@ogp-weeloong ogp-weeloong force-pushed the claude/substitute-for-preview branch from 5f7135e to bb896d2 Compare May 29, 2026 03:16
@ogp-weeloong ogp-weeloong force-pushed the claude/email-preview-modal branch from 13c6512 to ba98c73 Compare May 29, 2026 03:16
@ogp-weeloong ogp-weeloong requested a review from a team May 29, 2026 04:43
substituteForPreview renders RichTextEditor HTML to plain final-form
HTML, suitable for piping into an email preview engine. Variable and
table-variable spans are replaced with their resolved value (prefer
varInfoMap lookup, fall back to the node's data-value); remaining text
nodes get simpleSubstitute applied to clean up any legacy {{step.…}}
patterns.

Unit tests cover variable spans, table-variable spans, legacy template
text, and missing-var fallback (both to data-value and to empty).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ogp-weeloong ogp-weeloong marked this pull request as ready for review June 2, 2026 06:38
@ogp-weeloong ogp-weeloong force-pushed the claude/email-preview-modal branch from ba98c73 to aa87e38 Compare June 2, 2026 06:58
@ogp-weeloong ogp-weeloong force-pushed the claude/substitute-for-preview branch from bb896d2 to adda098 Compare June 2, 2026 06:58

@kevinkim-ogp kevinkim-ogp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants