Skip to content

fix: accept hardware input on numeric keypads - #1040

Open
PastaPastaPasta wants to merge 2 commits into
dashpay:developfrom
PastaPastaPasta:fix/balance-hardware-keyboard
Open

fix: accept hardware input on numeric keypads#1040
PastaPastaPasta wants to merge 2 commits into
dashpay:developfrom
PastaPastaPasta:fix/balance-hardware-keyboard

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Aug 22, 2026

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

DashUIKit's integrated numeric keypad is rendered as buttons and does not install a text responder. As a result, digits and decimal separators typed with a connected physical keyboard—or the Mac keyboard attached to Simulator—are discarded on amount and numeric-authentication screens.

What was done?

  • Added an app-level numeric keypad wrapper that preserves the existing DashUIKit keypad and action behavior.
  • Added a hidden UIKit first responder that accepts hardware digits, locale-aware decimal input, and Backspace without presenting a second software keyboard.
  • Adopted the wrapper at every integrated numeric-keypad call site so send, internal transfer, receive amount, swap, Coinbase, DashSpend, contact payment, evonode withdrawal, and OTP entry behave consistently.
  • Added compile-ready tests for digit entry, deletion, locale decimal separators, duplicate separators, and integer-only input.

How Has This Been Tested?

  • Built the dashpay scheme for the arm64 iOS Simulator:
    xcodebuild -quiet -workspace DashWallet.xcworkspace -scheme dashpay -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' ARCHS=arm64 build
  • Installed the build on an iOS 26.5 testnet simulator and opened the balance-row Internal send screen.
  • Sent 0.01 through Simulator hardware-key events and verified the displayed amount and enabled Continue state updated immediately.
  • Tapped the integrated 2 key afterward and verified the amount became 0.012, confirming the on-screen keypad remains functional.
  • The repository's unit-test target remains pre-existing broken as documented in CLAUDE.md; the new unit cases are compile-ready.

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

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

This pull request was created by Codex.

Summary by CodeRabbit

  • New Features

    • Numeric entry fields now support physical keyboard input alongside the on-screen keypad.
    • Digit, decimal separator, and delete keys work with locale-aware formatting.
    • Physical input is appropriately disabled while actions are processing.
    • Updated amount entry, payments, transfers, swaps, withdrawals, and authentication screens to use the enhanced input experience.
  • Tests

    • Added coverage for digit entry, deletion, decimal separator handling, and duplicate prevention.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PastaPastaPasta, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

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

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

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1176d424-5445-4853-8447-088a4b5013e0

📥 Commits

Reviewing files that changed from the base of the PR and between 7354a34 and 5d4ef10.

📒 Files selected for processing (2)
  • DashWallet/Sources/UI/SwiftUI Components/HardwareNumericKeyboardView.swift
  • DashWalletTests/AmountObjectTests.swift

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 297e3559-d762-41e7-9d8a-2a285a0fff27

📥 Commits

Reviewing files that changed from the base of the PR and between 6bd8338 and 7354a34.

📒 Files selected for processing (14)
  • DashWallet.xcodeproj/project.pbxproj
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountView.swift
  • DashWallet/Sources/UI/DashPay/Contacts/SwiftUI/ContactProfileSheet.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/Components/DashSpendSinglePanel.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendUserAuthScreen.swift
  • DashWallet/Sources/UI/Menu/Tools/Masternode Withdrawal/EvonodeWithdrawalScreen.swift
  • DashWallet/Sources/UI/Payments/Amount/SendAmountScreen.swift
  • DashWallet/Sources/UI/Payments/Amount/SpecifyAmountViewController.swift
  • DashWallet/Sources/UI/Payments/InternalTransfer/InternalTransferScreen.swift
  • DashWallet/Sources/UI/Payments/Pay/SendScreen.swift
  • DashWallet/Sources/UI/Swap/Buy/EnterAmount/BuyEnterAmountView.swift
  • DashWallet/Sources/UI/Swap/Convert/SwapConvertView.swift
  • DashWallet/Sources/UI/SwiftUI Components/HardwareNumericKeyboardView.swift
  • DashWalletTests/AmountObjectTests.swift

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The PR adds HardwareNumericKeyboardView, which combines the existing DashUIKit keypad with hardware keyboard input. It adds locale-aware digit, decimal, and deletion handling, then adopts the component across amount-entry and OTP screens.

Hardware numeric keyboard

Layer / File(s) Summary
Hardware input component
DashWallet/Sources/UI/SwiftUI Components/HardwareNumericKeyboardView.swift, DashWalletTests/AmountObjectTests.swift
The new wrapper forwards existing keypad configuration and handles physical digit, decimal, and delete commands. Tests cover deletion, locale-specific separators, duplicate separators, and hidden decimal input.
Screen integration
DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountView.swift, DashWallet/Sources/UI/DashPay/Contacts/SwiftUI/ContactProfileSheet.swift, DashWallet/Sources/UI/Explore Dash/Views/DashSpend/..., DashWallet/Sources/UI/Menu/Tools/Masternode Withdrawal/EvonodeWithdrawalScreen.swift, DashWallet/Sources/UI/Payments/..., DashWallet/Sources/UI/Swap/...
The affected screens now use HardwareNumericKeyboardView. Existing bindings, validation, actions, loading states, and layout configuration remain unchanged.
Xcode project registration
DashWallet.xcodeproj/project.pbxproj
The new Swift file is registered in the project group, file references, build files, and two target compilation phases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 7354a

This localized input-handling change has no actionable merge-blocking risk remaining; the only follow-up concerns an uncommon locale separator case.

Suggested reviewers: jeanpierreroma, romchornyi, quantumexplorer

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant HardwareNumericKeyboardResponder
  participant HardwareNumericKeyboardView
  participant NumericKeyboardView
  participant AmountScreen
  User->>HardwareNumericKeyboardResponder: enter numeric key
  HardwareNumericKeyboardResponder->>HardwareNumericKeyboardView: dispatch recognized command
  HardwareNumericKeyboardView->>HardwareNumericKeyboardView: update bound amount
  HardwareNumericKeyboardView->>NumericKeyboardView: preserve keypad configuration
  HardwareNumericKeyboardView->>AmountScreen: publish updated amount
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling hardware keyboard input for numeric keypads.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Replace the UIKeyCommand-based responder with a hidden UITextField that overrides insertText/deleteBackward and suppresses the software keyboard via an empty inputView, matching the existing DWPinField and TwoFactorAuthViewController pattern instead of introducing a fourth keyboard mechanism.

This also makes hardware Return trigger the action button (gated the same way as the visible button, including the non-empty-value check), reclaims first responder after a sheet or alert with a text field steals it, and gains native key auto-repeat and paste handling.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant