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! |
| */ | ||
| function getDefaultDrawerState(isSmallScreenWidth) { | ||
| function getDefaultDrawerState(isSmallScreen) { | ||
| isSmallScreenWidth = isSmallScreen; |
There was a problem hiding this comment.
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.
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.
I couldn't find another way to get the screen size except using Dimensions.
There was a problem hiding this comment.
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.
Isn't there any API in Dimensions to listen to the changes? @mollfpr Explore the options.
There was a problem hiding this comment.
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.
Yep, that should do.
There was a problem hiding this comment.
Yep, that should do.
@aldo-expensify I already confirmed it would work.
There was a problem hiding this comment.
Yep, that should do.
@aldo-expensify I already confirmed it would work.
The version with the listener?
There was a problem hiding this comment.
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
| Dimensions.addEventListener('change', ({window}) => { | ||
| isSmallScreenWidth = window.width <= variables.mobileResponsiveWidthBreakpoint; | ||
| }); | ||
|
|
There was a problem hiding this comment.
@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.
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.
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.
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?
|
@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. |
aldo-expensify
left a comment
There was a problem hiding this comment.
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. |
PR Reviewer Checklist
|
Santhosh-Sellavel
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followed/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris 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