-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[$250] Android - Distance - Unable to switch distance label unit when tapping on the label #56499
Comments
Triggered auto assignment to @VictoriaExpensify ( |
Triggered auto assignment to @marcochavezf ( |
💬 A slack conversation has been started in #expensify-open-source |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Job added to Upwork: https://www.upwork.com/jobs/~021887689540451729884 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The issue occurs when attempting to toggle the distance label (miles ↔ kilometers) on Android. The tap event does not trigger correctly, preventing users from switching the unit. What is the root cause of that problem?The problem originates in the following code: Checking the onTouchEnd={(e) => {
e.stopPropagation();
}}
Since this is a deploy blocker, I will begin preparing my PR and testing immediately. What changes do you think we should make in order to solve the problem?
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?When using pressable components
What alternative solutions did you explore? (Optional)N/A |
Hi @OmarKoueifi, thanks for the proposal, it looks good to me. @abdulrahuman5196 could you give final approval when you have a moment? Thanks Removing the blocker status as this is low impact. |
@Julesssss @abdulrahuman5196 @VictoriaExpensify 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? 💸 |
@Julesssss, @abdulrahuman5196, @VictoriaExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Checking now. Will provide information before EOD |
Checking again |
Regarding @OmarKoueifi 's proposal here #56499 (comment) and @rohit9625 's proposal here #56499 (comment), both suggest to change OnPress to |
I found a related GH issue. I hope this can help us understand why the issue happens in our case. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Android - Distance - Unable to switch distance label unit when tapping on the label What is the root cause of that problem?On Android, we use App/src/components/MapView/responder/index.android.ts Lines 3 to 9 in ec99650
App/src/components/MapView/MapView.tsx Line 259 in ec99650
What changes do you think we should make in order to solve the problem?Removing const TouchableWrapper = ({
children,
onPress,
accessibilityLabel,
accessibilityRole,
testID,
}: TouchableWrapperProps) => {
const touchStartTime = useRef<number | null>(null);
const touchStartLocation = useRef<{x: number; y: number} | null>(null);
const handleTouchStart = (event: GestureResponderEvent) => {
touchStartTime.current = Date.now();
touchStartLocation.current = {
x: event.nativeEvent.pageX,
y: event.nativeEvent.pageY
};
};
const handleTouchMove = (event: GestureResponderEvent) => {
// If the touch has moved more than a threshold, consider it a drag
if (touchStartLocation.current) {
const dx = Math.abs(event.nativeEvent.pageX - touchStartLocation.current.x);
const dy = Math.abs(event.nativeEvent.pageY - touchStartLocation.current.y);
// If moved more than 1 pixels in any direction, consider it a drag
if (dx > 1 || dy > 1) {
// Reset touch tracking to prevent onPress from firing
touchStartTime.current = null;
touchStartLocation.current = null;
}
}
};
const handleTouchEnd = () => {
// Only trigger onPress if this was a quick tap (less than 200ms)
// and the touch hasn't moved significantly
if (touchStartTime.current && Date.now() - touchStartTime.current < 200) {
onPress?.();
}
touchStartTime.current = null;
touchStartLocation.current = null;
};
return (
<PressableWithoutFeedback
onTouchStart={handleTouchStart}
onTouchMove={handleTouchMove}
onTouchEnd={handleTouchEnd}
accessibilityLabel={accessibilityLabel}
accessibilityRole={accessibilityRole}
>
{children}
</PressableWithoutFeedback>
);
}; Then, replace the App/src/components/MapView/MapView.tsx Lines 320 to 328 in ec99650
<TouchableWrapper
onPress={toggleDistanceUnit}
accessibilityLabel={translate('common.distance')}
accessibilityRole={CONST.ROLE.BUTTON}
>
<View style={[styles.distanceLabelWrapper]}>
<Text style={styles.distanceLabelText}> {distanceLabelText}</Text>
</View>
</TouchableWrapper> Important Apply this change only for Android What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?We can write a unit test to cover the case:
What alternative solutions did you explore? (Optional)N/A |
Thanks for the proposal @linhvovan29546. I like the wrapper as it's a tidier solution in a similar vein. What do you think @abdulrahuman5196? Also here's why we implemented the android specific code, so for reference we'll need to test that case. |
@abdulrahuman5196 Eep! 4 days overdue now. Issues have feelings too... |
Awaiting response to #56499 (comment) |
@abdulrahuman5196 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
@Julesssss @abdulrahuman5196 @VictoriaExpensify this issue is now 4 weeks old, please consider:
Thanks! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@abdulrahuman5196 10 days overdue. Is anyone even seeing these? Hello? |
Checking now |
Hi @linhvovan29546 , regarding this
Curious question: The same property is set for web as well, why is not causing issue there? App/src/components/SwipeInterceptPanResponder.tsx Lines 3 to 7 in b428efa
|
That's the difference—on Android, |
If you comment out these two fields, the onPress event will work as expected |
Got it. Thank you. But still IMO, your solution is almost similar to previous suggestions where to handle |
Hi @Julesssss , Anyways the solution suggested is similar to previous proposals where the suggestion was to handle the touch events and calculate the difference between user moving and pressing. Just that the new proposal is suggesting to put it in a wrapper but almost same proposal.(Correct me if wrong) I am not sure if we should go via that path yet. |
Agree, my solution is similar to the existing proposal, but I pointed out the correct RCA. |
Yeah i agree with this but we're yet to see any 'better' solutions. I prefer this as it's a cleaner workaround. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.95-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to check (New feature)
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: #55517
Email or phone of affected tester (no customers): applausetester+sj9032@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Samsung Galaxy Z Fold 4 / Android 14
App Component: Money Requests
Action Performed:
Expected Result:
The distance label will change from mile to kilometer or vice versa when tapped.
Actual Result:
The distance label does not change when tapped.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://utest-dl.s3-accelerate.amazonaws.com/12102/26469/491203/6735645/bugAttachment/Bug6735645_1738880567891%211738880241936_Screen_Recording_20250207_061628_Chrome.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250207T020848Z&X-Amz-SignedHeaders=host&X-Amz-Credential=AKIAJ2UIWMJ2OMC3UCQQ%2F20250207%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Expires=86400&X-Amz-Signature=dac2a54db02eb81e8d48fdc8b2708d0e67edd5823ab77ff7be6674703f776af2
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @abdulrahuman5196The text was updated successfully, but these errors were encountered: