Skip to content

docs(sdk-flow): add Realtime Validation shot to capture pipeline#100

Merged
fuhrysteve merged 1 commit into
masterfrom
fuhry/realtime-validation-shot
May 18, 2026
Merged

docs(sdk-flow): add Realtime Validation shot to capture pipeline#100
fuhrysteve merged 1 commit into
masterfrom
fuhry/realtime-validation-shot

Conversation

@fuhrysteve

Copy link
Copy Markdown
Contributor

Summary

Add a realtime-validation shot to the SDK capture pipeline + swap
the previously-broken <img> ref in docs/sdk-flow.md to the
captured S3 URL.

Image:
https://tpastream-public.s3.amazonaws.com/sdk-docs/flow-screenshots/realtime-validation.png

What the shot shows

The ActiveValidationsHero in its initial pending state
("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.mjs already supports real-token init
(used by error-init-page and select-enroll-widget). The new
shot 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_holder is stubbed to
    return a fake task_id / task_token immediately — no real
    backend validation gets queued.
  • 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
visually overlaps it at the typical 560-px embed width, so it's
hidden via addStyleTag right before the capture for legibility.

What changed in capture.mjs

  • captureOne now accepts either a fulfill object (the common
    case) or an async handler function for routes[i][1] — the
    handler form is what the new shot uses to stall the SSE.
  • SDK_SHOTS_DEBUG=1 env flag wires up pageerror +
    console.error logging during iteration; off by default to keep
    capture runs quiet.
  • New realtime-validation entry in the SHOTS table.

Test plan

  • Reviewer reads through scripts/screenshots/capture.mjs's
    new shot entry; the routes + drive are self-contained.
  • After merge, deployed preview shows the new image under
    "Realtime Validation" on
    https://developers.tpastream.com/sdk/sdk-flow.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-validation screenshot scenario with credential-submit and SSE mocks.
  • Extends screenshot routing to support async route handlers.
  • Updates docs/sdk-flow.md to 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.

Comment thread scripts/screenshots/capture.mjs
… 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.
@fuhrysteve fuhrysteve force-pushed the fuhry/realtime-validation-shot branch from c3b7b11 to 98ab012 Compare May 18, 2026 11:48
@fuhrysteve fuhrysteve merged commit ca1bf80 into master May 18, 2026
2 checks passed
@fuhrysteve fuhrysteve deleted the fuhry/realtime-validation-shot branch May 18, 2026 11:48
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