getodk / xforms-spec

The XForms-derived specification used in the ODK ecosystem. If you are interested in building a tool that is compliant with the forms rendered by ODK tools, this is the place to start. ✨⚒✨
https://getodk.github.io/xforms-spec/
30 stars 26 forks source link

Only use group in repeat as repeat instance name if it's the repeat's only child #310

Open lognaturel opened 5 months ago

lognaturel commented 5 months ago

In https://github.com/getodk/xforms-spec/issues/141, we decided to recommend that clients use the label of an inner group as a repeat instance label. We were not specific about what to do in case of other contents in the repeat.

https://github.com/getodk/xforms-spec/pull/309 makes a clarification of existing behavior in both Collect and Enketo: a group is only used this way if it's the repeat's first child.

In the original issue, we explicitly discussed the case where an inner group is followed by other items in the repeat but not in the group. We decided to still use the first group's label as the repeat instance label. This works ok in the Collect hierarchy view which is what this spec change was designed for.

It doesn't work as well in Enketo where multiple repeat instances are shown on a screen and can be individually collapsed.

Let's only use the inner group label this way if the inner group is the repeat's only child.