Skip to content
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 native - Workspace chat tooltip appears broken #53979

Open
2 of 8 tasks
m-natarajan opened this issue Dec 12, 2024 · 12 comments
Open
2 of 8 tasks

[$250] Android native - Workspace chat tooltip appears broken #53979

m-natarajan opened this issue Dec 12, 2024 · 12 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed

Comments

@m-natarajan
Copy link

m-natarajan commented Dec 12, 2024

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:
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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
Expensify/Expensify Issue URL:
Issue reported by: @rayane-djouah
Slack conversation (hyperlinked to channel name): expensify_bugs

Action Performed:

  1. Log in as User A, an account that owns a workspace
  2. Create a new account B
  3. On A, Invite B to the workspace
  4. On B, open the workspace chat
  5. Verify a tooltip shows over the composer's Create button saying "Get started! Submit your first expense"

Expected Result:

A tooltip should shows over the composer's Create button saying "Get started! Submit your first expense"

Actual Result:

The tooltip appears broken

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021868166063366405980
  • Upwork Job ID: 1868166063366405980
  • Last Price Increase: 2024-12-15
Issue OwnerCurrent Issue Owner: @mananjadhav
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

Triggered auto assignment to @alexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@rayane-djouah
Copy link
Contributor

This bug is consistently reproducible for me

@rayane-djouah
Copy link
Contributor

It's reproducible for me on the android simulator but not on my android physical device

@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Dec 15, 2024
Copy link

melvin-bot bot commented Dec 15, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021868166063366405980

@melvin-bot melvin-bot bot changed the title Android native - Workspace chat tooltip appears broken [$250] Android native - Workspace chat tooltip appears broken Dec 15, 2024
@melvin-bot melvin-bot bot added Overdue Help Wanted Apply this label when an issue is open to proposals by contributors labels Dec 15, 2024
Copy link

melvin-bot bot commented Dec 15, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (External)

@melvin-bot melvin-bot bot removed the Overdue label Dec 15, 2024
@alexpensify
Copy link
Contributor

@mananjadhav - We are waiting for proposals here.


Heads up, I will be offline until Wednesday, December 18, 2024, and will not actively watch over this GitHub during that period.

If this GitHub requires an urgent update, please ask for help in the #expensify-open-source Slack Room. If the inquiry can wait, I'll review it when I return online.

@mananjadhav
Copy link
Collaborator

Yes waiting for proposals

@rohit9625
Copy link

I am facing similar issues with all these tooltips on a real device running Android 14:-

@linhvovan29546
Copy link

Hi @mananjadhav @rayane-djouah My proposal here addresses and resolves this issue.

@linhvovan29546
Copy link

linhvovan29546 commented Dec 17, 2024

Edited by proposal-police: This proposal was edited at 2024-12-17 10:01:40 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Android native - Workspace chat tooltip appears broken

What is the root cause of that problem?

The BaseGenericTooltip component currently uses the onLayout handler with a setTimeout to measure and update the contentMeasuredWidth. This approach introduces inaccuracies in width measurement, after 300ms, the measure function returns an incorrect (too small) width. This causes setContentMeasuredWidth to update with the wrong value, leading to layout issues.

setTimeout(() => {
InteractionManager.runAfterInteractions(() => {
target.measure((x, y, width) => {
setContentMeasuredWidth(width);
});
});
}, CONST.ANIMATED_TRANSITION);

What changes do you think we should make in order to solve the problem?

  • Remove the setTimeout, measure logic from the onLayout handler.
  • Use e.nativeEvent.layout directly to get the width and height
  • Use useSharedValue to store the width and height, passing these values directly to animationStyle.
  • The new code is as follows.
   const contentMeasuredWidthAnimated = useSharedValue<number>(0)
    const wrapperMeasuredHeightAnimated = useSharedValue<number>(0)
...
    const animationStyle = useAnimatedStyle(() => {
        return StyleUtils.getTooltipAnimatedStyles({ tooltipContentWidth: contentMeasuredWidthAnimated.get(), tooltipWrapperHeight: wrapperMeasuredHeightAnimated.get(), currentSize: animation });
    });
...
                onLayout={(e) => {
                    const { height, width } = e.nativeEvent.layout;
                    if (height === wrapperMeasuredHeightAnimated.get()) {
                        return;
                    }
                    contentMeasuredWidthAnimated.set(width)
                    wrapperMeasuredHeightAnimated.set(height);
                    setContentMeasuredWidth(width)
                    setWrapperMeasuredHeight(height)
                }}
Detail

Demo Videos

Before After
before.mp4
after.mp4

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

What alternative solutions did you explore? (Optional)

N/A

@mananjadhav
Copy link
Collaborator

I think the proposal would work. I tested the code diff but will need to test thoroughly with the PR. I am going to check with an internal engineer if we're okay to remove the setTimeout.

🎀 👀 🎀 C+ reviewed.

Copy link

melvin-bot bot commented Dec 17, 2024

Triggered auto assignment to @iwiznia, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

7 participants