Closed kavimuru closed 1 year ago
Triggered auto assignment to @JmillsExpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)I think it would be better to consult the design team on the expected behaviour.
Apologies, I got assigned these during EC3 and I wasn't able to find time during the conference to triage. I'm now OOO for the rest of the week, so I'm going to re-apply the bug
label so that someone that's more available can help move this forward. Thanks!
Triggered auto assignment to @strepanier03 (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Okay, working on this now.
@Expensify/design - Can you please take a look at this one for expected behavior.
I actually think this makes sense that the overlay gets darker the deeper down menus you get, but if it's the only place we're going this dark maybe it's unintended.
Following the steps in the OP comment can be used to recreate this no problem.
Folks are coming back from EC3 so giving this another day before I bump again.
I raised this for discussion here, but because so many voices are currently out of the office this might not move forward until more are back online.
Going to move this forward and ask that we apply the same consistent overlay style to the Year page as the other menu pages.
@shawnborton - If you disagree with this decision let us know when you get back. We'll have plenty of time pausing moving forward if we need to but just in case this is the right choice we'll get a jump on correcting it.
Job added to Upwork: https://www.upwork.com/jobs/~0139c82137536ac15d
Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (External
)
Triggered auto assignment to @tylerkaraszewski (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Proposal # Please re-state the problem that we are trying to solve in this issue. Year search page of date of birth field in personal details has darker overlay color then any other sidemenus or popups
What is the root cause of that problem? When we select the Year in the calendar, there is multiple screen overlay added to the screen which is making the background overlay darker
What changes do you think we should make in order to solve the problem? In AuthScreens.js there are modalScreenOptions added to Select_Year. Please refer to the below code.
<RootStack.Screen
name="Select_Year"
options={modalScreenOptions}
component={ModalStackNavigators.YearPickerStackNavigator}
listeners={modalScreenListeners}
/>
There is an option named cardOverlayEnabled in modalScreenOptions. so we can spread the modalScreenOptions and make the cardOverlayEnabled false.
This will solve the problem. Please refer to the video attached.
https://github.com/Expensify/App/assets/55981820/47025553-df37-4f31-baf1-d91398c807c3
Proposal
Please re-state the problem that we are trying to solve in this issue. Year search page of date of birth field in personal details has darker overlay color then any other sidemenus or popups
What is the root cause of that problem? When we select the Year in the calendar, there is multiple screen overlay added to the screen which is making the background overlay darker
What changes do you think we should make in order to solve the problem? In AuthScreens.js there are modalScreenOptions added to Select_Year. Please refer to the below code.
<RootStack.Screen name="Select_Year" options={modalScreenOptions} component={ModalStackNavigators.YearPickerStackNavigator} listeners={modalScreenListeners} />
There is an option named cardOverlayEnabled in modalScreenOptions. so we can spread the modalScreenOptions and make the cardOverlayEnabled false.
This will solve the problem. Please refer to the video attached.
Untitled.mp4
This will introduce no overlay on refreshing the page while we are in below url:
http://localhost:8080/select-year?min=1873&max=2018&year=1990&backTo=/settings/profile/personal-details/date-of-birth
[Updated]
User seeing a darker overlay while user clicks the year picker. navigating back to the date picker again will show a lighter overlay.
Cumulative opacity is causing the darker overay. In other words, while opening the select-year
route, the new page is loaded as new modal. So, another overlay is being added. It will sum up the previous overlay's opacity of 0.6
. So the total cumulative overlay opacity will become (0.6 + 0.6 )=1.2.
We can observe that there are two results while searching for opacity: 0.6
in the developer tools elements section as the below image.
We can create a new action
named Overlay
to get/set the Overlay Onyx. It will use to store/retrieve the count of overlays.
We need to make use of the existing CardOverlay
component to render the overlay by defining the cardOverlay
of the screenOptions
. So we will get the overlay more handy.
Inside this component, add logic to conditionally toggle the opacity based on the count of the Overlay
. The overlay render will be executed multiple times in a view. So, we need to use React.memo
in CardOverlay
. If the overlay is already added, all the new overlays should use opacity 0
.
Since the render logic depends on the variables after rendering, we will need to use useEffect
or useState
to handle the variable updates.
We need to reset the Overlay count to zero while exiting the Overlay
or Modal
. We can make use of the callback functions like beforeRemove
defined in AuthScreens
for this purpose.
Update the modal screen definitions with the required screens. Eg: Select_Year, Report_Settings etc needs to be added.
I have requested a slack channel invite from jithil@outlook.com
, but not received the reply yet.
Year search page of date of birth field in personal details has darker overlay color then any other sidemenus or popups.
Let's see what went wrong:
This not only happens for the Select Year page, but it happens when any 2 screen modals open on top of each other, for example the Send Money -> Edit Description page.
We need to make sure we only show 1 overlay even when multiple screen modals open on top of each other.
It can be seen that we're already tracking the Modal visibility here https://github.com/Expensify/App/blob/0f33e2c22bb3670e7c47d78f2f3c604f3af29ca3/src/libs/actions/Modal.js#L48, however that logic is a bit outdated, now we can have multiple screen modals possibly overlaying each other we can not have a simple boolean field to track the Modal state.
We can:
visibleScreenModals
field to track the screen modals that are visible, this can be stored in Onyx, similar to the current isVisible
state. "Settings"
), when it's removed, we remove it from the list.cardOverlayEnabled: true
if the modal is the first one in the list, currently it's set to true
for all modals here. We can do it by connecting the AuthScreens
to the visibleScreenModals
prop.SelectPage
screen into the Settings
stack instead of its own stack, that makes sense since the select page screen is only used there. But there might be reasons why it's on its own stack, and this approach is not very scalable since we need to apply it to all other cases that have this issue (and any future case as well) so I still prefer the above.3
is to make the overlay opacity 0 for the modals that are not the first modal.visibleScreenModals
implementation details above, there're other ways we can do the same thing, for example checking the navigation state using navigationRef
to see which modal is the first one opened, ... But I found the above to be the cleanest.Looks like something related to react-navigation
may have been mentioned in this issue discussion.
As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js
files should not be accepted.
Feel free to drop a note in #expensify-open-source with any questions.
@aimane-chnaif - Little bump on the proposals above, thank you!
@tylerkaraszewski @strepanier03 @aimane-chnaif this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
I don't see satisfactory proposals yet.
I have seen several pages with the same behavior. i.e. Report Members, Report Settings
If year search page overlay is a bug to be fixed, I think it should be applied throughout the app. So the proposal should include all pages found with this behavior and working solution.
@strepanier03 thoughts?
@aimane-chnaif - Yes, completely agree. We want to use the same style on all the pages so a proposal covering all the pages is ideal.
@aimane-chnaif @tylerkaraszewski - Think we should double the price on this one?
@aimane-chnaif @tylerkaraszewski - Think we should double the price on this one?
@strepanier03 sure, let's bump price to get more proposals
Is there list of pages we have this issue? If yes, I could add test and apply the fix to all places.
Updated the proposal.
Meanwhile, investigating the issue further. Thanks.
Hi @strepanier03 @aimane-chnaif @tylerkaraszewski @strepanier03 I have updated the proposal with a new approach. It will be using Onyx to track the overlay added and we will only add an overlay if its not existed. We need React.memo
to support this.
Please review, and let me know the thoughts.
Proposal: https://github.com/Expensify/App/issues/19073#issuecomment-1563041704
@MrJithil I don't like that approach of using Onyx.
@aimane-chnaif So can we proceed with the modal screen definition update approach which I proposed before?
That would be more straight forward and minimal code changes are needed.
@aimane-chnaif what do you think of my proposal here. It solves the issues for all the pages where it happens.
Thanks!
Navigating to a page that is on a different root stack screen will stack the overlay making it darker.
We have a screen option that enable an overlay on each root screen. https://github.com/Expensify/App/blob/0813e2ca1476635a8324cbd9f998424663a33128/src/libs/Navigation/AppNavigator/AuthScreens.js#L185-L192
The overlay will stack on top of each other which will make it looks darker. The overlay color comes from here: https://github.com/Expensify/App/blob/0813e2ca1476635a8324cbd9f998424663a33128/src/libs/Navigation/AppNavigator/modalCardStyleInterpolator.js#L30-L37
The concept of the solution is basically similar to the others. We only want to enable the overlay for the first root screen (exclude the Home), but with a total different approach.
modalScreenOptions
to a function that accept an object of route
and navigation
.
This way, we will have the information of the navigation state. Navigation state contains routes
property that tells us what screens is currently in the "stack", while route
is the route of the screen itself. If I navigate to Settings, the routes
will be [Home, Setting].1
, as 0
is for the Home screen (see 1 above). To know the index of the current root screen, we can use _.findIndex
to find the index of where the route
is in the navigation routes
.I think it's kinda confusing, so here is the snippet of the code:
Year search page of date of birth field has darker overlay color than other side menus or popups.
When we open a modal that has modalScreenOptions
we add an overlay or an opacity which causes the screen to become darker as shown below.
So every time multiple modals overlap, the background opacity also overlaps or in other word, we add an overlay which causes the screen to get more and more darker.
The props
we pass to modalCardStyleInterpolater
here
as a third argument contains an index
property in addition to inverted
, layouts
properties....
This index
properties value, starting from 0, increments every time we open a new modal. So, for example, in this issue when we open settings => profile => personal details => date of birth => Select_Year
, the setting
will have an index value of 0 and Select_Year
will have an index value of 1. Since profile, personal details and date of birth are in SettingsModalStackNavigator
, the index value will not change.
Currently we are not using this index
property, so in modalCardStyleInterpolater.js
, we can use its value to determine the lowest modal and if it is the lowest modal we apply the opacity otherwise we apply an opacity of 0 as shown below
Code Reference
Inside modalCardStyleInterpolator.js
// Add index inside the curly bracket
export default (isSmallScreenWidth, isFullScreenModal, {index, current: {progress}, inverted, layouts: {screen}}) => {
....
// check the value of index and if it is 0( that is it is the lowest modal) then apply opacity otherwise apply an opacity of 0
opacity: index == 0 ? progress.interpolate({
inputRange: [0, 1],
outputRange: [0, variables.overlayOpacity],
extrapolate: ‘clamp’,
}) : 0,
}
Since we already have an index property, personally I don't think we need to come up with another way of determining the lowest modal.
None
@aimane-chnaif - any input on the proposals?
@tylerkaraszewski @strepanier03 @aimane-chnaif this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
The navigation refactor is merged on main and this issue is no longer reproducible.
Once we confirm that in next staging build, we can close this.
Hi @aimane-chnaif, will it be eligible for reporting bonus?
Hi @aimane-chnaif, will it be eligible for reporting bonus?
I am not sure since navigation refactor was planned long time ago. @strepanier03 will handle that.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@dhanashree-sawant - In this case, we'll pay the reporting bonus once we can close this GH as it was reported in good faith and we did not connect this to the navigation refactor earlier. Normally we treat these on a case-by-case basis and don't always pay for reporting bugs that have already planned fixes.
I've set a reminder to keep checking on this just in case it gets closed before I have a chance to pay.
I've hired you to a reporting job in Upwork.
Thanks @strepanier03, appreciate your decision to pay the bonus even though it was fixed by Navigation changes planned way back. I have accepted the offer on upwork.
Upwork job price has been updated to $250
You're welcome @dhanashree-sawant, thanks for reporting and working with us. I've paid you and closed the contract/left feedback.
I am going to close this now. Thanks everyone!
Hi @strepanier03 Issue is reproduced on build 1.3.40.1, reopening
https://github.com/Expensify/App/assets/93399543/27dab752-d7ce-40d8-ba02-c2e877569e60
https://github.com/Expensify/App/assets/93399543/76f8c8bf-d98a-4215-be4f-2017f502015c
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
I think this is now open for proposals
Triggered auto assignment to @CortneyOfstad (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
App should keep same overlay color throughout the app for all sidemenus and popups
Actual Result:
Year search page of date of birth field in personal details has darker overlay color then any other sidemenus or popups
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.14-14 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/43996225/2c608cb2-422a-4269-9848-cf1e03149e0f
Expensify/Expensify Issue URL: Issue reported by: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684227390734479
View all open jobs on GitHub
Upwork Automation - Do Not Edit