-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix combobox minimize #9706
Fix combobox minimize #9706
Conversation
@Santhosh-Sellavel Can you help me to test on Android native? I can't run the android on my local. Thanks! |
src/libs/Navigation/Navigation.js
Outdated
* @returns {String} | ||
*/ | ||
function getDefaultDrawerState(isSmallScreenWidth) { | ||
function getDefaultDrawerState(isSmallScreen) { | ||
isSmallScreenWidth = isSmallScreen; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This getter having a side effect of setting isSmallScreenWidth
feels too dirty. navigate
calling navigationRef.current.dispatch(CustomActions.pushDrawerRoute(route, isSmallScreenWidth));
depends on getDefaultDrawerState
having been called before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we okay using your approach to get the dimension?
const initialDimensions = Dimensions.get('window');
const isSmallScreenWidth = initialDimensions.width <= variables.mobileResponsiveWidthBreakpoint;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find another way to get the screen size except using Dimensions
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I came with when I was testing, I didn't see any other way that didn't involve changing too many things (I must say I didn't tried much :P)
Thoughts @Santhosh-Sellavel ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there any API in Dimensions to listen to the changes? @mollfpr Explore the options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing something, but if that code is inside pushDrawerRoute
, wouldn't it be up to date when that function is called? pushDrawerRoute
doesn't get called when minimizing or expanding the window, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that should do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that should do.
@aldo-expensify I already confirmed it would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that should do.
@aldo-expensify I already confirmed it would work.
The version with the listener?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we okay using your approach to get the dimension?
const initialDimensions = Dimensions.get('window'); const isSmallScreenWidth = initialDimensions.width <= variables.mobileResponsiveWidthBreakpoint;
Sorry for the confusion, I thought we are determining once. This way itself will work if it is determined every time.
@aldo-expensify
src/libs/Navigation/CustomActions.js
Outdated
Dimensions.addEventListener('change', ({window}) => { | ||
isSmallScreenWidth = window.width <= variables.mobileResponsiveWidthBreakpoint; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Santhosh-Sellavel @aldo-expensify I adding a listener to get the screen size. It's should reflect the screen size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum, I still don't understand how Dimensions.get('window');
would be outdated. From the documentation it looks like it should return the current width, up to date when is used by pushDrawerRoute
.
I don't think this is necessary at all.
@Santhosh-Sellavel can you explain more why you think it would "not reflect correctly"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So let's go with the first way right @aldo-expensify or let's keep this? I'll leave it to you to decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Santhosh-Sellavel , I got a bit confused in the other conversation :P
Considering that the "first way" worked fine, I prefer the first way because it is more simple than keeping this variable up to date with a listener. Can you revert this last commit introducing the listener?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! @mollfpr kindly update the PR
@aldo-expensify @Santhosh-Sellavel updated! |
What issue you are facing in the local? |
@mollfpr Steps:
Bug1.movcc: @aldo-expensify |
@Santhosh-Sellavel I tried to reproduce the problem you see, but didn't happen to me. Does it always happen to you? or sometimes? can you check if you don't have the same problem in |
I pulled from main and made the changes. |
@Santhosh-Sellavel I'm unable to produce the above issue. |
Reviewing again now. |
|
Pulled changes again today. Not reproducible now. But I'm afraid this might be a regression where I'm missing exact steps to reproduce now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested again and it seems to work fine.
I'll get another pair of eyes just to be sure.
I think it’s because I update my Java to 17, I did’nt have enough time to fix the JDK. Btw I’m using apple chip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
PR Reviewer Checklist
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
thanks for reviewing again @Santhosh-Sellavel ! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
I do wish that a broader conversation would have been started about this PR and solution. Almost every issue dealing with @Santhosh-Sellavel please recall these posts (maybe you have not seen them) https://expensify.slack.com/archives/C02NK2DQWUX/p1652908236507109 @aldo-expensify I'm not sure what I could have done differently here and not casting any blame for accepting this solution. Maybe I could have been more proactive here or there is some way to lock the file so it won't be edited anymore. |
…ions2 [No QA] Revert #9706. Rename file to `DeprecatedCustomActions.js` to prevent further editing
🚀 Deployed to staging by @aldo-expensify in version: 1.1.87-0 🚀
|
🚀 Deployed to production by @yuwenmemon in version: 1.1.87-9 🚀
|
Details
Adding history router with type drawer to only when on mobile. On web or desktop size we don't need the drawer to toggle.
Fixed Issues
$ #8841
Tests
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
Screenshots
Web
screen-recording-2022-07-05-at-232433_9Fiwh2QP.mp4
Mobile Web
screen-recording-2022-07-05-at-232932_kwktq1nb.mp4
screen-recording-2022-07-05-at-232527_N2pCHoto.mp4
Desktop
screen-recording-2022-07-05-at-233053_P9Cvk1K0.mp4
iOS
Screen.Recording.2022-07-06.at.22.48.41.mov
Android