Skip to content

fix(wallet): show the private-address refusal before Send, and keep suggestions under dialogs - #1147

Merged
lklimek merged 2 commits into
v1.0-devfrom
fix/send-foreign-private-address-ux
Oct 28, 2026
Merged

lklimek merged 2 commits into
v1.0-devfrom
fix/send-foreign-private-address-ux

Conversation

@Claudius-Maginificent

@Claudius-Maginificent Claudius-Maginificent commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR

The Send form now refuses someone else's private address for Core and Platform sources up front: Shield DASH is turned off and the reason sits under the address. Before, it was only refused on click. Separately, address suggestions no longer draw on top of a blocking dialog's dimmed backdrop. Both were found in the 2026-10-27 release review.

User story

  • SND-007 (Shield DASH from Core wallet) and SND-009 (Shield credits from Platform address): shielding goes only into your own private balance, and fix(wallet): refuse Core and Platform sends to someone else's private address #1113 refuses anything else. This PR makes that refusal visible before the click.
  • SND-016 (Send privately within the shielded pool): paying someone else's private address still works from Shielded Balance.

Scenario

  1. Wallets → Send. Choose Core Wallet as the source and paste another wallet's private address (tdash1z…).
    • Before: the address is labelled "Private address", a fee estimate appears, and Shield DASH is enabled. Clicking it shows a red banner: "Core and Platform funds can only move into your own private balance…".
    • After: that sentence shows under the address straight away. Shield DASH is turned off, and hovering it shows the same sentence. Your own private address still shows no warning and the button stays on.
  2. Type part of an address so the suggestions open, then click a send button that opens the confirmation dialog.
    • Before: a suggestion row stays bright on top of the dimmed dialog backdrop.
    • After: the suggestions close as soon as the dialog blocks the form.

Detailed discussion

Refusal before the click (src/ui/wallets/send_screen.rs). The #1113 check moved, unchanged, out of validated_send_route into shielded_destination_refusal(). The route check still returns that refusal as its error, so the click-time and backend-facing guard is exactly as before and its existing tests are untouched. The same function now also drives:

  • an inline line under the destination in VALIDATION_WARNING, as AddressInput does for its own validation errors (ux-design-patterns §5);
  • can_send, which turns the primary button off, plus disabled_tooltip with the same sentence (ux-design-patterns §10).

No new copy: it reuses the user-tested SHIELDED_NOT_OWN_POOL text.

Suggestions over a modal (src/ui/components/address_input.rs). The suggestion popup is an Order::Foreground area, and it stays open after the field loses focus (autocomplete_open) so a row click can land. A dialog that blocks input registers its window as egui's modal layer. The component now skips the popup, and closes it, whenever its own layer is below that modal layer (Memory::is_above_modal_layer). Because the fix lives in the component, it covers every blocking dialog over every AddressInput, not just the Send confirmation. As a side effect, arrow keys and Enter pressed in the dialog no longer move or pick a hidden suggestion behind it. Dialogs that do not block input register no modal layer and keep the old behaviour.

Not changed, out of scope:

  • Choosing a different source clears the typed destination. Following the refusal's advice ("choose Shielded Balance as the source") therefore makes the user paste the address again.
  • The release review reports that with a foreign private address typed, the Platform Addresses source row could not be selected. Not reproduced here.
  • The fee estimate and "The available amount could not be checked." line still show for the refused route.

Testing

  • RED → GREEN ui::wallets::send_screen::tests::someone_elses_private_address_turns_core_shielding_off_before_the_click: Core source plus another wallet's private address shows the refusal before any click. Shield DASH senses no click, and clicking opens no confirmation and raises no error. The wallet's own private address shows no refusal and keeps the button clickable.
  • RED → GREEN kittest address_input::suggestions_do_not_draw_over_a_blocking_dialog: suggestions are open, then a blocking ConfirmationDialog opens, and the suggestion row is gone.
  • The existing fix(wallet): refuse Core and Platform sends to someone else's private address #1113 route tests still pass (core_and_platform_refuse_someone_elses_private_address, core_refuses_a_private_address_while_its_own_is_unknown, core_and_platform_still_shield_into_the_own_pool, private_balance_still_pays_someone_elses_private_address).
  • Send screen and address input suites: 157 unit + 21 kittest passed.
  • cargo clippy --all-features --lib --test kittest -- -D warnings clean; cargo fmt --all.

🤖 Generated with Claude Code

https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q

PR Hygiene · 81d5560

  • Bots — coderabbitai skipped after its own rate limit · thepastaclaw ✓
  • Self-review — not asked of a bot author
  • Build green
  • Approvals
    • files with no dedicated owner (src/ui/components/address_input.rs, src/ui/wallets/send_screen.rs, tests/kittest/address_input.rs) — approved by lklimek

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

With Core or Platform as the source and another wallet's private address
typed, the Send form offered an enabled Shield DASH button and a fee
estimate. It refused only on click. The #1113 route check now lives in one
function that also drives the form: the refusal shows under the address
as soon as it applies, and Shield DASH is turned off with the same
explanation on hover. The route check still refuses with the same error,
so the guard itself is unchanged.

The address suggestions popup stayed open after the field lost focus. It
drew above a blocking dialog's dimmed backdrop, and its arrow and Enter
keys kept working behind the dialog. AddressInput now closes the popup
while a modal layer blocks the field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ujJpB9DBhvtbjhYB3aG9Q
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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 59 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
Commits

Reviewing files that changed from the base of the PR and between cba068d and 81d5560.

Files selected for processing: 3
  • src/ui/components/address_input.rs
  • src/ui/wallets/send_screen.rs
  • tests/kittest/address_input.rs
  • 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

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 81d5560)

@Claudius-Maginificent
Claudius-Maginificent marked this pull request as ready for review October 28, 2026 10:25
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Oct 28, 2026

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

Final validation — Phase 2 only (no Phase 1 for this repository)

The PR correctly centralizes the private-destination refusal and preserves the backend route guard. The modal-layer check closes suggestions once egui has registered a blocking modal, but the opening frame remains uncovered: the dialog registers its modal layer only after AddressInput has already rendered, so the autocomplete popup can briefly appear above the dimmed backdrop. CI checks for this head are successful, with only PR Hygiene still pending.

🟡 1 suggestion(s)

Review provenance

Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — This changes interactive wallet-send validation and shared address-input modal behavior, but it does not itself alter funds movement, coin selection, signing, or other critical surfaces.
  • Phase 1 reviewers: not run (disabled for this repository)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `src/ui/components/address_input.rs`:
- [SUGGESTION] src/ui/components/address_input.rs:1082-1086: Close suggestions on the frame that opens a blocking dialog
  This check only observes egui's modal-layer state from the previous frame. `modal_chrome` calls `set_modal_layer` after rendering the dialog, and the source comment confirms that egui consumes it into `top_modal_layer` at the end of the pass. In the Send screen, AddressInput renders before `render_send_confirmation`, so the frame in which clicking Send creates the blocking dialog still sees no modal layer and renders the autocomplete popup. Because the popup is a foreground area and the dialog backdrop is painted below it, the suggestion row can briefly remain visible over the dimmed backdrop. Close the component's autocomplete state when the action opens the blocking dialog, or otherwise arrange for the opening frame to suppress the popup; the existing four-frame kittest does not exercise this transient frame.

Comment thread src/ui/components/address_input.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Ready for review — files with no dedicated owner: lklimek.
Full checklist in the description.

@github-actions github-actions Bot added ready-for-human Bots have reported, the author has self-reviewed, and the build is green: this needs a human. bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Oct 28, 2026
@github-actions
github-actions Bot requested a review from lklimek October 28, 2026 13:44
@lklimek
lklimek enabled auto-merge (squash) October 28, 2026 15:39
@github-actions

Copy link
Copy Markdown
Contributor

Policy satisfied — this can merge.
Full checklist in the description.

@github-actions github-actions Bot removed the ready-for-human Bots have reported, the author has self-reviewed, and the build is green: this needs a human. label Oct 28, 2026
@lklimek
lklimek merged commit 7845a36 into v1.0-dev Oct 28, 2026
17 checks passed
@lklimek
lklimek deleted the fix/send-foreign-private-address-ux branch October 28, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-skipped A required review bot did not report; it was skipped by the window or by a person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants