Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert hierarchy to Fragment #6516

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Nov 18, 2024

Work towards #5420
Closes #6303

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

I've tried to keep changes to a minimal here with the main goal just being to get the majority of the hierarchy code into a Fragment. There's only two structural changes to highlight really:

  1. I ended up rewriting the hierarchy's options menu so that it uses the new MenuProvider API. I felt like this made more sense than rewriting it to use the deprecated Fragment methods.
  2. The new Fragment uses a new FormHierarchyViewModel to manage state. This will most likely get merged into FormEntryViewModel, but I think that'll make more sense once form entry has also been moved to a Fragment.

I also added some new tests for code that I found had none.

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?

This shouldn't change any behaviour and the big risk here is that it either does or introduces bugs to flows using the form hierarchy. A general test of using the hierarchy (during form entry and viewing) would be good here.

This also changes the jump/summary icon to the new one!

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

@seadowg seadowg force-pushed the view-only branch 2 times, most recently from c0b1039 to a44178c Compare November 21, 2024 11:46
@seadowg
Copy link
Member Author

seadowg commented Nov 22, 2024

@getodk/testers marking this ready for testing before review as it'd be good to get a first pass before I clean things up in case there are some fundamental problems here I've missed.

@seadowg seadowg force-pushed the view-only branch 2 times, most recently from a01cd5a to a2fa91f Compare December 11, 2024 12:06
@dbemke
Copy link

dbemke commented Dec 16, 2024

There used to be 2 icons: to go to the hierarchy view and to go "up" in the hierarchy (the second screenshot). Now there's only one icon and it feels a bit confusing in groups and repeats cause the new icon doesn't suggest where the user is moved after tapping it. Is it expected?
newHierarchy
hierarchyIcon

@seadowg
Copy link
Member Author

seadowg commented Dec 16, 2024

There used to be 2 icons: to go to the hierarchy view and to go "up" in the hierarchy (the second screenshot). Now there's only one icon and it feels a bit confusing in groups and repeats cause the new icon doesn't suggest where the user is moved after tapping it. Is it expected?

I think this was the intention of #6303, but please correct me if I'm wrong @alyblenkin.

@alyblenkin
Copy link
Collaborator

I think this was the intention of #6303, but please correct me if I'm wrong @alyblenkin.

This is a good catch! The goal was just to update the east arrow icon, not the up icon as well. I think the up arrow is still a helpful visual indicator that you're going back up to the table of contents.

@seadowg
Copy link
Member Author

seadowg commented Dec 16, 2024

This is a good catch! The goal was just to update the east arrow icon, not the up icon as well. I think the up arrow is still a helpful visual indicator that you're going back up to the table of contents.

That makes sense. Just to be sure though before I unwind anything, the Figma link shows the hierarchy with the list icon in the top right:

Screenshot 2024-12-16 at 16 47 05

I'm guessing that's a mistake?

@alyblenkin
Copy link
Collaborator

Sorry I think the group folder icon in the first mockup is a mistake. However, now I'm second guessing myself because we discussed this a while back. @lognaturel correct me if I'm wrong here, but our goal was just update the east arrow, not the up arrow icon as well.

@alyblenkin
Copy link
Collaborator

alyblenkin commented Dec 16, 2024

To clarify, I think the list icon would work on it's own if we didn't already have the up arrow, but I think it's a pretty ingrained pattern now. I think the list icon would suggest you go back to the top level given the current pattern where there is more of this concept of moving up or down, but you could also imagine tapping to keep going to the main table of contents. I don't think this is a stronger design choice, rather it could be another option. Not worth considering given we haven't had folks bring up any issues.

@lognaturel
Copy link
Member

Feels right to me to leave the up arrow as it is. I think navigating up a level feels relatively clear. I don't think the table of contents icon works well there because it would suggest you go all the way back to the top level.

@alyblenkin
Copy link
Collaborator

@seadowg - sorry that you have to unwind things there! I've update the design.

@seadowg
Copy link
Member Author

seadowg commented Dec 17, 2024

sorry that you have to unwind things there! I've update the design.

No worries! I just wanted to double check.

@seadowg
Copy link
Member Author

seadowg commented Dec 17, 2024

@getodk/testers that should be good to go again!

@dbemke
Copy link

dbemke commented Dec 20, 2024

Tested with success!

Verified on devices with Android 10, 14

Verified cases:

  • the new icon in the hierarchy
  • groups and repeats
  • the hierarchy view in new forms, drafts, Ready to send, Sent
  • the hierarchy view after recovering a savepoint
  • moving backwards enabled and disabled
  • RTL
  • light and dark mode
  • don't keep activities enabled and disabled

@seadowg seadowg marked this pull request as ready for review December 20, 2024 14:52
@seadowg seadowg requested a review from grzesiek2010 December 20, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update summary/jump icon
4 participants