Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.5k stars 2.85k forks source link

[$250] Android -Distance - Distance tab is gray and not highlighted in green when swiping to Distance #51297

Open lanitochka17 opened 3 days ago

lanitochka17 commented 3 days ago

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.52-2 Reproducible in staging?: Y Reproducible in production?: N If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): applausetester+kh1610015@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch ND or hybrid app.
  2. Open FAB > Submit expense
  3. Go to Manual
  4. Swipe to Scan, then swipe to Distance

Expected Result:

Distance tab will be highlighted in green when swiping to Distance tab (production behavior)

Actual Result:

Distance tab is gray and not highlighted in green when swiping to Distance tab The tab is only green when it is tapped on This issue also happens in Scan tab when it is swiped from Distance to Scan

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/9d158542-d61b-4a29-af0b-2b8795ade7d6

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021848826866073504646
  • Upwork Job ID: 1848826866073504646
  • Last Price Increase: 2024-10-22
Issue OwnerCurrent Issue Owner: @rayane-djouah
melvin-bot[bot] commented 3 days ago

Triggered auto assignment to @yuwenmemon (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] commented 3 days ago

💬 A slack conversation has been started in #expensify-open-source

github-actions[bot] commented 3 days ago

:wave: 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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
yuwenmemon commented 3 days ago

Demoting this as it's pretty minor.

melvin-bot[bot] commented 3 days ago

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

melvin-bot[bot] commented 3 days ago

Triggered auto assignment to @mallenexpensify (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.

melvin-bot[bot] commented 3 days ago

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

twilight2294 commented 3 days ago

Proposal

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

What is the root cause of that problem?

when we calculate opacity for android device, we wrongly compare with isActive prop which is meant for web platforms, on native devices we rely on Index values of the current tag to select the opacity of the selected tab

https://github.com/Expensify/App/blob/65b739d3befa22d49dec5c142a9fb9745944aa28/src/components/TabSelector/getOpacity/index.native.ts#L12.

isActive is meant for web platforms and we define it here in the web file below: https://github.com/Expensify/App/blob/65b739d3befa22d49dec5c142a9fb9745944aa28/src/components/TabSelector/getOpacity/index.ts#L8

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

We should remove the isActive check in native file as it is meant for web platforms only:

const getOpacity: GetOpacity = ({routesLength, tabIndex, active, affectedTabs, position}) => {
    const activeValue = active ? 1 : 0;
    const inactiveValue = active ? 0 : 1;

    if (routesLength > 1) {
        const inputRange = Array.from({length: routesLength}, (v, i) => i);

        return position?.interpolate({
            inputRange,
            outputRange: inputRange.map((i) => (affectedTabs.includes(tabIndex) && i === tabIndex ? activeValue : inactiveValue)),
        });
    }
    return activeValue;
};

https://github.com/user-attachments/assets/2f0a82e4-9cbb-442f-ad55-c9f75823bb60

What alternative solutions did you explore? (Optional)

Krishna2323 commented 3 days ago

Edited by proposal-police: This proposal was edited at 2024-10-22 21:49:27 UTC.

Proposal


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

Android -Distance - Distance tab is gray and not highlighted in green when swiping to Distance

What is the root cause of that problem?

https://github.com/Expensify/App/blob/65b739d3befa22d49dec5c142a9fb9745944aa28/src/components/TabSelector/TabSelector.tsx#L73-L75

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


What alternative solutions did you explore? (Optional)

Result

rayane-djouah commented 1 day ago

Reviewing 👀