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
438 stars 208 forks source link

Maintain a selective history of pages visited #1565

Open alxndrsn opened 8 years ago

alxndrsn commented 8 years ago

When switching between views of different content, the app should maintain a history stack so that Android's hardware-back-button (HBB) can be used to reverse the navigation through this list.

Examples

Example 1

action navigates to HBB target filter-bar-X/< target
Contacts tab Contacts primary tab N/A
select place in list Place: District 1 Contacts Contacts
select place in child list Place: Health Centre A ? ?
select place in child list Place: Alice A's Family ? ?
[edit] Edit (page 1): Alice A's Family ? ?
[next page] Edit (page 2): Alice A's Family ? ?
[save] Place: Alice A's Family ? ?
[add child] Create: Person ? ?
[save] Person: Bob A ? ?

Example 2

action navigates to HBB target filter-bar-X/< target
Contacts tab Contacts primary tab N/A
[search] Contacts (filtered by search term) Contacts (unfiltered) N/A
select contact in list Person: Bob A Contacts (filtered by search term) ?
select family that Bob A belongs to Place: Alice A's Family Person: Bob A ?

Design work required

Please:

  1. review the tables already filled above and correct as necessary
  2. fill in unknown value in tables (currently marked ?)
  3. add extra examples detailing other cases not included above

    Useful links

It may be useful to consider the Android UX guidelines ref temporal vs hierarchical navigation, e.g.:

abbyad commented 8 years ago

Thanks @alxndrsn, I'll do a first pass and confirm with other team members/users.

abbyad commented 8 years ago

Here is my first pass, I will check with other team members and users before final confirmation. Given that this is not something that will be implemented before the field test we can use actual user feedback for this as well.

Example 1

action navigates to HBB target filter-bar-X/< target
Contacts tab Contacts primary tab N/A
select place in list Place: District 1 Contacts Contacts
select place in child list Place: Health Centre A Place: District 1 Place: District 1
select place in child list Place: Alice A's Family Place: Health Centre A Place: Health Centre A
[edit] Edit (page 1): Alice A's Family Place: Alice A's Family [X]: Place: Alice A's Family
[next page] Edit (page 2): Alice A's Family Edit (page 1): Alice A's Family [X]: Place: Alice A's Family (different than HBB)
[save] Place: Alice A's Family Place: Health Centre A Place: Health Centre A
[add child] Create: Person Place: Alice A's Family Place: Alice A's Family
[save] Person: Bob A Place: Alice A's Family Place: Alice A's Family

Example 2

action navigates to HBB target filter-bar-X/< target
Contacts tab Contacts primary tab N/A
[search] Contacts (filtered by search term) Contacts (unfiltered) N/A
select contact in list Person: Bob A Contacts (filtered by search term) Contacts (filtered by search term)
select family that Bob A belongs to Place: Alice A's Family Person: Bob A Person: Bob A
alxndrsn commented 8 years ago

Can I update the original ticket with your table?

abbyad commented 8 years ago

Sure, although I am still not convinced about Example 2 action 4.... We should do more research before finalizing.

abbyad commented 8 years ago

We should also have an example for going from the patient profile to a report details page in the History/Reports tab.

abbyad commented 8 years ago

Alternate using the filter back button strictly as "hierarchical up", and the HBB as "temporal back", as per the design guidelines.

Example 1

action navigates to HBB target (temporal) filter-bar-X/< target (hierarchical)
Contacts tab Contacts primary tab N/A
select place in list Place: District 1 Contacts [<] Contacts
select place in child list Place: Health Centre A Place: District 1 [<] Contacts
select place in child list Place: Alice A's Family Place: Health Centre A [<] Contacts
[edit] Edit (page 1): Alice A's Family Place: Alice A's Family [X]: Place: Alice A's Family
[next page] Edit (page 2): Alice A's Family Edit (page 1): Alice A's Family [X]: Place: Alice A's Family
[save] Place: Alice A's Family Place: Health Centre A [<] Contacts
[add child] Create: Person Place: Alice A's Family [X]: Place: Alice A's Family
[save] Person: Bob A Place: Alice A's Family [<] Contacts

Example 2

action navigates to HBB target filter-bar-X/< target
Contacts tab Contacts primary tab N/A
[search] Contacts (filtered by search term) Contacts (unfiltered) N/A
select contact in list Person: Bob A Contacts (filtered by search term) [<] Contacts (unfiltered)
select family that Bob A belongs to Place: Alice A's Family Person: Bob A [<] Contacts (unfiltered)

Example 3

action navigates to HBB target filter-bar-X/< target
Contacts tab Contacts primary tab N/A
select contact in list Person: Bob A Contacts (filtered by search term) [<] Contacts (unfiltered)
select report about Bob A Report tab: Alice A's Family Person: Bob A [<] Reports (unfiltered)
abbyad commented 8 years ago

We already use color for context, but if we use the < as "hierarchical up" then we may want to include the tab's icon with the chevron to specify where the user would be going if they press up.

abbyad commented 8 years ago

Assigning to @diannakane for review.

diannakane commented 8 years ago

Here's the latest comments on this, done just before Christmas. The disputes are mostly in column D, in regards to whether places should target directly back to Contacts ("owned" individually by contacts), or if they should target to their hierarchical next-level-up place. https://docs.google.com/a/medicmobile.org/spreadsheets/d/1yo6p7gccJrlg5wbtgV6z0CrKWTII-a_4kkzpUJQ3XRw/edit?usp=sharing

Let's revisit when you're back from vacation, @abbyad?

alxndrsn commented 6 years ago

My notes from discussion:

  1. enketo forms and their pages should not be written to browser history (window.history.pushState()); this may require an angular change)
  2. login page should not be written to history stack (is this possible? perhaps we can overwrite if we check referer header? perhaps we only care on mobile?)
  3. we may need to check in angular history writing that we don't write the same history item twice in a row (e.g. if an enketo form returns the user to the page that triggered the form)

On desktop:

Browser back button:

In enketo:

Otherwise:

On mobile:

Filter bar back button (<) triggers window.history.back(). Hardware back button:

In enketo forms:

In a modal (hotdog menu, fab action menu, upgrade modal etc.):

If the history stack is empty:

Otherwise:

abbyad commented 5 years ago

@amandacilek this issue is a little old but perhaps still relevant. It would be good to get your opinion to know if navigation problems still exist, and how they should be corrected.

amandacilek-zz commented 5 years ago

Yes, back/forward navigation problems do still exist. We had originally planned to address these at the same time as the navigation UI update. We should consider pulling this work out and addressing it separately cc @MaxDiz. The fixes won't be as comprehensive without the UI updates but I think there are still improvements to be made.

In addition to Alex's summary above, please also reference this deck with visual diagrams: https://docs.google.com/presentation/d/1YHSNwx7hFyHrb3vWYUCTgH41AtQsn9WxDWo-CJGz4ug/edit#slide=id.p

Here is a summary of our conclusions:

On mobile

On desktop

antonykhaemba commented 4 years ago

Feedback shared by Brac team Brac are piloting v3.8.1 for 40 CHP's in one of the branches and they are expected to upgrade from the current v2.8 to v3.8.1 in a few weeks time. A concern was raised by the CHPs that when a user is under contact profile clicking back takes them to all families in the area instead of the immediate parent profile. This also happens when a user opens a task on the contact profile when he clicks back the app takes the user back to all the tasks that a user has instead of the contact profile. The previous v2.8 was working well and most of the CHP are concerned and some confused. They feel like there are changes on v3.8.1 and yet they have not yet been updated. Brac team have requested that if it possible we could fix the issue before the upgrade of all the branches, tentatively in the next 2 weeks. cc @MaxDiz @dianabarsan @kennsippell @jonathanbataire @derickl and @PhilipNgari

MaxDiz commented 4 years ago

Hi @antonykhaemba glad to hear this upgrade is moving forward. A 2-week turnaround for a non-critical improvement is a tough sell. It is possible to review this issue for a late add to v3.10 (in development currently). Would BRAC be willing to upgrade to v3.10 when released?

garethbowen commented 4 years ago

This is a highly complex issue (as you can tell by the comments above) which probably needs another round of design before we look at how to solve it. Adding it to 3.10 would undoubtedly delay its release.

@antonykhaemba How critical is this issue for Brac?

antonykhaemba commented 4 years ago

Adding @brian256 to discuss with Brac Team and advise if Brac will be willing to upgrade to 3.10 or maybe 3.11.