Skip to content

Display default images#7286

Draft
grzesiek2010 wants to merge 6 commits into
getodk:masterfrom
grzesiek2010:COLLECT-7282
Draft

Display default images#7286
grzesiek2010 wants to merge 6 commits into
getodk:masterfrom
grzesiek2010:COLLECT-7282

Conversation

@grzesiek2010

@grzesiek2010 grzesiek2010 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Closes #7282
Closes #7283

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

I think we need to revisit how default media files should be handled. We already support default images for annotate, draw, and signature questions because it makes sense to allow users to draw on a predefined image or sign a specific document. However, for basic image questions, there wasn’t a clear use case, so we initially skipped displaying default images altogether.

That said, even in the cases mentioned above, where a predefined background might be useful for annotation or signature, I don’t think it makes sense to display a default image unless the user actually interacts with it and saves it (default images should only be displayed in the drawing screen). Only then does it become a real answer image; otherwise, it remains just a preloaded asset that will never be stored in the instance folder. This could be misleading, so it should be discussed in a separate issue.

For now, for simplicity, I enabled displaying default images for all image question types, including basic images.

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?

We need to test displaying default images both in image questions and in the hierarchy view. As I mentioned above, for simplicity I enabled this option for all image question types.

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

There's a form attached to 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 marked this pull request as ready for review June 26, 2026 08:59
@grzesiek2010 grzesiek2010 requested a review from seadowg June 26, 2026 08:59

@seadowg seadowg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we need to revisit how default media files should be handled. We already support default images for annotate, draw, and signature questions because it makes sense to allow users to draw on a predefined image or sign a specific document. However, for basic image questions, there wasn’t a clear use case, so we initially skipped displaying default images altogether.

That said, even in the cases mentioned above, where a predefined background might be useful for annotation or signature, I don’t think it makes sense to display a default image unless the user actually interacts with it and saves it (default images should only be displayed in the drawing screen). Only then does it become a real answer image; otherwise, it remains just a preloaded asset that will never be stored in the instance folder. This could be misleading, so it should be discussed in a separate issue.

I'm confused. Do older versions of Collect support using form media as a default or not? It seems to me like the issues and this PR description imply they weren't expected to be shown - it's just that we additionally saw an error?

@grzesiek2010

Copy link
Copy Markdown
Member Author

I'm confused. Do older versions of Collect support using form media as a default or not?

We already supported default images for annotate, signature, and draw questions. Basic image questions were the exception - they were the only widget still inheriting from the old BaseImageWidget that didn't support this feature.

For those three question types, it makes sense to support default images as predefined backgrounds that users can draw on, so I restored that functionality. However, for the sake of simplicity, I didn't make the same exception for basic image questions because, as I mentioned above, we need to revisit and maybe redesign that functionality soon anyway because there are some questions to consider:

  • Maybe we should log analytics to see whether this feature is actually being used.
  • Maybe default images should be blocked in Pyxform for basic image questions, where they don't really make sense.
  • Although default images make sense for signature, annotate, and draw questions, it doesn't make sense to display them initially. They only become part of the answer after the user opens the drawing screen and saves them, so showing them before that is confusing.

@grzesiek2010 grzesiek2010 requested a review from seadowg June 30, 2026 09:55
@seadowg

seadowg commented Jun 30, 2026

Copy link
Copy Markdown
Member

Although default images make sense for signature, annotate, and draw questions, it doesn't make sense to display them initially. They only become part of the answer after the user opens the drawing screen and saves them, so showing them before that is confusing.

This is where my heads at: we should just never show default images in form entry (including the hierarchy). They only make sense in the drawing view. I'll add an item to our weekly sync about this as it'd be good to discuss synchronously I reckon.

@seadowg seadowg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Going to disuss as a team (#7286 (comment))

@seadowg seadowg added the high priority Should be looked at before other PRs/issues label Jul 1, 2026
@grzesiek2010 grzesiek2010 marked this pull request as draft July 1, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

high priority Should be looked at before other PRs/issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New error in an image widget with a default image "selected file in not valid... " in the hierachy view when there's a default image

2 participants