Skip to content

feat(pay-card): show the card details image in the devtool - #21468

Draft
philipptpunkt wants to merge 1 commit into
feat/LIVE-34778-card-details-tokenfrom
feat/pay-card-devtools-card-details
Draft

feat(pay-card): show the card details image in the devtool#21468
philipptpunkt wants to merge 1 commit into
feat/LIVE-34778-card-details-tokenfrom
feat/pay-card-devtools-card-details

Conversation

@philipptpunkt

@philipptpunkt philipptpunkt commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Stack (managed by stac-man)

Nothing renders the secure details yet, so the endpoint's answer could not be
seen. The Card interaction screen now stands a placeholder where the card goes
and swaps in the provider's image once a developer asks for it.

  • The image loads from the returned URL with no headers: the token in the query
    string is the whole credential, which is what makes an enough.
  • Going back clears the minted URL. The provider spends it the first time the
    image is read, so a retained one renders nothing on the way back in.
  • The URL is never rendered as text, and a test asserts it.

Copilot AI lite review requested due to automatic review settings September 2, 2026 18:27
@live-github-bot live-github-bot Bot added the devtools Has changes in the DevTools packages label Sep 2, 2026

Copilot AI 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.

🟢 Approval recommended

The implementation is narrowly scoped to devtools UI wiring, includes a changeset, and adds targeted tests for the new security-sensitive behavior (no URL text rendering and URL clearing on exit).

Pull request overview

This PR extends the Pay Card devtool “Card interaction” screen to let developers request and display the provider-rendered secure card details image (PAN/CVV/expiry) via a single-use URL, and clears that URL when leaving the screen to ensure a fresh token is minted on return.

Changes:

  • Add a details sub-prop to the devtool interaction props to represent the secure details image state and actions (request/clear).
  • Wire useCreateCardDetailsTokenMutation into the devtools bindings and expose imageUrl, loading, error, request, and clear handlers to the UI.
  • Render a placeholder that triggers the request, then swap to the returned <Image>; add tests asserting the URL is never rendered as text and is cleared on back navigation.
File summaries
File Description
devtools/pay-card/src/usePayCardViewModel.test.ts Updates test props builder to include interaction.details defaults.
devtools/pay-card/src/usePayCardViewModel.native.test.ts Updates native test props builder to include interaction.details defaults.
devtools/pay-card/src/types.ts Introduces PayCardDetailsImageProps and adds details to PayCardInteractionProps.
devtools/pay-card/src/pay-card/PayCard.web.test.tsx Updates web test props to satisfy new interaction.details requirement.
devtools/pay-card/src/pay-card/PayCard.native.test.tsx Adds coverage for requesting details, rendering the image without exposing the URL as text, and clearing on back.
devtools/pay-card/src/components/Interaction/Interaction.native.tsx Implements the placeholder + image rendering and clears minted URL on back navigation.
devtools/bindings/src/usePayCardToolProps.ts Wires the RTK mutation into the devtool props and exposes details state/actions.
.changeset/pay-card-devtools-card-details.md Adds a changeset documenting the new devtool behavior for the relevant packages.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ✅ Deployed https://web-tools-c30hm4qsq-ledger-hq-prd.vercel.app

@live-github-bot

live-github-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Mobile Bundle Checks

Comparing 8114c05 against d80a0e0.

⚠️ main.ios.jsbundle bundle size significantly increased: 62.5mb -> 62.9mb. Please check if this is expected.
⚠️ main.android.jsbundle bundle size significantly increased: 62.5mb -> 62.9mb. Please check if this is expected.

Desktop Bundle Checks

Comparing 8114c05 against d80a0e0.

✅ Previous issues have all been fixed.

Copilot AI review requested due to automatic review settings September 2, 2026 18:38
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-details branch from d86d3d6 to 2770242 Compare September 2, 2026 18:38

Copilot AI 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.

🟡 Changes recommended

The new details.request callback in usePayCardToolProps is typed in a way that can be incompatible with the devtool’s readonly css props under strictFunctionTypes, risking a type error in the bindings.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +199 to +203
error: cardDetails.error === undefined ? undefined : describeError(cardDetails.error),
request: (customCss?: PayCardDetailsCss) => {
requestCardDetails(customCss);
},
clear: resetCardDetails,
Nothing renders the secure details yet, so the endpoint's answer could not be
seen. The Card interaction screen now stands a placeholder where the card goes
and swaps in the provider's image once a developer asks for it.

- The image loads from the returned URL with no headers: the token in the query
  string is the whole credential, which is what makes an <Image> enough.
- Going back clears the minted URL. The provider spends it the first time the
  image is read, so a retained one renders nothing on the way back in.
- The URL is never rendered as text, and a test asserts it.
Copilot AI review requested due to automatic review settings September 2, 2026 19:26
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-details branch from 2770242 to faf991d Compare September 2, 2026 19:26

Copilot AI 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.

🟢 Approval recommended

The changes are scoped, consistent with the PR description, and include targeted native tests covering the new secure-image placeholder/clear behavior and the “never render URL as text” requirement.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

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

Labels

devtools Has changes in the DevTools packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants