Skip to content

Improve saving and validating answers for GeoTrace and GeoShape questions#7016

Merged
grzesiek2010 merged 19 commits intogetodk:masterfrom
grzesiek2010:COLLECT-6984_2
Jan 14, 2026
Merged

Improve saving and validating answers for GeoTrace and GeoShape questions#7016
grzesiek2010 merged 19 commits intogetodk:masterfrom
grzesiek2010:COLLECT-6984_2

Conversation

@grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jan 9, 2026

Closes #6984
Closes #7015
Closes #6993
Closes #7004
Closes #7012

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

I'm going to add comments below with some explanations.

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?

This PR addresses five issues, but I believe this one is the most risky: #6984
We need to verify that scrolling to the updated question works correctly across different devices.

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

Forms are linked in the issues.

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 changed the title Collect 6984 2 Improve saving answers for GeoTrace and GeoShape questions Jan 9, 2026
@grzesiek2010 grzesiek2010 marked this pull request as ready for review January 9, 2026 22:44
@grzesiek2010 grzesiek2010 requested a review from seadowg January 9, 2026 22:54
@grzesiek2010 grzesiek2010 changed the title Improve saving answers for GeoTrace and GeoShape questions Improve saving and validating answers for GeoTrace and GeoShape questions Jan 9, 2026
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.

@grzesiek2010 grzesiek2010 requested a review from seadowg January 12, 2026 12:57
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.

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.

@seadowg seadowg self-requested a review January 13, 2026 13:29
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.

@grzesiek2010 grzesiek2010 requested a review from seadowg January 14, 2026 11:25
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.

Looks good! Just one change I'd like to see.

@grzesiek2010 grzesiek2010 merged commit 3fd0911 into getodk:master Jan 14, 2026
7 checks passed
@dbemke
Copy link

dbemke commented Jan 15, 2026

Could you send us the apk with all map tokens?

@dbemke
Copy link

dbemke commented Jan 15, 2026

Re-rendering answers on a field-list seems to take too much time. I can even try to tap a different question before an answer is shown. What do you think- is it too long (and I should file an issue) or it's a tradeoff?

XRecorder_15012026_080231.mp4

@grzesiek2010
Copy link
Member Author

Could you send us the apk with all map tokens?

Here you go:
ODK-Collect-v2025.4.0-beta.2-191-g3fd09114ae.zip

@grzesiek2010
Copy link
Member Author

Re-rendering answers on a field-list seems to take too much time. I can even try to tap a different question before an answer is shown. What do you think- is it too long (and I should file an issue) or it's a tradeoff?

Re-rendering is the process of rebuilding the form view and showing or hiding questions based on the new answer. The re-rendering itself happens immediately, without any delay.
What you’re describing is actually the scrolling to the updated question. After re-rendering, the list ends up at the top, so we need to scroll to the relevant question. Unfortunately, that scrolling requires a small delay (0.4s) to work correctly.
This is the same mechanism used when scrolling to a question with an error after form validation.

It’s not perfect, but if we want to file an issue, it should be a general one covering all cases where scrolling is used.

@srujner srujner mentioned this pull request Jan 15, 2026
6 tasks
@WKobus
Copy link

WKobus commented Jan 19, 2026

Tested with Success!

Verified on device with Android 16, 10

Verified cases:

  • Listed issues no longer occur:
  1. Field list scrolled to the top after selecting an answer in select one from map #6984
  2. Form advances on every point change in geoshape/trace with incremental + quick appearance #7015
  3. Removed trace/shape present on the map #6993
  4. Required message in the constraint snackbar in geoshape/trace #7004
  5. Null geometry values remove the required error in geoshape/trace #7012
  • moving points in geoshape and geotrace in Google maps, Mapbox, OSM, Carto, USGS in forms with incremental true and false, with constraints and required questions
  • moving point while recording location is on (all methods), off and after reopening the map
  • verifying if snackbars work as expected
  • check if snackbar does not cover buttons on map
  • adding and removing points
  • exploratory testing: moving points and tapping differents buttons, minimizing the app, screen rotation etc.
  • regression checks in all geo questions

@srujner
Copy link

srujner commented Jan 19, 2026

Tested with Success!

Verified on device with Android 12, 10

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