android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

SDC catalog app: Show enable when (skip logic) behavior

Open shelaghm opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. Demonstrate to developers how the SDC skip logic behavior works.

Describe the solution you'd like Add skip logic as a widget in the behavior tab. Skip logic should show a realistic example of how skip logic works. Example: By selecting yes on the first question, the second question appears. If no is selected, the question does not appear.

Additional context Open to feedback on what we should show. Designs are WIP. Screen Shot 2022-08-02 at 14 28 27

shelaghm avatar Aug 02 '22 21:08 shelaghm

@shelaghm Informative UI for skip logic behavior at the bottom of screen, It will be the part of app or need to add as a component in SDC and refer it in app?

PallaviGanorkar avatar Sep 19 '22 12:09 PallaviGanorkar

@PallaviGanorkar the informative UI was intended to show up in the SDC Catalog app, but not in deployment apps. The idea behind the grey box is to help visualize the skip behavior that's "invisible" on screen, but can be found in the code. In the library itself the skip logic informative UI would not be displayed.

@jingtang10 Curious to hear your thoughts?

shelaghm avatar Sep 19 '22 22:09 shelaghm

The fact that the text in grey box changes means that it'll need to be part of the sdc widget using enable when (different text gets enabled when answer changes). Solution:

  1. we use the same text for yes/no answers. and that can be just a additional box in the catalog app.
  2. if we can align the look and feel of the grey box to a certain widget in sdc lib (instruction? help text?) then we can just change the questionnaire to use enable when to enable different text. (EDIT: probably harder to use icon or header skip logic in the grey box)

Additional comment: @shelaghm should we use the term enable when which is more FHIR, instead of skip logic, which is more ODK.

jingtang10 avatar Sep 20 '22 10:09 jingtang10

for 2. releated ticket: https://github.com/google/android-fhir/issues/1528 but i don't think they're the same now...

jingtang10 avatar Sep 20 '22 10:09 jingtang10

@jingtang10 Yes, this is the same grey box as the help text box. We don't need to use the icon for this box, so can remove that if it adds a lot of complexity Yes, I suggest we use terminology that aligns with FHIR, so lets update this component to enable when as you suggested

shelaghm avatar Sep 21 '22 22:09 shelaghm

@PallaviGanorkar will look into if we can use dynamic text to replace the Help header text. If that's not possible, then we use a simpler text box such as option 1 described by Jing above.

shelaghm avatar Sep 27 '22 04:09 shelaghm

Skip logic text in box same for both states (Y and N selected): "If Yes is selected, a follow-up question is displayed. If No is selected, no follow-up questions are displayed."

shelaghm avatar Sep 27 '22 04:09 shelaghm

@shelaghm I have used info icon from https://fonts.google.com/icons?selected=Material%20Icons%3Ainfo%3A Please let me know if any change required in icon

PallaviGanorkar avatar Oct 06 '22 10:10 PallaviGanorkar

@shelaghm Please find attached screenshot below, info grey box is displayed at the bottom of screen as other UI on the screen is rendered from SDC lib and i don't have reference to particular UI component from Catalog App

Skip_Logic_info

PallaviGanorkar avatar Oct 06 '22 10:10 PallaviGanorkar

@PallaviGanorkar this looks good to me!

shelaghm avatar Oct 06 '22 20:10 shelaghm

@shelaghm Setting icon on the right top of the screen, is there any functionality expected on click of this icon?

PallaviGanorkar avatar Oct 07 '22 10:10 PallaviGanorkar

@PallaviGanorkar the settings/gear icon is used to display error states I don't believe we want to show error states for this screen as skip logic is a behavior and there's no error state associated with it. We can remove the gear icon from this screen unless there's some other functionality we want to show under the gear icon? @jingtang10 @santosh-pingle what do you think?

shelaghm avatar Oct 07 '22 19:10 shelaghm

@shelaghm sgtm! thanks.

just to summarise - we are putting this in the catalog app (instead of using the help item control and rewrite the questionnaire) because of the "skip logic" title in the grey box. if we want to just reuse the help item control, the title would not be configurable to "skip logic".

pallavi has already done this in her latest udpate for the pr.

and the gear icon has been removed.

jingtang10 avatar Oct 14 '22 13:10 jingtang10

Sounds good. Thanks for the update!

shelaghm avatar Oct 14 '22 17:10 shelaghm