getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
700 stars 1.35k forks source link

Fixed handling repeatable groups wrapped with regular ones #6105

Closed grzesiek2010 closed 1 week ago

grzesiek2010 commented 1 month ago

Closes #6015

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

We had at least two issues with this case when a repeatable group was wrapped with a regular one:

  1. The fact that the regular group in the hierarchy was visible as a removable one. I've described it in https://github.com/getodk/collect/issues/6015#issuecomment-2068924271
  2. A wrong path was displayed in the hierarchy when navigating up.

I think I've fixed both issues using the appropriate form index.

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?

The pr is not big but I find it risky. We need to test the hierarchy view with nested groups (repeatable and regular ones) to make sure they are displayed in the correct way. @dbemke @srujner @WKobus please be creative and create your own forms ideally with multiple levels of nested groups.

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

The form I've attached in this comment: https://github.com/getodk/collect/issues/6015#issuecomment-2068924271

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:

seadowg commented 2 weeks ago

Given that @grzesiek2010 has flagged this as risky, I'll wait to merge until after testing.

dbemke commented 2 weeks ago

There is a difference between the way group/ repeats are shown in 3231nested-repeats-for-audit.xml.txt. Which one is the expected one? The light mode is the PR version, the dark mode is the master version. A different icon: iconsRepeats

Difference in the way outer > inner is shown: 2023vrPR

grzesiek2010 commented 1 week ago

To me the PR version works correctly and what you see on the master branch and older versions was wrong, for example the duplicate section Inner repeat 2 in the path (the second example) or the Inner repeat 2 > 1 displayed where you are on the outer (regular group) level (the first example).

dbemke commented 1 week ago

Tested with Success!

Verified on a device with Android 10

Verified Cases:

WKobus commented 1 week ago

Tested with Success!

Verified on a device with Android 14