docs(sdk-flow): add Realtime Validation shot to capture pipeline#100
Merged
Conversation
2 tasks
There was a problem hiding this comment.
Pull request overview
Adds a new realtime validation screenshot capture path and updates the SDK flow documentation to reference the hosted image.
Changes:
- Adds a
realtime-validationscreenshot scenario with credential-submit and SSE mocks. - Extends screenshot routing to support async route handlers.
- Updates
docs/sdk-flow.mdto use the captured S3 image URL.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/screenshots/capture.mjs |
Adds the realtime-validation shot, debug logging, and async route handler support. |
docs/sdk-flow.md |
Replaces the realtime validation image reference with the hosted S3 screenshot URL. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… shot
The 0.7-era flow-screenshots/realtime-validation.png reference still
pointed at a relative path that had no corresponding committed PNG,
so the developer-docs build was rendering a broken-image icon under
the "Realtime Validation" section of sdk-flow.
Add a `realtime-validation` shot to the capture pipeline. It uses
real-token init (matching the existing fix-credentials path), drives
through SelectEnrollProcess -> choose-payer -> credentials form ->
submit, then captures the ActiveValidationsHero in its initial
"Connecting..." state. Two mocks make the shot deterministic:
- POST /sdk-api/policy_holder_sdk/policy_holder is stubbed to
return a fake task_id/task_token immediately, so we don't queue
a real backend validation.
- GET /v3/sdk/progress/<task_id>/stream hangs for 45 s so the
hero stays in 'pending' instead of transitioning to
pending_async (clean SSE close) or failure (abort/error).
The corner ActiveValidationsPanel duplicates the hero copy and
overlaps it at the typical 560-px embed width, so it's hidden via
addStyleTag right before the capture for legibility -- the panel
is exercised by the production UX, not by this doc shot.
Routes handling in captureOne now accepts either a fulfill object
(the common case) or an async handler function. Adds a small debug
plumbing knob (SDK_SHOTS_DEBUG=1) that surfaces pageerror +
console.error during iteration; off by default so capture runs
stay quiet.
Image is uploaded to:
https://tpastream-public.s3.amazonaws.com/sdk-docs/flow-screenshots/realtime-validation.png
The doc's <img> ref is updated to that URL, matching the rest of
the SDK pipeline shots.
c3b7b11 to
98ab012
Compare
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.
Summary
Add a
realtime-validationshot to the SDK capture pipeline + swapthe previously-broken
<img>ref indocs/sdk-flow.mdto thecaptured S3 URL.
Image:
https://tpastream-public.s3.amazonaws.com/sdk-docs/flow-screenshots/realtime-validation.png
What the shot shows
The
ActiveValidationsHeroin its initialpendingstate("Connecting… / Hang tight, this usually takes under a minute.")
right after a credential submit, with the choose-payer view
underneath ("Add another carrier") so the user can keep adding
carriers in parallel — exactly the UX the surrounding doc paragraph
describes.
How the capture works
scripts/screenshots/capture.mjsalready supports real-token init(used by
error-init-pageandselect-enroll-widget). The newshot reuses that, drives through SelectEnrollProcess →
choose-payer → credentials form → submit, then waits on the hero
"Connecting…" text before clipping.
Two mocks make the shot deterministic:
POST /sdk-api/policy_holder_sdk/policy_holderis stubbed toreturn a fake
task_id/task_tokenimmediately — no realbackend validation gets queued.
GET /v3/sdk/progress/<task_id>/streamhangs for 45 s so thehero stays in
pendinginstead of transitioning topending_async(clean SSE close) orfailure(abort/error).The corner
ActiveValidationsPanelduplicates the hero copy andvisually overlaps it at the typical 560-px embed width, so it's
hidden via
addStyleTagright before the capture for legibility.What changed in capture.mjs
captureOnenow accepts either a fulfill object (the commoncase) or an async handler function for
routes[i][1]— thehandler form is what the new shot uses to stall the SSE.
SDK_SHOTS_DEBUG=1env flag wires uppageerror+console.errorlogging during iteration; off by default to keepcapture runs quiet.
realtime-validationentry in theSHOTStable.Test plan
scripts/screenshots/capture.mjs'snew shot entry; the routes + drive are self-contained.
"Realtime Validation" on
https://developers.tpastream.com/sdk/sdk-flow.