Skip to content

feat(pay-card): add a Card interaction screen to the devtool - #21444

Draft
philipptpunkt wants to merge 1 commit into
feat/LIVE-34772-card-linked-wallet-balancesfrom
feat/pay-card-devtools-card-interaction
Draft

feat(pay-card): add a Card interaction screen to the devtool#21444
philipptpunkt wants to merge 1 commit into
feat/LIVE-34772-card-linked-wallet-balancesfrom
feat/pay-card-devtools-card-interaction

Conversation

@philipptpunkt

@philipptpunkt philipptpunkt commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Stack (managed by stac-man)

The Card endpoints have no UI yet, so nothing shows whether they return what
we expect. The devtool can call them once the cardholder is signed in and print
the response.

  • "Card interaction" opens over the tool's own body and lists one entry per
    endpoint, with the last response or error underneath. Sub-views live in the
    tool: the shell's navigator only knows categories, tools and tool.
  • The first entry is the card status. Adding an endpoint is one probe in the
    binding, which keeps the tool component free of app state as before.
  • Export useLazyGetCardStatusQuery: a probe fetches on press, not on mount.

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 RTK Query hook usage in usePayCardToolProps needs corresponding store/test setup updates (cardApi reducer + middleware) to avoid RTK Query missing-registration errors.

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

Pull request overview

This PR extends the Pay Card devtool with a native “Card interaction” sub-screen that can run Card Management endpoints on demand and display the latest response/error, starting with a Card Status probe. It also exposes the RTK Query lazy hook needed to trigger the fetch from a button rather than on mount.

Changes:

  • Add interaction.probes to the PayCardToolProps contract and wire a first “Card Status” probe from the bindings layer.
  • Add a native-only Interaction UI and an entry row (“Card interaction”) that swaps the tool body into the probe view.
  • Export useLazyGetCardStatusQuery from @domain/api-card-management and add the necessary workspace dependency wiring + changeset.
File summaries
File Description
pnpm-lock.yaml Lockfile update for adding @domain/api-card-management to devtools bindings.
domain/api/card-management/src/api.ts Export useLazyGetCardStatusQuery for on-demand Card Status fetching.
devtools/pay-card/src/usePayCardViewModel.test.ts Update test props factory to include interaction.
devtools/pay-card/src/usePayCardViewModel.native.test.ts Update test props factory to include interaction.
devtools/pay-card/src/types.ts Add probe/interaction types and extend the tool props contract.
devtools/pay-card/src/pay-card/PayCard.web.test.tsx Update web test props to include interaction.
devtools/pay-card/src/pay-card/PayCard.native.tsx Add “Card interaction” entry row and swap-to-subscreen behavior.
devtools/pay-card/src/pay-card/PayCard.native.test.tsx Add coverage for opening the interaction screen, running probes, and rendering results.
devtools/pay-card/src/components/Interaction/Interaction.web.tsx Web stub (native-only behavior for now).
devtools/pay-card/src/components/Interaction/Interaction.native.tsx Native Interaction screen rendering probes, results, and errors.
devtools/bindings/src/usePayCardToolProps.ts Build the Card Status probe using useLazyGetCardStatusQuery and expose it via interaction.
devtools/bindings/package.json Add dependency on @domain/api-card-management.
.changeset/pay-card-devtools-card-interaction.md Changeset for devtools + API hook export.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 12/13 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment on lines +118 to +123
const [runCardStatus, cardStatus] = useLazyGetCardStatusQuery();

const cardStatusProbe = useMemo<PayCardProbe>(
() => ({
id: "card-status",
label: "Card Status",
@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-8t8pn937v-ledger-hq-prd.vercel.app

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 7 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
desktop-main 2.5 MB - - -
desktop-preloader 7.1 KB - - -
desktop-renderer 82.4 MB - - -
desktop-webviewDappPreloader 0 B - - -
desktop-webviewPreloader 0 B - - -
desktop-workers 36.8 KB - - -
mobile 129.5 MB - - -
📋 Detailed Reports (Click to expand)

📁 desktop-main

Path: rsdoctor/desktop-main/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.5 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 2.4 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 135.3 KB - -

📁 desktop-preloader

Path: rsdoctor/desktop-preloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 7.1 KB - -
🗜️ Gzip Size - - -
📄 JavaScript 5.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 1.8 KB - -

📁 desktop-renderer

Path: rsdoctor/desktop-renderer/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 82.4 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 30.6 MB - -
🎨 CSS 188.4 KB - -
🌐 HTML 1.8 KB - -
📁 Other Assets 51.7 MB - -

📁 desktop-webviewDappPreloader

Path: rsdoctor/desktop-webviewDappPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 0 B - -
🗜️ Gzip Size - - -
📄 JavaScript 0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-webviewPreloader

Path: rsdoctor/desktop-webviewPreloader/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 0 B - -
🗜️ Gzip Size - - -
📄 JavaScript 0 B - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 desktop-workers

Path: rsdoctor/desktop-workers/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 36.8 KB - -
🗜️ Gzip Size - - -
📄 JavaScript 36.8 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 129.5 MB - -
🗜️ Gzip Size - - -
📄 JavaScript 114.0 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 15.5 MB - -

Generated by Rsdoctor GitHub Action

Copilot AI review requested due to automatic review settings September 2, 2026 12:32
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-interaction branch from f94314a to adb5ec1 Compare September 2, 2026 12:32
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-interaction branch from adb5ec1 to 3334db0 Compare September 2, 2026 12:35

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

Changes are scoped to devtool UI + bindings, include a changeset, and add/adjust tests for the new interaction flow.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 12/13 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 2, 2026 12:36

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

A new exported hook (useLazyGetCardStatusQuery) is not covered by the existing API export assertions, so a regression could slip through without tests catching it.

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

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 12/13 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines 125 to 129
useGetUserQuery,
useOrderCardMutation,
useGetCardStatusQuery,
useLazyGetCardStatusQuery,
useGetInternalWalletsQuery,
@philipptpunkt
philipptpunkt force-pushed the feat/LIVE-34772-card-linked-wallet-balances branch from ce1f477 to 9a51816 Compare September 2, 2026 14:11
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-interaction branch from 3334db0 to 56bb53b Compare September 2, 2026 14:12
@philipptpunkt
philipptpunkt force-pushed the feat/LIVE-34772-card-linked-wallet-balances branch from 9a51816 to 79b3b58 Compare September 2, 2026 14:52
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-interaction branch from 56bb53b to a7e9e5b Compare September 2, 2026 14:52
Copilot AI review requested due to automatic review settings September 2, 2026 14:52

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 native devtool shows a “Balance” row with a chevron but no navigation/handler, creating a misleading non-functional UI element.

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

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 12/13 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +51 to +61
<ListItem>
<ListItemLeading lx={{ paddingHorizontal: "s16" }}>
<Spot appearance="icon" icon={CoinsCrypto} />
<ListItemContent>
<ListItemTitle>Balance</ListItemTitle>
</ListItemContent>
</ListItemLeading>
<ListItemTrailing lx={{ paddingHorizontal: "s16" }}>
<ChevronRight />
</ListItemTrailing>
</ListItem>
@live-github-bot

live-github-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Desktop Bundle Checks

Comparing d5dedab against 0862d37.

✅ Previous issues have all been fixed.

Mobile Bundle Checks

Comparing def53c8 against 0862d37.

✅ Previous issues have all been fixed.

@philipptpunkt
philipptpunkt force-pushed the feat/LIVE-34772-card-linked-wallet-balances branch from 79b3b58 to c6be950 Compare September 2, 2026 15:22
Copilot AI review requested due to automatic review settings September 2, 2026 15:22
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-interaction branch from a7e9e5b to dac8f4e Compare September 2, 2026 15:22

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

It currently exposes sensitive cardholder data in the devtool probe output and includes a misleading non-functional “Balance” navigation row on native.

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

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (1)

devtools/pay-card/src/pay-card/PayCard.native.tsx:64

  • The "Balance" row renders a navigation chevron but is not pressable (no onPress), which is misleading and can look like a broken link in the devtool UI. Either wire an action or mark the row as disabled and remove the chevron until it’s implemented.
      <ListItem>
        <ListItemLeading lx={{ paddingHorizontal: "s16" }}>
          <Spot appearance="icon" icon={CoinsCrypto} />
          <ListItemContent>
            <ListItemTitle>Balance</ListItemTitle>
          </ListItemContent>
        </ListItemLeading>
        <ListItemTrailing lx={{ paddingHorizontal: "s16" }}>
          <ChevronRight />
        </ListItemTrailing>
      </ListItem>
  • Files reviewed: 12/13 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +162 to +166
label: "Card Status",
isFetching: cardStatus.isFetching,
result: cardStatus.data === undefined ? undefined : JSON.stringify(cardStatus.data, null, 2),
error: cardStatus.error === undefined ? undefined : describeError(cardStatus.error),
run: () => {
The Card endpoints have no UI yet, so nothing shows whether they return what
we expect. The devtool can call them once the cardholder is signed in and print
the response.

- "Card interaction" opens over the tool's own body and lists one entry per
  endpoint, with the last response or error underneath. Sub-views live in the
  tool: the shell's navigator only knows categories, tools and tool.
- The first entry is the card status. Adding an endpoint is one probe in the
  binding, which keeps the tool component free of app state as before.
- Export `useLazyGetCardStatusQuery`: a probe fetches on press, not on mount.
@philipptpunkt
philipptpunkt force-pushed the feat/LIVE-34772-card-linked-wallet-balances branch from c6be950 to 65ff32b Compare September 2, 2026 15:43
@philipptpunkt
philipptpunkt force-pushed the feat/pay-card-devtools-card-interaction branch from dac8f4e to 07964e6 Compare September 2, 2026 15:43
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
70.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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