-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Added option to get user's current location #26546
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@narefyev91 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Some questions:
cc: @hayata-suenaga |
@huzaifa-99 Great clarifying questions and hard work 🚀 I answered your questions below 🙇
Is the location associated with "Your Location" suggestion is the location when the user last used the current location option?
I'm asking the internal product team about this. I'll get back to you once they decide on this 🙇
I believe the left one is the current one? Where did you come up with the right choice / text? I answered questions in the respective comments 🙇 |
Yes
We can do any of that, I think not saving it as a recently used address might be better if that sounds good?. To do this we have to avoid running this logic when the user is using the current location App/src/libs/actions/Transaction.js Lines 105 to 110 in 9701fbe
If we want to filter it, its also simple and we can do it here. I will wait for your suggestion here to proceed. @hayata-suenaga
I actually copied it from the |
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.
A few comments.
src/components/LocationErrorMessage/BaseLocationErrorMessage.js
Outdated
Show resolved
Hide resolved
Thank you for the feedback @parasharrajat. I have addressed your comments above and also left some questions here 1, 2 and 3. |
There was a package-lock conflict again. To be sure, I merged and retested Android again, and it still works. Bumping for final review @hayata-suenaga. |
Testing on chrome Screen.Recording.2023-10-03.at.9.15.51.AM.mov@huzaifa-99 I thought the design decision was not to use the whole page blocking loader |
@huzaifa-99 while testing on desktop, I realized that I cannot click the "+" icon in the text composer. The issue is also present on chrome. Can you retest and confirm? Maybe pulling the latest main will fix it? Screen.Recording.2023-10-03.at.9.19.47.AM.mov |
I'm having trouble testing on iOS (the app thinks the device is offline when it's not), but I was at least able to confirm that I can click the "+" icon of the text composer on iOS Screen.Recording.2023-10-03.at.9.45.31.AM.mov |
Yes, originally it was suggested but i think we ignored it in favour of merging,
Hm, I think it was an issue on main, I merged main and tested on web chrome / desktop / android native / ios native and the "+" icon in composer works there. cc: @hayata-suenaga |
@hayata-suenaga gentle bump for review. |
Can we please merge this PR before there are more conflicts? We can create follow-up PRs if something gets missed which I think is very unlikely. |
onPress={onAllowLocationLinkPress} | ||
style={styles.locationErrorLinkText} | ||
> | ||
{` ${translate('location.allowPermission')} `} |
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.
NAB: we should use padding instead of spaces
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.
Spaces work better when text wraps the next lines as they can be collapsed.
|
||
// If current location is used, we would want to avoid saving it as a recent waypoint. This prevents the 'Your Location' | ||
// text from showing up in the address search suggestions | ||
if (isEqual(waypoint?.address, CONST.YOUR_LOCATION_TEXT)) { |
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.
NAB: Why is lodash used here? Wouldn't ===
work just as well? It's only comparing two strings.
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.
Also, don't we have an eslint rule for TS that says we prefer not to use lodash or underscore?
I will approve and merge this as-is. If you choose to correct the few things I pointed out, please submit a follow-up PR to fix them. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@huzaifa-99 I think the "Use your location" button should display in the above suggestion list as designed here: #27165 (comment) |
🚀 Deployed to staging by https://github.com/tgolen in version: 1.3.79-0 🚀
|
@DylanDylann lets followup in the ticket here |
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.79-5 🚀
|
Details
This is a follow-up and builds on top of the reverted PR #25990.
In #25990, we added the feature to get the current location for a user. It was merged but the QA team found some issues while on staging.
These were the issues
And these were the solutions
AddressSearch
component, with out changes it became detectable. Backstory -> We added apredefinedSpaces
option toAddressSearch
component in Show recent waypoints when selecting address for distance request #25974 to show the recently selected waypoints as suggestions inAddressSearch
. When the text input in AddressSearch was empty, we were scaling (transform [{scale: 0}]
) the address suggestion popover to 0 but the suggestion list was still taking space, causing the big space b/wAddressSearch
andUse Current Location
button. In this PR, we are showing the suggestion list even if the text input is empty, this is because we are giving predefined spaces toAddressSearch
. (I suggested this here as option 1)Fixed Issues
$ #25855
PROPOSAL: #25855 (comment)
Tests
Important:
On Chrome after disabling and then re-enabling location permission, the browser might still say that you have location permission disabled, in this case you would have to either close and reopen the tab or reset website permissions.
We have to reload the page, whenever we change location permissions in Web/mWeb Chrome/Safari.
If testing mWeb Safari in an IOS stimulator, when you disable the location permissions then it's very hard to get safari in the stimulator to allow location permissions (changing the settings does nothing most of the time). A reliable way is to reset the stimulator (I have shown this in the mWeb Safari test video). However, on a real iOS device with Safari, changing the settings works and we don't have to do extreme steps for it to work.
For iOS/Android, please test on a physical device.
Verify that no errors appear in the JS console
Offline tests
Only steps 9, 11, 12, and 13 don't apply to offline behaviour. All other steps are the same as in the "Tests" section above.
QA Steps
Same as the "Tests" section above.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
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)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Chrome:
Web.Chrome.mp4
Safari:
Web.Safari.mp4
Mobile Web - Chrome
mWeb.Chrome.mp4
Mobile Web - Safari
mWeb.Safari.mp4
Desktop
Desktop.Native.mp4
iOS
IOS.Native.mp4
Android
Android.Native.mp4