Skip to content

Conversation

@avazirna
Copy link
Contributor

@avazirna avazirna commented Dec 5, 2025

Product Description

Backmerge CommCare 2.61.2

@coderabbitai
Copy link

coderabbitai bot commented Dec 5, 2025

📝 Walkthrough

Walkthrough

This PR modifies ComboboxWidget to fix dropdown dismissal during text input. A new private boolean field wasWidgetChangedOnTextChanged tracks whether the widget state changed due to user text input. The widgetEntryChanged() call in TextWatcher.afterTextChanged is wrapped in a try/finally block that sets and resets this flag. The getAnswer() method now only dismisses the dropdown if this flag is false, preventing unintended dismissal during programmatic text-change handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the try/finally block correctly handles the flag across all code paths, including exception scenarios
  • Confirm the conditional dismissal logic does not introduce edge cases with rapid successive text changes
  • Ensure the flag state transitions are thread-safe if TextWatcher callbacks occur on non-UI threads

Possibly related PRs

Suggested reviewers

  • conroy-ricketts
  • shubham1g5

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only provides a product description section ('Backmerge CommCare 2.61.2') but is missing most required sections from the template including Technical Summary, Safety Assurance, Automated test coverage, and QA Plan. Add Technical Summary with ticket link and rationale, Safety Assurance section with safety story and testing approach, Automated test coverage details, QA Plan with verification steps, and appropriate labels (Risk, QA Note, Release Note if applicable).
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Backmerge Commcare 2.61.2' accurately reflects the main purpose of the PR, which is to merge changes from the commcare_2.61 branch into master.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch commcare_2.61

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

@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: 0

🧹 Nitpick comments (1)
app/src/org/commcare/views/widgets/ComboboxWidget.java (1)

32-32: Consider a clearer flag name.

The name wasWidgetChangedOnTextChanged is somewhat ambiguous. Names like isHandlingTextChange or isProcessingTextInput would more clearly convey that this flag is active during text change processing rather than indicating a past state.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50134ea and b63f6ae.

📒 Files selected for processing (1)
  • app/src/org/commcare/views/widgets/ComboboxWidget.java (3 hunks)
🔇 Additional comments (2)
app/src/org/commcare/views/widgets/ComboboxWidget.java (2)

99-104: LGTM - Proper use of try/finally for state management.

The try/finally block ensures the flag is always reset, even if widgetEntryChanged() throws an exception. This prevents the dropdown dismissal from being permanently disabled due to an uncaught exception.


124-126: LGTM - Fix prevents dropdown dismissal during text input.

The conditional dismissal correctly addresses the UX issue where typing would close the dropdown. The flag ensures the dropdown remains visible during text change handling while still being dismissed in other contexts (item selection, focus loss, form submission).

@avazirna avazirna merged commit 484df28 into master Dec 5, 2025
7 checks passed
@avazirna avazirna deleted the commcare_2.61 branch December 5, 2025 15:10
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.

3 participants