Skip to content

fix(dashpay): show the username on every Receive option - #1491

Merged
romchornyi merged 24 commits into
developfrom
fix/receive-username-every-option
Dec 1, 2026
Merged

romchornyi merged 24 commits into
developfrom
fix/receive-username-every-option

Conversation

@romchornyi

@romchornyi romchornyi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

MO-1123: "Every tab uses the same design and also shows the user's username, which the user can
copy." On Receive only the Identity card showed the username; Core, Shielded and Platform did not.

What was done?

  • Core, Shielded and Platform show the same Username row as the Identity card (label, username
    cut in the middle when it does not fit, copy button, tap-to-copy, the same «Copied» toast),
    above the address.
  • The row shows whenever the Current identity has a username, with Advanced Mode on or off, as
    the legacy Receive screen did. Without a username there is no row, and the lock screen's Quick
    Receive, which runs before unlock, never shows or copies it.
  • No view-model change: receiveIdentity already holds the username independent of Advanced
    Mode; only the Identity option needs Advanced Mode.
  • docs/features/identity-receive/README.md: AC-09 reworded, AC-15 added.

How Has This Been Tested?

  • PaymentsLandingIdentityOptionTests + ReceiveOptionTests (39 tests) pass on an iPhone 17
    simulator, Debug, against platform 6e113dc808 (the .platform-ref pin), at eecfd3b7c.
  • Every card and Copy read one shownUsername. Tests: it is shown and copied on Core and
    Shielded with Advanced Mode off and on every option with it on, and no option shows it without
    a username (AC-15). The SwiftUI card itself is not rendered by a test; the manual check is in
    the QA backlog.
  • Previews: Core with a username, Platform with a username, a long username at 375 pt.
  • scripts/a11y_audit.py --check: no new findings.
  • Not checked on a simulator with a real username: that needs a registered testnet identity
    (money), so it is a manual check on the identity-receive QA case. The existing flow
    payments/receive_no_identity_option_without_username still covers the no-username case
    (no row).

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • ADR (ADR-0001): no significant decision
  • Nothing in this PR (files, commit messages, branch name, description, comments, attachments, linked issues) holds customer data, unfixed vulnerability detail, secrets, or step-by-step attack detail against keys, PIN or encryption; such content is left out and handled privately with the maintainers (ADR-0001, rule 2)

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone
  • If workflow-lint warned that a release-only step or .xcode-version changed, or a .platform-ref bump changed platform's Rust version, I ran the affected workflow by hand from this branch on the final commit (release-dashpay-testflight.yml with wallet_ref = that commit and release_channel: internal-only; appstore-schema-release.yml with dry_run: true) and linked the run here; a later push needs a new run

🤖 Generated with Claude Code

romchornyi and others added 11 commits November 10, 2026 10:55
…n its credits rise

With Advanced Mode on and a username on the Current identity, Receive
offers a fourth option, Identity, on both Receive presentations. The
card shows a QR of the bare Base58 Identity ID, the ID and the username
with Copy, Share ID, a disabled Specify amount, and a warning that
identity funds pay for Dash apps and usernames and that most exchanges
send only to Core. The option follows Advanced Mode, registration, the
active wallet, the network and the username while Receive is open.

IdentityCreditsWatcher reads the identity's credits every 5 s while the
card is on screen and the app is in the foreground, from a fresh read
on opening, and shows a Receipt when they rise. Every own identity
top-up posts IdentityTopUpDidComplete with the credits it supplied, and
the watcher moves its starting balance up by them. Receive options are
a Receive-only ReceiveOption enum. The option row scrolls sideways when
the four titles do not fit.

ADR-0033, ADR-0034; summary in docs/features/identity-receive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: e1ead3523146b0a11852b80a2e027e69c97767a5
The Identity card is taller than the payments page on an iPhone 17:
laid out without a scroll view, it squeezed the warning to one
truncated line per sentence and pushed Close off the top. The Receive
tab now scrolls vertically, only when its card does not fit; a
sideways swipe still changes tab.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: d96f6c94b29a3e626644e2df1da230a712066ad4
- Keep the pinned To card in the balance-row receive sheet while Identity
  is picked on Receive.
- Announce an identity top-up retried from its asset lock, so its credits
  raise no Received receipt.
- Merge develop; the ADR index keeps ADR-0007 and ADR-0031.

SDD-Published-From: cfcd6d355057c3da604a9d622df49aedd7dcaafa
Closes the review finding on the own-top-up ordering race: every announced
identity top-up is registered in IdentityTopUpsInFlight while it runs, and
the Receive watcher raises no Receipt and takes no Starting balance
meanwhile. Regression tests cover a rise read before the announcement and a
top-up already running when the watch starts. ADR-0034 updated.

SDD-Published-From: dd5a4713945c6882e1a0f5e4c22272b84803fff5
…turned

Closes the review finding on own-top-up attribution: IdentityTopUpDidComplete
now carries the balance the top-up's transition returned and the credits it
was handed, and the Receive watcher sets its Starting balance to the lower of
that balance and its Starting balance plus those credits. A spend from
elsewhere while the top-up runs no longer turns it into a Receipt. Regression
test added; ADR-0034 updated.

SDD-Published-From: 4816425e490280eba3e42cfdecc91d3ac1949840
Merges develop (#1254 uncertain top-ups and asset-lock retries; platform
pin dabbec09c9): the identity top-up resume keeps develop's outcome
classification and still announces a confirmed resume, and the profile
top-up uses develop's canTopUp guard.

Review (CodeRabbit): AC-08 in the README now says credits that land
before the first successful read are part of the starting balance; the
Ukrainian "Identity" is «Ідентифікатор» instead of «Ідентично».

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 86e2a7b0fad15b8eeca9ca9f0157c95b6902645d
…p-up split in the harness, merge develop

- AssetLockRecoveryService announces a recovered top-up only under DASHPAY;
  dashwallet resumes as before, and IdentityTopUpsInFlight leaves that target.
- The identity top-up compatibility harness extracts executeTopUp and
  suppliedCredits and the production completion event and in-flight
  registry, and checks that a completed top-up announces its supplied credits.
- README AC-06: a lower balance becomes the new starting balance.
- develop merged; the Receive options ADR is renumbered 0033 -> 0035 after
  develop's ADR-0033.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 2a03c39215db1776c10b8c750c8a522eda542437
…rop the no-op guard

IdentityCreditsWatcher is compiled in dashwallet and uses the in-flight
registry, so the file goes back into that target. dashwallet defines
DASHPAY in every configuration, so the recovery announcement guard added
in the previous commit changed nothing and is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 99a8c5f0e6834b30a7a15a3c1e9bad06aa39e249
The ADR index keeps develop's Superseded ADR-0033 and adds ADR-0034 and ADR-0035.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SDD-Published-From: 8ac1d5b9bb13b66d4ebd31da5e4ab61631854917
Renumber ADR-0035 (Model Receive options as a Receive-only enum) to
ADR-0064: develop took 0035 for the vote-attempt state machine, and 0036
to 0063 are taken by develop or other open PRs. Drop the "Most votes" and
"Most lock votes" strings that develop removed with the voting list rework.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
MO-1123 asks every Receive option to show the user's username, which the
user can copy; only the Identity card did. Core, Shielded and Platform now
show the same Username row above the address whenever the Current identity
has a username, with Advanced Mode on or off (AC-15).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 01f00b21-0e17-4f42-97d4-464c9e0ccff2
Commits

Reviewing files that changed from the base of the PR and between 55b4120 and e417eea.

Files selected for processing: 4

  • DashWallet/Sources/UI/Payments/Landing/Components/PaymentsReceiveContent.swift
  • DashWallet/Sources/UI/Payments/Landing/PaymentsLandingViewModel.swift
  • DashWalletTests/PaymentsLandingIdentityOptionTests.swift
  • docs/features/identity-receive/README.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

thepastaclaw commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

⏹️ Not reviewed — PR is closed (merged) (commit e417eea)

@thepastaclaw thepastaclaw 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.

Final validation — Phase 1 + Phase 2

Core, Shielded, and Platform Receive cards now reuse the Identity card’s copyable Username row above the address, without changing which options are offered or what their QR codes contain. Simulator XCTest, test-target membership, workflow lint, and the accessibility audit passed on the reviewed head; the automated review check was still pending.

🟡 1 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.2-sol (effort low) — The diff makes a contained SwiftUI behavior change by reusing the existing username display and copy behavior across Receive options without changing address generation, wallet logic, or funds movement.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 87% left, weekly 57% left; passed over gemini-3.8-flash-high (lane failed)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `DashWalletTests/PaymentsLandingIdentityOptionTests.swift`:
- [SUGGESTION] DashWalletTests/PaymentsLandingIdentityOptionTests.swift:152-163: The AC-15 test passes even if the Receive Username row is missing
  Impact: Users could lose the ability to copy their username from a Receive card without the new test catching it.
  Removing the Username row or disconnecting either copy control would leave this test green. It never renders a Receive card and calls the unchanged view-model pasteboard method directly, so it would also pass against the base implementation. With Advanced Mode off, the loop visits only Core and Shielded; adding Platform to the loop would still bypass the UI. Add a focused UI regression check with a known username, or record a manual QA run for Core and Shielded with Advanced Mode off and Platform with it on. On each card, verify that the row appears above the address and that tapping either the username text or the copy button copies the full username and shows the Copied toast.

Comment on lines +152 to +163
func testUsernameIsKeptAndCopiedOnEveryChainOptionWithAdvancedModeOff() throws {
let model = PaymentsLandingViewModel.makeForPreview(activeTab: .receive)
model.updateReceiveState(isAdvancedMode: false, identity: try identity)
XCTAssertEqual(model.receiveOptions, [.core, .shielded])

for option in model.receiveOptions {
model.network = option
XCTAssertEqual(model.receiveIdentity?.username, "alice", "\(option)")
UIPasteboard.general.string = nil
model.copyUsernameToPasteboard()
XCTAssertEqual(UIPasteboard.general.string, "alice", "\(option)")
}

@thepastaclaw thepastaclaw Nov 24, 2026 •

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.

⏭️ Deferred (maintainer decision; not blocking; tracked in #1557) at e417eeab; see the replies below.

🟡 Suggestion: The AC-15 test passes even if the Receive Username row is missing
Impact: Users could lose the ability to copy their username from a Receive card without the new test catching it.

Removing the Username row or disconnecting either copy control would leave this test green. It never renders a Receive card and calls the unchanged view-model pasteboard method directly, so it would also pass against the base implementation. With Advanced Mode off, the loop visits only Core and Shielded; adding Platform to the loop would still bypass the UI. Add a focused UI regression check with a known username, or record a manual QA run for Core and Shielded with Advanced Mode off and Platform with it on. On each card, verify that the row appears above the address and that tapping either the username text or the copy button copies the full username and shows the Copied toast.

source: glm-5.3-flash (phase1-reviewer: general); gpt-6.2-sol (phase2-reviewer: general)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eecfd3b: every Receive card shows and copies one value. Both Username rows (Core, Shielded and Platform, and the Identity card) and copyUsernameToPasteboard now read PaymentsLandingViewModel.shownUsername instead of their own copies of receiveIdentity?.username.

Tests:

  • testEveryReceiveOptionShowsAndCopiesTheUsername: Core and Shielded with Advanced Mode off, and every option with it on.
  • testNoUsernameShowsNoRowOnAnyOption: no option shows the row without a username.

The card is still not rendered in a test. The visual check (the row above the address; tapping the text and tapping the button both copy, with the Copied toast) needs a testnet identity with a username, so it is a manual run on the QA case identity-receive, recorded in the QA backlog.

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.

Still applies (re-reviewed at eecfd3b7): Sharing shownUsername and expanding the option matrix verify that the model supplies the same value across the cards, but neither test invokes the card's copy callback. The existing height test already hosts the screen with a synthetic alice identity, so you can check row presence without testnet registration; the QA backlog entry documents the planned interaction check, not its result.

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.

Needs a tracking issue (re-reviewed at e417eeab): Deferring this needs a tracking issue for the follow-up, and none is linked in this thread, the PR description or the PR comments. Link one, or ask here and I'll file it; until then the finding stands.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, the row itself is not pinned by a test. Please file a tracking issue: a hosted-card test that fails when the Username row is removed on Core, Shielded or Platform. Tapping the text and the button stays in the manual identity-receive QA case.

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.

Thanks, agreed. I’ll defer the hosted-card regression check to a follow-up issue; the manual username interaction verification remains in the identity-receive QA case.

Filed #1557 for the follow-up. Deferred on a maintainer's call: this finding no longer blocks this pull request.

romchornyi and others added 2 commits November 24, 2026 19:21
Every Receive card and Copy read one `shownUsername`; the tests check it
on Core and Shielded with Advanced Mode off and on every option with it
on, and that no option shows it without a username.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@thepastaclaw thepastaclaw 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.

Re-review — Final validation — Phase 1 + Phase 2

New on this head: At eecfd3b, both Receive card layouts and the copy action now read the same shownUsername, and the view-model tests cover every offered option in both Advanced Mode states. Simulator XCTest, target membership, accessibility, and workflow lint passed at this head; the review check is still pending.

🟡 1 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

Still open from earlier rounds (1)

  • 🟡 Suggestion: The AC-15 test passes even if the Receive Username row is missing — DashWalletTests/PaymentsLandingIdentityOptionTests.swift:152-168 (thread)
Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.2-sol (effort low) — The change is confined to the Receive screen and reuses the existing username display and copy behavior without changing address generation or transaction logic.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 57% left, weekly 44% left; passed over gemini-3.8-flash-high (lane failed)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `DashWalletTests/PaymentsLandingIdentityOptionTests.swift`:
- [SUGGESTION] DashWalletTests/PaymentsLandingIdentityOptionTests.swift:152-168: The AC-15 test passes even if the Receive Username row is missing
  (carried; thread: https://github.com/dashpay/dashwallet-ios/pull/1491#discussion_r4682834449)

Comment on lines +152 to +163
func testUsernameIsKeptAndCopiedOnEveryChainOptionWithAdvancedModeOff() throws {
let model = PaymentsLandingViewModel.makeForPreview(activeTab: .receive)
model.updateReceiveState(isAdvancedMode: false, identity: try identity)
XCTAssertEqual(model.receiveOptions, [.core, .shielded])

for option in model.receiveOptions {
model.network = option
XCTAssertEqual(model.receiveIdentity?.username, "alice", "\(option)")
UIPasteboard.general.string = nil
model.copyUsernameToPasteboard()
XCTAssertEqual(UIPasteboard.general.string, "alice", "\(option)")
}

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.

Still applies (re-reviewed at eecfd3b7): Sharing shownUsername and expanding the option matrix verify that the model supplies the same value across the cards, but neither test invokes the card's copy callback. The existing height test already hosts the screen with a synthetic alice identity, so you can check row presence without testnet registration; the QA backlog entry documents the planned interaction check, not its result.

romchornyi and others added 2 commits November 24, 2026 20:50
develop moved the app's texts to one String Catalog (#1455): the per-locale
Localizable.strings edits of this branch are dropped, its Swift lookups use
String(localized:), and the Ukrainian Identity label fix moves into the Catalog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@llbartekll llbartekll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved at 57d487f. The change is small and does what MO-1123 asks: one shownUsername feeds both Username rows and the copy action, and a wallet without a username gets no row.

What I checked: the diff, the full card code at the head, how receiveIdentity is fed, and the base branch. Static read plus the green CI run on this head; I did not run the app.

Three notes, none blocking:

  1. Quick Receive (lock screen) now shows the username too, and neither AC-15 nor a test says whether that is intended (inline).
  2. The branch conflicts with feat/identity-receive (55a9158) in PaymentsReceiveContent.swift: the base took develop's String Catalog move, so the Identity card now uses String(localized:). Resolving needs the new row to follow (inline).
  3. No test fails if the new row is removed (inline). I agree with the open bot thread on this, and agree it does not block.

VStack(spacing: 12) {
// The same Username row as the Identity card, on every
// option, whenever the Current identity has a username.
if let username = viewModel.shownUsername {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This branch also runs on the lock screen's Quick Receive. PaymentsLandingViewModel.init reads Self.currentReceiveIdentity whether or not isQuickReceive is set, so a wallet with a username shows it, with a working Copy, before unlock. On the base branch Quick Receive shows no username, and ReceiveOptionPolicy keeps Identity off it because it "runs before unlock".

This may well be what you want: the legacy Quick Receive drew the username's initial into the QR, and the address is shown there already. But it is a change on a pre-auth screen that AC-15 and the PR text do not mention. Could you say which it is, in AC-15, and pin it with an isQuickReceive: true case in testEveryReceiveOptionShowsAndCopiesTheUsername (or return nil from shownUsername on Quick Receive if it should stay hidden)?

I did not check on a device whether the identity snapshot is already loaded before unlock; if it is not, the row simply never appears there, and the AC should still say so.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in e417eea: the username is never shown or copied on Quick Receive, which runs before unlock. shownUsername is nil there, and it is the one value behind the row on Core, Shielded and Platform, the Identity card, copyUsernameToPasteboard and the toast. AC-15 says so, and testQuickReceiveNeverShowsOrCopiesTheUsername pins it for every option with Advanced Mode on and off (it fails without the fix). A separate path that was already on develop, Core's Specify amount request on Quick Receive, also carries the username; it gets its own PR.

// option, whenever the Current identity has a username.
if let username = viewModel.shownUsername {
copyRow(
label: NSLocalizedString("Username", comment: ""),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When you resolve the conflict with the base: the Identity card there now reads String(localized: "Username", comment: "") / String(localized: "Copy username", …) after #1455. Use the same form here so both rows stay on one catalog key, and keep viewModel.shownUsername on the Identity card's side of the conflict.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in the merge with develop: both rows use String(localized:) with the same keys, and the Identity card reads viewModel.shownUsername.


/// Every card shows and copies the same username: Core and Shielded with
/// Advanced Mode off, every option with it on (AC-15).
func testEveryReceiveOptionShowsAndCopiesTheUsername() throws {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This pins the view-model value, which is worth having. It does not pin the PR's actual change: delete the if let username = viewModel.shownUsername { … } block from addressCardBody and every test here stays green. testIdentityReceivePageFitsTheHeightItIsGiven already hosts the page with a synthetic alice, so a cheap check is possible without a testnet identity (host the Core card with and without a username and compare the fitted heights). Fine as a follow-up; the manual QA item covers it until then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Left as a follow-up, as you suggest: the row itself is still not rendered by a test. The manual check on the identity-receive QA case covers it until then.

romchornyi and others added 9 commits November 27, 2026 13:18
#1527 renamed topUpFromAddresses to topUpIdentityFromAddresses: the
coordinator's top-up keeps running inside IdentityTopUpDidComplete.announcing
with the new name, and the compatibility fixture keeps both this branch's
completion test and develop's wallet-change tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/ci/check_identity_top_up_announced.py scans DashWallet/Sources for
topUpIdentityWithFunding, topUpIdentityFromAddresses and
resumeTopUpWithAssetLock, and fails on a call outside
IdentityTopUpDidComplete.announcing: its closure, a closure the same file
passes to it by name, or the profile sheet's executeTopUp path. A dropped
wrapper would otherwise show the wallet's own top-up as Received with every
test green (ADR-0034's main negative consequence). The unit-tests workflow
runs the check and its tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Approved by a non-author Reviewer on #1344 (ADR-0001 rule 3).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mption

The guard now covers every public SwiftDashSDK method that credits an existing
identity, deprecated spellings and the shielded pool top-up included. A closure
bound by name is no longer exempt; the one deliberate unannounced call, the
asset-lock retry without a lock row or network, carries an explicit
`// top-up not announced: <reason>` marker that exempts only the call below it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
develop holds feat/identity-receive as the squash of #1344.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every Receive card and Copy read shownUsername, which is nil on Quick Receive:
it runs before unlock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@romchornyi
romchornyi changed the base branch from feat/identity-receive to develop November 30, 2026 19:53

@thepastaclaw thepastaclaw 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.

Re-review — Final validation — Phase 1 + Phase 2

Updated after discussion: 1 finding(s) of this review were settled in the inline threads.

  • ⏭️ Deferred (maintainer decision): 🟡 The AC-15 test passes even if the Receive Username row is missing (tracked in #1557)

New on this head: The new commit suppresses username rows and copy actions on the lock screen’s Quick Receive, adds regression coverage for that restriction, and updates the identity-receive acceptance criteria. Accessibility, test-target membership, workflow, and title checks passed; the simulator test job was still in progress at the captured CI snapshot.

🟡 2 1 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

⏸️ Awaiting tracking link (1): The AC-15 test passes even if the Receive Username row is missing (thread). Link an issue on its thread, or ask there and PastaClaw files it.

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.2-sol (effort low) — This is a small, contained SwiftUI presentation change that adds username rows and copy interactions across Receive options with focused tests and no funds, key, networking, or storage behavior changes.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 99% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `docs/features/identity-receive/README.md`:
- [SUGGESTION] docs/features/identity-receive/README.md:62-64: AC-15 claims Quick Receive has nothing to copy, but its Specify-amount sheet still copies the username
  Impact: When a locked Quick Receive has a persisted username, tapping Specify amount opens a sheet that displays the username and provides a working Copy control despite AC-15 saying no Quick Receive surface can copy it.
  QA can mark AC-15 complete while the pre-unlock Specify-amount flow still exposes the username. Quick Receive enables Specify amount for Core when an address is available; the existing DWReceiveModel populates its payment request from DWGlobalOptions.dashpayUsername, RequestAmountScreen renders the Username row when that value is present, and RequestAmountHostingController forwards copying to the model. The new shownUsername guard only covers the landing cards and their copy action, not this pre-existing request sheet. Narrow AC-15 to the Receive cards and state that the Specify-amount sheet is handled separately, or pass the Quick Receive context into the Core request model and suppress the username there as well.

In `DashWalletTests/PaymentsLandingIdentityOptionTests.swift`:
- [SUGGESTION → DEFERRED by a maintainer; not blocking, do not fix in this PR] DashWalletTests/PaymentsLandingIdentityOptionTests.swift:152-163: The AC-15 test passes even if the Receive Username row is missing
  (awaiting a tracking link: link an issue on its thread, or ask there and PastaClaw files it; no code change needed; thread: https://github.com/dashpay/dashwallet-ios/pull/1491#discussion_r4682834449)

Comment on lines +62 to +64
- **AC-15** Core, Shielded and Platform show the username above the address, with its own copy
button, whenever the Current identity has one, with Advanced Mode on or off. The lock screen's
Quick Receive shows no username row on any option and has nothing to copy it with.

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.

🟡 Suggestion: AC-15 claims Quick Receive has nothing to copy, but its Specify-amount sheet still copies the username
Impact: When a locked Quick Receive has a persisted username, tapping Specify amount opens a sheet that displays the username and provides a working Copy control despite AC-15 saying no Quick Receive surface can copy it.

QA can mark AC-15 complete while the pre-unlock Specify-amount flow still exposes the username. Quick Receive enables Specify amount for Core when an address is available; the existing DWReceiveModel populates its payment request from DWGlobalOptions.dashpayUsername, RequestAmountScreen renders the Username row when that value is present, and RequestAmountHostingController forwards copying to the model. The new shownUsername guard only covers the landing cards and their copy action, not this pre-existing request sheet. Narrow AC-15 to the Receive cards and state that the Specify-amount sheet is handled separately, or pass the Quick Receive context into the Core request model and suppress the username there as well.

source: glm-5.3-flash (phase1-reviewer: general)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct: AC-15 overstates it until the request sheet is fixed too. #1556 does that: on Quick Receive the Core request carries no username in its row, copy action, link or QR code, so AC-15 stays as written.

Comment on lines +152 to +163
func testUsernameIsKeptAndCopiedOnEveryChainOptionWithAdvancedModeOff() throws {
let model = PaymentsLandingViewModel.makeForPreview(activeTab: .receive)
model.updateReceiveState(isAdvancedMode: false, identity: try identity)
XCTAssertEqual(model.receiveOptions, [.core, .shielded])

for option in model.receiveOptions {
model.network = option
XCTAssertEqual(model.receiveIdentity?.username, "alice", "\(option)")
UIPasteboard.general.string = nil
model.copyUsernameToPasteboard()
XCTAssertEqual(UIPasteboard.general.string, "alice", "\(option)")
}

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.

Needs a tracking issue (re-reviewed at e417eeab): Deferring this needs a tracking issue for the follow-up, and none is linked in this thread, the PR description or the PR comments. Link one, or ask here and I'll file it; until then the finding stands.

@romchornyi
romchornyi merged commit 2df45c5 into develop Dec 1, 2026
8 checks passed
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.

3 participants