feat: extend useTestDetails with previewAction#1654
Closed
ogp-weeloong wants to merge 3 commits into
Closed
Conversation
useTestDetails now accepts substeps and returns previewAction:
{ kind, fieldKey, html } | null. The hook scans the step's substep
arguments for an IFieldRichText with a previewType marker, reads its
live form value via useWatch, and emits a previewAction when the live
value is a non-empty string. To respect the rules-of-hooks, useWatch
is always called with a stable dummy name when no previewable field
exists.
Pass substeps from FlowStepTestController so the call site stays
typed; consumption of previewAction lands in the next commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Consumes previewAction from useTestDetails and renders a kind-specific preview button next to both Check-step entry points (the bottom Check step button and, after a test run succeeds, the Check step again button). Clicking it pipes the live form value through substituteForPreview and opens the corresponding modal (today, EmailPreviewModal). Copy is driven by a PREVIEW_BUTTON_COPY map keyed by TFieldPreviewType so future preview kinds plug in without touching the controller. The controller has no references to specific apps, step keys, or field names. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sets previewType: 'email' on the rich-text body field in transactionalEmailFields. End-to-end, this makes the "Preview email" button appear next to "Check step" for the Send transactional email action; clicking it renders the current draft body through @emailens/engine. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
How to use the Graphite Merge QueueAdd 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. |
This was referenced May 28, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

feat: extend useTestDetails with previewAction
useTestDetails now accepts substeps and returns previewAction:
{ kind, fieldKey, html } | null. The hook scans the step's substep
arguments for an IFieldRichText with a previewType marker, reads its
live form value via useWatch, and emits a previewAction when the live
value is a non-empty string. To respect the rules-of-hooks, useWatch
is always called with a stable dummy name when no previewable field
exists.
Pass substeps from FlowStepTestController so the call site stays
typed; consumption of previewAction lands in the next commit.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
feat: render Preview email button in FlowStepTestController
Consumes previewAction from useTestDetails and renders a kind-specific
preview button next to both Check-step entry points (the bottom Check
step button and, after a test run succeeds, the Check step again
button). Clicking it pipes the live form value through
substituteForPreview and opens the corresponding modal (today,
EmailPreviewModal).
Copy is driven by a PREVIEW_BUTTON_COPY map keyed by TFieldPreviewType
so future preview kinds plug in without touching the controller. The
controller has no references to specific apps, step keys, or field
names.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
feat: opt Postman body field into email preview
Sets previewType: 'email' on the rich-text body field in
transactionalEmailFields. End-to-end, this makes the "Preview email"
button appear next to "Check step" for the Send transactional email
action; clicking it renders the current draft body through
@emailens/engine.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com