medic / cht-core

The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit.
https://communityhealthtoolkit.org
GNU Affero General Public License v3.0
439 stars 211 forks source link

The "View all" filter of the History section on the Contact Page | Detail View is not working correctly #9212

Closed michaelkohn closed 3 months ago

michaelkohn commented 3 months ago

Describe the bug When you select "View all" in the History section on the contact page | detail view, it hides all reports instead of showing all of them.

To Reproduce

  1. Select a contact that has a bunch of reports (ideally 3, 6, and 6+ months old)
  2. Tap on the "view all" option
  3. Notice that it shows no reports instead of all reports

Expected behavior It should show all reports

Screenshots See video below

Environment

view_all_issue

latin-panda commented 3 months ago

We need to redesign this a bit. For contacts with many reports that has a lot of activity going on, They won't see anything different in the 6 months and View all. It only displays 20 reports for faster rendering, then do we add pagination or a link to the reports list? Are these tabs even useful?

michaelkohn commented 3 months ago

If the user has fewer than 20 reports, then the filters are still meaningful/useful though, because it allows you to see reports older than 3 (or 6) months. So if it is a super quick fix to at least show the 20 on "view all", then I think we should just fix that now since it worked at some point.

I agree it is kind of a weird design pattern (you might expect each link to show a different "page" - as in pagination - of data but in our case, the next page - 6 months, for example - also includes everything from the previous page - 3 months - instead of just 3-6 months).

I do think it is useful to be able to see the longitudinal health history for the patient (ie their reports) and we know most CHWs come to the contacts page first for most things. @n-orlowski what do you think? What does Material tell us?

n-orlowski commented 3 months ago

A common pattern is to lazy load (no pagination) until all items per timeframe are displayed however it isn't best practice because it doesn't give users an indication of where they are / how far they have to get through content or an easy way to get back.

If we wanted to rethink this we might opt for a general pagination (ex. < 1-20 of 100 > ) as per Material's data tables.

garethbowen commented 3 months ago

Also raised on the forum.