Skip to content

SWI-11363 feat(web): Migration Preflight playground for sales demos#11

Merged
kshahbw merged 2 commits into
mainfrom
adapter/migration-preflight-ui
Jul 8, 2026
Merged

SWI-11363 feat(web): Migration Preflight playground for sales demos#11
kshahbw merged 2 commits into
mainfrom
adapter/migration-preflight-ui

Conversation

@kshahbw

@kshahbw kshahbw commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What & why

A self-contained, double-click HTML file (dist/playground.html) a sales engineer can present to a prospect — no server, no install, works offline. Paste a customer's TwiML (or pick a curated example) and it shows, live:

  • a works-as-is / heads-up / blocker verdict,
  • a migration-complexity score (X/10),
  • the translated BXML (collapsed — one click for the engineer in the room),
  • a forwardable report (Print / Save as PDF, Copy report).

The primary audience is the buying decisionmaker, with the technical evaluator covered by the on-demand BXML. It turns the "change one URL and your app runs on Bandwidth" pitch from an abstract slide into something a buyer sees happen to their own call flow.

The honesty invariant

The page runs the real engine in the browseranalyzeSource, complexityScore, translateTwiml, and the compatibility matrix, reused verbatim. It does not reimplement any translation or scoring. Because the same matrix drives the live adapter and this page, the verdict provably matches production. (It even corrects the design mockup's fictions: the mockup's fake BXML used a <Bxml> root; real BXML uses <Response>.)

How it's built

  • web/view-model.ts (the only new logic: buildView, pure + unit-tested), app.ts (DOM/interactions), index.html, styles.css (Bandwidth design-system tokens in :root), examples.ts, and DM Sans fonts.
  • scripts/build-playground.ts — esbuild bundle; inlines CSS + fonts (base64); asserts the output has no external resource references before writing.
  • src/matrix/load.ts — switched from createRequire to a browser-bundlable JSON import (needed to run the engine in the browser; CLI/tests unaffected).
  • npm run playground:builddist/playground.html (gitignored build product).

Scope (intentionally narrow)

TwiML-document input only. No source-scanning (that stays in the CLI npm run preflight), no live calls, no server. Those need a server and are out of scope for this demo tool.

Verification

  • npm run typecheck clean · 265/265 tests (10 new over the curated examples).
  • Driven through headless Chrome: the engine executes client-side and renders the real verdict/findings/BXML; confirmed zero external resource references and all DM Sans weights inlined. Both review fixes (gauge label wrapping, BXML pretty-printing) verified via screenshot + DOM dump.

🤖 Generated with Claude Code

A double-click HTML file (dist/playground.html) that runs the real
translation engine in the browser: paste a customer's TwiML (or pick a
curated example) and get a live works-as-is / heads-up / blocker verdict,
a migration-complexity score, the translated BXML, and a forwardable
report. No server, no network, works offline.

Honesty invariant: reuses analyzeSource / complexityScore / translateTwiml
and the compatibility matrix verbatim, so the verdict provably matches what
the live adapter does in production. buildView() is the only new logic and
is unit-tested; the SVG/CSS come from a Bandwidth design-system mockup.

- web/: view-model, app, index.html, styles.css, examples, DM Sans fonts
- scripts/build-playground.ts: esbuild bundle, inlines CSS + fonts (base64),
  asserts no external resource references
- src/matrix/load.ts: browser-bundlable JSON import (was createRequire)
- test/playground-view.test.ts: 10 tests over the curated examples
- README + web/README: playground is now the headline no-accounts demo

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kshahbw
kshahbw requested review from a team as code owners July 8, 2026 15:07
@kshahbw kshahbw changed the title feat(web): Migration Preflight playground for sales demos SWI-11363 feat(web): Migration Preflight playground for sales demos Jul 8, 2026
@kshahbw
kshahbw merged commit cff18c2 into main Jul 8, 2026
3 checks passed
@kshahbw
kshahbw deleted the adapter/migration-preflight-ui branch July 8, 2026 20:15
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