You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(compose): shared AmountEntryPage; move the DEX enter-amount screen onto it - #1678
Part of MO-1123 (External Receive). Stacked on #1677 (Advanced payments screen), which sits on #1675 → feat/kotlin-sdk-phase-1. Retarget this PR's base as the PRs below it merge.
Why
The Receive tab's "Specify amount" opens an Enter-amount page inside the payments screen. That page needs a reusable Compose amount entry; today each screen combines EnterAmount, NumericKeyboardCompose and processAmountKeyInput by hand.
What
AmountEntryPage (common/.../ui/enter_amount/AmountEntryPage.kt): the EnterAmount bar, a flexible gap and the keypad flush with the bottom edge.
Slots: header, belowAmount, primaryButton.
Max / balance buttons only when onMaxClick / onBalanceClick are passed (the Receive page passes neither).
Dash/fiat switching via the currency picker (onCurrencySelected) or tap-to-toggle (secondaryAmount + tap handlers).
State hoisted: raw keys go to onKeyInput, and the owner (usually its ViewModel) applies processAmountKeyInput, so decimal places stay per currency. The page only localizes the decimal separator for display.
AmountEntryPrimaryButton: the standard Continue button with the DEX inset.
DEXEnterAmountScreen now uses the page. Layout and behaviour are unchanged.
PurchaseGiftCardScreenV2 is not migrated: only one of its three modes shows the keypad, inside a scrolling column, with different button spacing, so the page would need special cases just for it.
Moves processAmountKeyInput's KDoc back above the function.
Tests
AmountEntryInputTest (7): processAmountKeyInput (leading zero, single decimal point, decimal limit, back, back_long) and the separator helpers.
:wallet:compile_testNet3DebugKotlin, ktlintFormat and /pre-review (0 findings) are clean.
Manual, prod debug build on an emulator (Dash DEX → Buy Dash → Bitcoin): typing and decimal limit, EUR/DASH/BTC picker, backspace and long-press clear, Continue enable/disable, offline dimming and toast. All as before. DashDEX doesn't work on testnet, so this needs a mainnet build. No quote was requested.
Previews
AmountEntryPage: Receive-style (picker + Continue), everything on, German locale with the keypad disabled.
Reviewing files that changed from the base of the PR and between 38a2ede and a633d90.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The common module adds a configurable Compose amount-entry page, locale display helpers, and input tests. The Maya DEX amount screen uses the shared page and button helper.
Changes: Amount Entry Flow
Layer / File(s)
Summary
Shared amount-entry page and validation common/src/main/java/org/dash/wallet/common/ui/enter_amount/AmountEntryPage.kt, common/src/main/java/org/dash/wallet/common/ui/enter_amount/EnterAmountCompose.kt, common/src/test/java/org/dash/wallet/common/ui/enter_amount/AmountEntryInputTest.kt
The common module adds locale display helpers, a configurable amount-entry page, a primary-button helper, and previews. Tests cover keypad input rules and locale-specific display, including trailing decimal separators.
The screen replaces its manual amount field, keypad, and Continue button composition with the shared page. The keypad is disabled when offline or validating. Continue is enabled only when continueEnabled and online.
The amount-entry migration preserves the checked DEX input and disabled-keypad behavior. No merge-blocking issue is established.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly describes the main change: extracting a shared AmountEntryPage and migrating the DEX amount-entry screen to use it.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
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.
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
♻️ No change to this PR's diff since commit 38a2ede (an empty commit, a merge of the base or a rebase onto it): that review stands — approved; @thepastaclaw review asks for a review of this commit (commit a633d90)
…enter-amount screen onto it
AmountEntryPage (common) combines the EnterAmount bar, NumericKeyboardCompose and the
locale display boundary, with header/belowAmount/primaryButton slots and optional
Max/balance buttons, Dash/fiat picker or tap-to-toggle secondary amount. State stays
hoisted: keys go to the owner, which applies processAmountKeyInput.
DEXEnterAmountScreen now uses it with no change in layout or behaviour.
PurchaseGiftCardScreenV2 is left as is: only one of its three modes shows the keypad,
inside a scrolling column, with different button spacing.
Adds unit tests for processAmountKeyInput and the display-separator helpers, and
moves the processAmountKeyInput KDoc back above its function.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry-rows
Picks up cac4f5c (phase-1 through #1675, #1677/#1678/#1680, int37 pin).
Conflicts resolved by keeping both sides:
- AppDatabaseMigrations: our 22->23 tx_display_cache.source migration plus
the base's data-only removeCrowdNodeCacheRows callback (base stays at v22,
so AppDatabase is v23 with 23.json unchanged).
- PlatformSyncService: both shieldedHistoryRowSync and
transparentUsernameCreation constructor params; the six platform tests and
IdentityConditionalWriteTest pass both.
- DatabaseMigrationTest: our migrate22to23 plus the base's crowdnode cache
tests; its migrations array now includes migration22to23.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Final validation — Phase 1 + Phase 2
Verified the complete diff at 38a2ede against the supplied base and traced the shared controls, DEX state handling, and lifecycle. No actionable in-scope defects were found: the extraction preserves DEX callback wiring, display-only localization, layout, and enablement behavior while retaining amount processing in the ViewModel. This was a static review; current build and check jobs pass, and only the automated review remains pending.
Triage: normal by gpt-6.1-sol (effort low) — This is an ordinary multi-file Compose UI refactor introducing reusable amount-entry behavior and tests, without changing funds movement, cryptography, or another critical surface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of MO-1123 (External Receive). Stacked on #1677 (Advanced payments screen), which sits on #1675 →
feat/kotlin-sdk-phase-1. Retarget this PR's base as the PRs below it merge.Why
The Receive tab's "Specify amount" opens an Enter-amount page inside the payments screen. That page needs a reusable Compose amount entry; today each screen combines
EnterAmount,NumericKeyboardComposeandprocessAmountKeyInputby hand.What
AmountEntryPage(common/.../ui/enter_amount/AmountEntryPage.kt): theEnterAmountbar, a flexible gap and the keypad flush with the bottom edge.header,belowAmount,primaryButton.onMaxClick/onBalanceClickare passed (the Receive page passes neither).onCurrencySelected) or tap-to-toggle (secondaryAmount+ tap handlers).onKeyInput, and the owner (usually its ViewModel) appliesprocessAmountKeyInput, so decimal places stay per currency. The page only localizes the decimal separator for display.AmountEntryPrimaryButton: the standard Continue button with the DEX inset.DEXEnterAmountScreennow uses the page. Layout and behaviour are unchanged.PurchaseGiftCardScreenV2is not migrated: only one of its three modes shows the keypad, inside a scrolling column, with different button spacing, so the page would need special cases just for it.processAmountKeyInput's KDoc back above the function.Tests
AmountEntryInputTest(7):processAmountKeyInput(leading zero, single decimal point, decimal limit, back, back_long) and the separator helpers.:wallet:compile_testNet3DebugKotlin,ktlintFormatand/pre-review(0 findings) are clean.Previews
AmountEntryPage: Receive-style (picker + Continue), everything on, German locale with the keypad disabled.🤖 Generated with Claude Code
Summary by CodeRabbit