Android: add visual affordance to amount input#643
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 39 minutes and 32 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR enhances the amount input field in the SendFlow by adding visual affordances and improving focus management. Changes include introducing a clickable modifier for tap feedback, adding a "Tap to enter amount" placeholder, refining focus handling, and inserting a divider for visual separation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@android/app/src/main/java/org/bitcoinppl/cove/flows/SendFlow/EnterAmountView.kt`:
- Around line 137-144: The placeholder is not using the same horizontal offset
as the input text, causing a jump when focus changes; update the placeholder
rendering in EnterAmountView (the block that decides color using amount,
isFocused, exceedsBalance, CoveColor.WarningOrange,
MaterialTheme.colorScheme.onSurface) to apply the same offset/padding used for
the input text at line where the text offset is set (the amount input
composable) so the placeholder and amount share identical horizontal
positioning; ensure the placeholder composable reuses the same modifier/padding
or offset value rather than a separate default so focus transitions remain
visually stable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ee801982-e8b0-4ca1-97ed-41fc5dd50b6a
📒 Files selected for processing (2)
android/app/src/main/java/org/bitcoinppl/cove/flows/SendFlow/EnterAmountView.ktandroid/app/src/main/res/values/strings.xml
Greptile SummaryThis PR adds three UI improvements to the amount input on Android: a "Tap to enter amount" placeholder (visible when unfocused and amount is "0" or empty), a
Confidence Score: 5/5Safe to merge — the change is a self-contained UI enhancement with no business logic impact. The three-part visual affordance is implemented cleanly. The localFocusRequester fallback correctly prevents a crash that would have occurred if the outer clickable fired without an attached requester. The clearAndSetSemantics guard addresses the accessibility double-announcement concern. No data paths, validation logic, or existing behavior are altered. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Fix placeholder offset and accessibility..." | Re-trigger Greptile |
|
looks good @pradhyum6144 can you include a video showing what it looks like now, thanks |
Hey @praveenperera, I tried running the app on my device to record the video but it crashes on startup with cloud storage is not initialized looks like it needs Google cloud credentials configured which I don't have set up locally. Is there a way to disable cloud storage for local dev builds? Also if possible can you test on your device.?? |
|
@pradhyum6144 ill fix this and let you know, whats the error you get? |
|
@coderabbitai review |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Get the PR diff
gh pr view 643 --repo bitcoinppl/cove --json files,body
gh pr diff 643 --repo bitcoinppl/coveLength of output: 8489 Review of PR
|
| Item | Severity |
|---|---|
Fragile amount == "0" check |
Medium |
| Placeholder font size mismatch | Low–Medium |
| Accessibility role / semantics | Low |
| Ripple clipping | Cosmetic / test-only |
The strings.xml change (placeholder_tap_to_enter_amount) is correct. Once a demo video is available (per the discussion with @praveenperera) it'll be easier to validate the layout in context.
Combines the three directions from the design discussion on #515. The amount field on Android is a BasicTextField with no Material chrome, so users had no visual cue that it was tappable.
Adds a "Tap to enter amount" placeholder centered in the Box when the value is empty or "0" and the field isn't focused. The underlying text is drawn transparent in that state so the default "0" doesn't bleed through behind the placeholder. Wraps the amount Box in .clickable { focusRequester.requestFocus() } so taps on the empty area around the glyphs give a Material ripple and focus the field BasicTextField still consumes taps within its own bounds, so the wrapper only fires for the outer area. Drops a HorizontalDivider under the amount row as a subtle bottom border, matching the conventional "this is an input" look.
Falls back to a locally-remembered FocusRequester when the caller doesn't provide one, so the clickable wrapper always has a target.
Closes #515
Summary by CodeRabbit
Release Notes