Skip to content

Open keyboard with focus on name input on opening up name page#3554

Open
shubham1g5 wants to merge 1 commit intomasterfrom
ccct-2103_name_keyboard
Open

Open keyboard with focus on name input on opening up name page#3554
shubham1g5 wants to merge 1 commit intomasterfrom
ccct-2103_name_keyboard

Conversation

@shubham1g5
Copy link
Contributor

Product Description

https://dimagi.atlassian.net/browse/CCCT-2103

name.page.keyboard.mp4

Technical Summary

I tried the similar things listed in #3532 to make the keyboard open without a delay but it didn't do the trick, so I ended up using the current approach to open the keyboard as well here that opens the keyboard after a 250 ms delay.

Safety Assurance

Verified locally

Labels and Review

  • Do we need to enhance the manual QA test coverage ? If yes, the "QA Note" label is set correctly
  • Does the PR introduce any major changes worth communicating ? If yes, the "Release Note" label is set and a "Release Note" is specified in PR description.
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

📝 Walkthrough

Walkthrough

The pull request adds a lifecycle method override to PersonalIdNameFragment. The onResume method calls the parent implementation, then attempts to obtain focus on the name input field and displays the soft keyboard via KeyboardHelper when focus is acquired. The necessary KeyboardHelper import is also added to support this functionality.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

QA Note

Suggested reviewers

  • conroy-ricketts
  • Jignesh-dimagi
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: opening the keyboard with focus on the name input when the name page opens, which directly corresponds to the code changes adding onResume lifecycle override.
Description check ✅ Passed The description includes product description with Jira ticket and video attachment, technical summary with rationale, and safety assurance with local verification. However, it lacks detailed automated test coverage and comprehensive QA plan sections required by the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ccct-2103_name_keyboard

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 `@app/src/org/commcare/fragments/personalId/PersonalIdNameFragment.java`:
- Line 52: Whitespace around the if condition in PersonalIdNameFragment.java
violates checkstyle: change the expression in the method where you call
binding.nameTextValue.requestFocus() so the if is formatted as "if
(binding.nameTextValue.requestFocus()) {" (add a space after "if" and before
"{"); update the line inside the class/method containing that call and re-run
the project's checkstyle validation to ensure no other spacing issues remain.

@Override
public void onResume() {
super.onResume();
if( binding.nameTextValue.requestFocus()){
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Checkstyle: fix whitespace around if condition.

if( is missing a space after the keyword, and ){ is missing a space before the opening brace. Both are standard checkstyle violations.

🔧 Proposed fix
-        if( binding.nameTextValue.requestFocus()){
+        if (binding.nameTextValue.requestFocus()) {

As per coding guidelines, Java code must be verified against checkstyle.xml.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if( binding.nameTextValue.requestFocus()){
if (binding.nameTextValue.requestFocus()) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/org/commcare/fragments/personalId/PersonalIdNameFragment.java` at
line 52, Whitespace around the if condition in PersonalIdNameFragment.java
violates checkstyle: change the expression in the method where you call
binding.nameTextValue.requestFocus() so the if is formatted as "if
(binding.nameTextValue.requestFocus()) {" (add a space after "if" and before
"{"); update the line inside the class/method containing that call and re-run
the project's checkstyle validation to ensure no other spacing issues remain.

@Jignesh-dimagi
Copy link
Contributor

@shubham1g5 What is the screen condition shown in the video at 00:18 seconds? And also, it's showing the name screen again from the code screen. Are you pressing the back button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-integration-tests Skip android tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments