Skip to content

feat(contacts): add prefilled Add Address flow state and UI (LIVE-35745) - #20910

Open
claudiiafg wants to merge 1 commit into
developfrom
feat/LIVE-35745_prefill-add-address-flow
Open

feat(contacts): add prefilled Add Address flow state and UI (LIVE-35745)#20910
claudiiafg wants to merge 1 commit into
developfrom
feat/LIVE-35745_prefill-add-address-flow

Conversation

@claudiiafg

@claudiiafg claudiiafg commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds startWithPrefilled / entryMode and public prefill types in @features/flow-contacts.
  • Desktop naming screen is name-only (input + validation + disclaimer); destination address is not shown.
  • Adds review UI (web + native) for the prefilled path; MAD-based Add Address behavior stays unchanged.

Test plan

  • Unit tests for startWithPrefilled, naming UI, review UI, and MAD regression pass in @features/flow-contacts
  • Prefill start lands on namingAddress and skips MAD / address entry
  • Invalid supplied address does not open naming
  • Prefill continues to review with address / currency / network / name data available in state

Stacked under: app wiring PR (next)

@claudiiafg
claudiiafg requested a review from a team as a code owner August 18, 2026 15:41
Copilot AI lite review requested due to automatic review settings August 18, 2026 15:41
@github-actions

Copy link
Copy Markdown
Contributor

Web Tools Build Status

Build Status Deployment
Web Tools Build ⏭️ Skipped
Native Storybook Build ⏭️ Skipped
React Storybook Build ⏭️ Skipped

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds a “prefilled” entry path for the Add Address flow (bypassing MAD + manual entry), introduces a dedicated Review screen, and adapts the existing flow/state to carry display context needed for review.

Changes:

  • Added startWithPrefilled to the Add Address flow view model, plus new types to support “prefilled” sessions.
  • Introduced Review UI (web + native) and wired it into flow rendering for the prefilled path.
  • Simplified the Name step UI on web (removes confirmed-address read-only field, adds disclaimer banner) and updated tests accordingly.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
features/flow/contacts/src/steps/AddAddress/web.ts Re-exports Review component/types for web consumers.
features/flow/contacts/src/steps/AddAddress/useContactsAddAddressEntryViewModel.web.test.ts Updates name labels test data to match removed validAddress label.
features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.web.test.ts Adds coverage for startWithPrefilled and updates state expectations (entryMode/displayContext).
features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts Adds “prefilled” start API, extends session state with entry mode + display context, and updates navigation logic.
features/flow/contacts/src/steps/AddAddress/types.ts Introduces display context / entry mode / prefill params & result types; extends view model interface.
features/flow/contacts/src/steps/AddAddress/prefillAddAddress.ts Defines public API types for opening a prefilled Add Address flow from other features.
features/flow/contacts/src/steps/AddAddress/native.ts Re-exports native Review component/types.
features/flow/contacts/src/steps/AddAddress/index.ts Exposes new prefillAddAddress types at the step index.
features/flow/contacts/src/steps/AddAddress/Review/useContactsAddAddressReviewViewModel.web.ts Adds a small VM to map flow state into Review view props.
features/flow/contacts/src/steps/AddAddress/Review/types.ts Adds Review labels/props/view-props types.
features/flow/contacts/src/steps/AddAddress/Review/index.ts Barrel export for Review (web) + its types.
features/flow/contacts/src/steps/AddAddress/Review/ContactsAddAddressReviewView.web.tsx Adds the web Review UI.
features/flow/contacts/src/steps/AddAddress/Review/ContactsAddAddressReviewView.web.test.tsx Adds test coverage for the web Review UI.
features/flow/contacts/src/steps/AddAddress/Review/ContactsAddAddressReview.web.tsx Hooks web Review VM into the web Review view.
features/flow/contacts/src/steps/AddAddress/Review/ContactsAddAddressReview.native.tsx Adds the native Review UI.
features/flow/contacts/src/steps/AddAddress/Flow/ContactsAddAddressFlowContent.web.tsx Wires Review step into web flow; switches reviewing rendering by entryMode.
features/flow/contacts/src/steps/AddAddress/Flow/ContactsAddAddressFlowContent.web.test.tsx Updates flow tests for new labels + prefilled review rendering.
features/flow/contacts/src/steps/AddAddress/Flow/ContactsAddAddressFlowContent.native.tsx Adds a new native “review” step slot and props for rendering Review.
features/flow/contacts/src/steps/AddAddress/AddressName/useContactsAddAddressNameViewModel.web.ts Removes address from name-step VM (no longer displayed).
features/flow/contacts/src/steps/AddAddress/AddressName/types.ts Removes address/validAddress from Name step types/labels.
features/flow/contacts/src/steps/AddAddress/AddressName/Input/ContactsAddAddressNameInput.web.test.tsx Updates tests to reflect removed confirmed-address field and label changes.
features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressNameView.web.tsx Removes confirmed-address component and adds disclaimer banner.
features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressNameView.web.test.tsx Updates tests for new Name step rendering (no address, disclaimer present).
features/flow/contacts/README.md Documents the new prefilled Add Address entry mode.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts Outdated
Comment thread features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ E2E tests are required

Changes detected require e2e testing before merge (even before asking for any review).

🖥️ Desktop

-> Run Desktop E2E

  • Select "Run workflow"
  • Branch: feat/LIVE-35745_prefill-add-address-flow
  • Device: nanoSP or stax

📱 Mobile

-> Run Mobile E2E

  • Select "Run workflow"
  • Branch: feat/LIVE-35745_prefill-add-address-flow
  • Device: nanoX

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 7 projects in monorepo, 2 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
desktop-main 2.3 MB - 0 -
desktop-preloader 7.1 KB - 0 -
desktop-renderer 81.3 MB - +3.4 KB (0.0%) -
desktop-webviewDappPreloader 36.9 KB - 0 -
desktop-webviewPreloader 200.0 B - 0 -
desktop-workers 36.8 KB - 0 -
mobile 127.8 MB - +9.9 KB (0.0%) -
📋 Detailed Reports (Click to expand)

📁 desktop-renderer

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

📌 Baseline Commit: de943ec950962047eda29062de69db15421e95c8 | PR: #20889

Metric Current Baseline Change
📊 Total Size 81.3 MB 81.3 MB +3.4 KB (0.0%)
🗜️ Gzip Size - - -
📄 JavaScript 29.9 MB 29.9 MB +3.4 KB (0.0%)
🎨 CSS 184.6 KB 184.6 KB 0
🌐 HTML 1.8 KB 1.8 KB 0
📁 Other Assets 51.2 MB 51.2 MB 0

📦 Download Diff Report: desktop-renderer Bundle Diff

📁 mobile

Path: rsdoctor/mobile/rsdoctor-data.json

📌 Baseline Commit: de943ec950962047eda29062de69db15421e95c8 | PR: #20889

Metric Current Baseline Change
📊 Total Size 127.8 MB 127.8 MB +9.9 KB (0.0%)
🗜️ Gzip Size - - -
📄 JavaScript 112.4 MB 112.4 MB +9.9 KB (0.0%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 15.4 MB 15.4 MB 0

📦 Download Diff Report: mobile Bundle Diff

Generated by Rsdoctor GitHub Action

Copilot AI review requested due to automatic review settings August 18, 2026 17: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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (3)

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:87

  • createMadDisplayContext derives networkId and network.displayName from the selected currency (currencyId/assetDisplayName). This will produce incorrect network context for non-native assets (e.g., token selection where currency display name ≠ network display name), and networkId may not represent a network at all. Consider extending AddAddressCurrencySelection to include a real network (or a networkId/networkDisplayName), or derive the network context via a mapping/port so displayContext.network is accurate.
function createMadDisplayContext(selection: AddAddressCurrencySelection): AddAddressDisplayContext {
  return {
    assetDisplayName: selection.assetDisplayName,
    network: {
      networkId: selection.currencyId,
      displayName: selection.assetDisplayName,
    },
  };
}

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:148

  • When a validation result becomes stale (request id mismatch), startWithPrefilled returns { status: \"unavailable\" }, which conflates "stale/cancelled" with actual service unavailability. This can mislead callers into treating a user-driven cancellation/race as an outage. Suggest adding an explicit status (e.g., cancelled/stale) to PrefillAddAddressStartResult (and aligning with OpenPrefillAddAddressResult, which already includes cancelled), then return that status here instead.
      if (validationRequestId.current !== requestId) {
        return { status: "unavailable" };
      }

features/flow/contacts/src/steps/AddAddress/Review/useContactsAddAddressReviewViewModel.web.ts:18

  • A new view-model (useContactsAddAddressReviewViewModel) is introduced but doesn’t have direct unit coverage. Adding a small test to assert the mapping (resolved address vs. display context fields, and that onContinue is forwarded) would help prevent accidental regressions as the Review UI evolves.
export function useContactsAddAddressReviewViewModel({
  addressEntry,
  addressLabel,
  displayContext,
  labels,
  onContinue,
}: ContactsAddAddressReviewProps): ContactsAddAddressReviewViewProps {
  return {
    address: addressEntry.resolvedAddress,
    currency: displayContext.assetDisplayName,
    network: displayContext.network.displayName,
    name: addressLabel.label,
    labels,
    onContinue,
  };
}

Copilot AI review requested due to automatic review settings August 18, 2026 17:40

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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (4)

features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressNameView.web.tsx:36

  • The changeset text says this PR keeps the existing MAD path unchanged, but the web naming step is now ‘name-only’ for all entry modes (the confirmed address UI was removed). If the intent is to change only the prefilled path, consider passing entryMode (or a flag) into the naming view and conditionally rendering the confirmed address section for entryMode: \"mad\"; otherwise update the changelog/description to reflect the MAD UX change.
    <div className="flex flex-col gap-24">
      <TextInput
        autoComplete="off"
        autoCorrect="off"
        data-testid="contacts-add-address-name-input"
        helperText={validationMessage}
        hideClearButton
        label={labels.inputLabel}
        maxCount={CONTACT_ADDRESS_LABEL_MAX_LENGTH}
        maxLength={CONTACT_ADDRESS_LABEL_MAX_LENGTH}
        onChange={onAddressLabelChange}
        spellCheck={false}
        status={addressLabel.status === "invalid" ? "error" : undefined}
        value={addressLabel.value}
      />
      <Banner
        appearance="info"
        aria-label={labels.namingDisclaimerAccessibilityLabel}
        data-testid="contacts-add-address-name-disclaimer"
        description={labels.namingDisclaimer}
      />

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:148

  • This branch represents a superseded/cancelled startWithPrefilled call (requestId mismatch), but it returns { status: \"unavailable\" }, which is also used for genuine validation-port unavailability. That conflates two different outcomes and can cause callers to show the wrong error state. Consider adding an explicit { status: \"cancelled\" } (or similar) to PrefillAddAddressStartResult and returning that here, while reserving unavailable for validationResult.status === \"unavailable\".
      if (validationRequestId.current !== requestId) {
        return { status: "unavailable" };
      }

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:87

  • AddAddressDisplayContext.network is populated from selection.currencyId / selection.assetDisplayName, which makes the field name network misleading (it’s effectively duplicating the asset/currency selection, not a network context). To avoid confusion and future UI bugs (especially if Review is later enabled for MAD), consider either (a) renaming network to reflect what it contains in the MAD path, or (b) extending AddAddressCurrencySelection to include an actual network context and using that here.
function createMadDisplayContext(selection: AddAddressCurrencySelection): AddAddressDisplayContext {
  return {
    assetDisplayName: selection.assetDisplayName,
    network: {
      networkId: selection.currencyId,
      displayName: selection.assetDisplayName,
    },
  };
}

features/flow/contacts/src/steps/AddAddress/prefillAddAddress.ts:20

  • The invalid_address.error union is duplicated here and also in PrefillAddAddressStartResult (in types.ts). Duplicating these string unions tends to drift over time. Consider extracting a shared exported type (e.g., PrefillAddAddressInvalidReason) and reusing it in both result types.
export type OpenPrefillAddAddressResult =
  | Readonly<{ status: "saved"; address: ContactAddress }>
  | Readonly<{ status: "cancelled" }>
  | Readonly<{
      status: "invalid_address";
      error: "invalid_format" | "domain_not_found" | "sanctioned";
    }>
  | Readonly<{ status: "unavailable" }>
  | Readonly<{ status: "confirmation_failed" }>;

Copilot AI review requested due to automatic review settings August 19, 2026 08:23
@claudiiafg
claudiiafg force-pushed the feat/LIVE-35745_prefill-add-address-flow branch from 0c8f756 to 2c7a376 Compare August 19, 2026 08:23

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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (3)

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:148

  • A request-id mismatch indicates the validation was superseded/cancelled (e.g., another validation started), but returning { status: \"unavailable\" } conflates cancellation with service unavailability. Consider introducing a distinct result (e.g., cancelled / superseded) and handling it separately so callers don’t show an erroneous ‘service unavailable’ error state.
      if (validationRequestId.current !== requestId) {
        return { status: "unavailable" };
      }

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:134

  • cancelAddressValidation() already increments validationRequestId, and then startWithPrefilled increments it again via current + 1. This double-step isn’t wrong, but it makes the cancellation semantics harder to reason about. Prefer a single, consistent way to advance the request id (either use cancelAddressValidation() and then read validationRequestId.current, or inline the increment once) to reduce confusion and future bugs.
      cancelAddressValidation();
      const existingAddressLabels = params.contact.addresses.map(address => address.label);
      const normalizedAddress = params.address.trim();
      const requestId = validationRequestId.current + 1;
      validationRequestId.current = requestId;

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:154

  • The new startWithPrefilled branch for an unavailable validation result is not covered by a test in useAddAddressFlowViewModel.web.test.ts. Add a unit test where createValidationPort({ status: \"unavailable\" }) is returned, and assert that startWithPrefilled returns { status: \"unavailable\" } and the flow state is closed.
      if (validationResult.status === "unavailable") {
        setState(CLOSED_ADD_ADDRESS_FLOW_STATE);
        return { status: "unavailable" };
      }

Copilot AI review requested due to automatic review settings August 19, 2026 09:27
@claudiiafg
claudiiafg force-pushed the feat/LIVE-35745_prefill-add-address-flow branch from 2c7a376 to 17d420e Compare August 19, 2026 09:27

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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (2)

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:404

  • The reviewingAddress branch in goBack duplicates the same transition logic for prefilled and non-prefilled modes. This can be simplified by removing the entryMode conditional and performing the shared { origin, ...session } + ternary return once, reducing risk of future divergence.
          if (currentState.entryMode === "prefilled") {
            const { origin, ...session } = currentState;
            return origin === "addressDetails"
              ? { ...session, status: "enteringAddress" }
              : { ...session, status: "namingAddress" };
          }
          const { origin, ...session } = currentState;
          return origin === "addressDetails"
            ? { ...session, status: "enteringAddress" }
            : { ...session, status: "namingAddress" };

features/flow/contacts/src/steps/AddAddress/AddressName/Input/ContactsAddAddressNameInput.web.test.tsx:19

  • Using as never in tests sidesteps the type system and can mask real integration issues (e.g., when resolvedAddress is a branded/validated address type). Prefer constructing a correctly-typed value (e.g., via the existing schema/parser or a small typed test helper) so the tests fail if the contract changes.
      value: "0xabc",
      resolvedAddress: "0xabc" as never,

@claudiiafg
claudiiafg force-pushed the feat/LIVE-35745_prefill-add-address-flow branch from 17d420e to f520465 Compare August 19, 2026 09:46
Copilot AI review requested due to automatic review settings August 19, 2026 10:01
@claudiiafg
claudiiafg force-pushed the feat/LIVE-35745_prefill-add-address-flow branch from f520465 to 0e97f7d Compare August 19, 2026 10:01

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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (4)

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:405

  • The reviewingAddress branch duplicates the exact same logic for prefilled vs non-prefilled modes. This can be simplified by removing the entryMode conditional and keeping a single origin-based transition, which reduces branching and future risk of one path diverging unintentionally.
        case "reviewingAddress": {
          if (currentState.entryMode === "prefilled") {
            const { origin, ...session } = currentState;
            return origin === "addressDetails"
              ? { ...session, status: "enteringAddress" }
              : { ...session, status: "namingAddress" };
          }
          const { origin, ...session } = currentState;
          return origin === "addressDetails"
            ? { ...session, status: "enteringAddress" }
            : { ...session, status: "namingAddress" };
        }

features/flow/contacts/src/steps/AddAddress/AddressName/Input/ContactsAddAddressNameInput.web.test.tsx:20

  • resolvedAddress: "0xabc" as never defeats type safety and makes the test less representative of real usage. Prefer constructing a correctly-typed resolved address (e.g., via the same schema/parser used elsewhere in tests) rather than forcing the type system with as never.
      value: "0xabc",
      resolvedAddress: "0xabc" as never,
      inputMethod: "manual",

features/flow/contacts/src/steps/AddAddress/AddressName/ContactsAddAddressNameView.web.test.tsx:16

  • This test uses a plain string for address, while production code likely uses a parsed/branded address type (as seen previously in this test file before the change). Using the real parsed type (schema/parse helper) will keep tests aligned with the domain model and catch regressions around formatting/typing earlier.
    address: "0xabc",

features/flow/contacts/src/steps/AddAddress/Flow/ContactsAddAddressFlowContent.web.tsx:129

  • For entryMode === "prefilled", the Review UI is effectively required for the intended UX, but reviewLabels is optional and silently falls back to the confirmation-style ContactsAddAddressCompletion. Consider making reviewLabels required when the caller intends to support the prefilled mode (or provide internal default labels) to avoid an unexpected/incorrect screen when reviewLabels is omitted.
    case "reviewingAddress":
      if (
        state.entryMode === "prefilled" &&
        state.displayContext !== null &&
        reviewLabels !== undefined
      ) {
        return (
          <ContactsAddAddressReview
            addressEntry={state.addressEntry}
            addressLabel={state.addressLabel}
            displayContext={state.displayContext}
            labels={reviewLabels}
            onContinue={onContinueFromReview}
          />
        );
      }
      return (
        <ContactsAddAddressCompletion

Copilot AI review requested due to automatic review settings August 19, 2026 10:03

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.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.

Suppressed comments (4)

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.ts:404

  • The reviewingAddress goBack logic is duplicated for prefilled vs non-prefilled, but both branches currently return the exact same result. This duplication increases maintenance cost and makes future changes error-prone; consider removing the entryMode conditional and keeping a single origin-based return path.
          if (currentState.entryMode === "prefilled") {
            const { origin, ...session } = currentState;
            return origin === "addressDetails"
              ? { ...session, status: "enteringAddress" }
              : { ...session, status: "namingAddress" };
          }
          const { origin, ...session } = currentState;
          return origin === "addressDetails"
            ? { ...session, status: "enteringAddress" }
            : { ...session, status: "namingAddress" };

features/flow/contacts/src/steps/AddAddress/Flow/ContactsAddAddressFlowContent.web.tsx:135

  • For entryMode === "prefilled", rendering the dedicated Review step depends on reviewLabels being provided; otherwise the UI silently falls back to the completion/“confirm on device” screen. If the intent is “dedicated review step” for prefilled flows, this optionality can cause incorrect UX at runtime. Consider making reviewLabels required (at least when entryMode is prefilled) or providing a safe default label set / explicit error behavior to avoid silent fallback.
      if (
        state.entryMode === "prefilled" &&
        state.displayContext !== null &&
        reviewLabels !== undefined
      ) {
        return (
          <ContactsAddAddressReview
            addressEntry={state.addressEntry}
            addressLabel={state.addressLabel}
            displayContext={state.displayContext}
            labels={reviewLabels}
            onContinue={onContinueFromReview}
          />
        );
      }
      return (
        <ContactsAddAddressCompletion
          buttonLabel={completionLabels.continue}
          onContinue={onContinueFromReview}
          testID="contacts-add-address-review"
          title={completionLabels.title}
        />
      );

features/flow/contacts/src/steps/AddAddress/AddressName/Input/ContactsAddAddressNameInput.web.test.tsx:21

  • The test uses resolvedAddress: "0xabc" as never, which defeats type-safety and can hide real contract mismatches between the component and domain types. Prefer constructing a valid resolvedAddress using the same schema/type used elsewhere in tests (e.g., parsing a valid address value) so the test fails if the domain type changes.
    addressEntry: {
      status: "valid",
      value: "0xabc",
      resolvedAddress: "0xabc" as never,
      inputMethod: "manual",
    },

features/flow/contacts/src/steps/AddAddress/useAddAddressFlowViewModel.web.test.ts:1055

  • The tests cover goBack() from the prefilled naming step, but the prefilled path also introduces new navigation behavior from the reviewingAddress step (e.g., returning to naming vs entering-address based on origin). Adding a unit test that enters reviewingAddress via the prefilled path and asserts goBack() returns to namingAddress would better lock down the new behavior.
    it("should close the prefilled naming step on back without returning to address entry", async () => {
      const contact = mockContact({ addresses: [] });
      const addressValidation = createValidationPort();
      const { result } = renderHook(() => useAddAddressFlowViewModel({ addressValidation }));

      await act(async () => {
        await result.current.startWithPrefilled({
          contact,
          address: RAW_ADDRESS,
          currency: ETHEREUM_SELECTION,
          network: ETHEREUM_NETWORK,
        });
      });
      act(() => result.current.goBack());

      expect(result.current.state).toEqual({ status: "closed" });
    });

@claudiiafg
claudiiafg force-pushed the feat/LIVE-35745_prefill-add-address-flow branch from 0e97f7d to f663af9 Compare August 19, 2026 10:07
Copilot AI review requested due to automatic review settings August 19, 2026 15:19
@claudiiafg
claudiiafg force-pushed the feat/LIVE-35745_prefill-add-address-flow branch from f663af9 to 0a2d557 Compare August 19, 2026 15:19

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.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.

Suppressed comments (2)

features/flow/flow-contacts-add-address/src/screens/AddressName/components/Input/ContactsAddAddressNameInput.web.test.tsx:20

  • resolvedAddress: "0xabc" as never bypasses the branded ContactAddressValue type and can let invalid test fixtures slip through. Prefer creating a valid branded value via ContactAddressValueSchema.parse(...) (as the tests did previously) so the fixture matches real runtime data.
    addressEntry: {
      status: "valid",
      value: "0xabc",
      resolvedAddress: "0xabc" as never,
      inputMethod: "manual",

features/flow/flow-contacts-add-address/src/screens/Flow/ContactsAddAddressFlowContent.web.tsx:117

  • When state.entryMode === "prefilled", the flow should always show the dedicated review UI. Currently, if reviewLabels is omitted, the component silently falls back to the generic completion screen, effectively skipping the review step and hiding the address/currency/network details. Consider making reviewLabels required (or at least fail fast/render an explicit error) whenever the prefilled review path can be reached.
      if (
        state.entryMode === "prefilled" &&
        state.displayContext !== null &&
        reviewLabels !== undefined
      ) {

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants