Skip to content

Improve scrolling to questions and highlighting questions with errors#7064

Merged
seadowg merged 3 commits intogetodk:v2026.1.xfrom
grzesiek2010:COLLECT-7020_1
Feb 5, 2026
Merged

Improve scrolling to questions and highlighting questions with errors#7064
seadowg merged 3 commits intogetodk:v2026.1.xfrom
grzesiek2010:COLLECT-7020_1

Conversation

@grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jan 30, 2026

Closes #7020

Why is this the best possible solution? Were any other approaches considered?

It seems that during some recent refactoring, we accidentally removed the logic that sets focus after highlighting a question with an error. I’ve fixed that, and also took the opportunity to make some improvements: we can now eliminate some postDelayed calls that were previously needed to ensure smooth scrolling to specific questions, which wasn’t working perfectly before so:

  • it’s more reliable than using a fixed 0.4 s delay to wait for animations to finish
  • it can be a little bit faster
  • it works in a smarter way as it immediately sets focus on the expected question, instead of first focusing the first one and then switching (as before)

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Here, we need to test form validation, especially cases that require scrolling to a specific question to highlight it (please also test success validations to see if the snackbar is displayed correctly). Another important case is answering select one from map questions, to ensure that scrolling to those questions works correctly, see: #7028.

Do we need any specific form for testing your changes? If so, please attach one.

The form is linked in the issue.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 requested a review from seadowg February 1, 2026 00:55
@grzesiek2010 grzesiek2010 marked this pull request as ready for review February 1, 2026 00:55
Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

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

I like this! It's probably worth waiting for behaviour verified to merge this as it's an easy area to create regressions in.

@seadowg seadowg changed the base branch from master to v1.26.x February 3, 2026 16:42
@seadowg seadowg changed the base branch from v1.26.x to v2026.1.x February 3, 2026 16:42
@dbemke
Copy link

dbemke commented Feb 5, 2026

Tested with Success!

Verified on devices with Android 10

Verified cases:

@WKobus
Copy link

WKobus commented Feb 5, 2026

Tested with success

Verified on Android 16

@seadowg seadowg merged commit 792f407 into getodk:v2026.1.x Feb 5, 2026
7 checks passed
seadowg added a commit to seadowg/collect that referenced this pull request Feb 10, 2026
Improve scrolling to questions and highlighting questions with errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor stays on the first question on a fieldlist when another question violates a constraint

5 participants