Skip to content

[HOLD for #64301][$250] Reports - In reports page, after tapping submit, preview box is shown as 2 different layer. #63932

Closed

Description

@jponikarchuk

Version Number: V9.1.64-6
Reproducible in staging?: Yes
Reproducible in production?: Yes
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): Slottwo1 das61@gmail.com
Issue reported by: Applause Internal Team
Device used: Redminote 10s android 13
App Component: User Settings

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Open a workspace chat
  3. Create a manual expense with receipt & category
  4. Go to reports
  5. Tap submit
  6. Tap approve

Expected Result:

In report page, after tapping submit , preview box must not be shown as 2 different layer.

Actual Result:

In report page, after tapping submit , preview box is shown as 2 different layer.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021933628920989054137
  • Upwork Job ID: 1933628920989054137
  • Last Price Increase: 2025-06-13
Issue OwnerCurrent Issue Owner: @allroundexperts

Activity

  1. added
    Daily
    Bug
    on Jun 11, 2025
  2. melvin-bot commented on Jun 11, 2025

    @melvin-bot

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

  3. dmkt9 commented on Jun 11, 2025

    @dmkt9
    Contributor

    Proposal

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

    In report page, after tapping submit , preview box is shown as 2 different layer.

    What is the root cause of that problem?

    When the parent is hovered, TransactionItemRow will also be styled as hovered:

    if (isSelected) {
    return styles.activeComponentBG;
    }
    if (hovered || isParentHovered) {
    return styles.hoveredComponentBG;
    }
    }, [hovered, isParentHovered, isSelected, styles.activeComponentBG, styles.hoveredComponentBG]);

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

    Only apply hover styling to TransactionItemRow based on the parent when used on desktop:

    if (hovered || isParentHovered) {

    if (hovered || (isParentHovered && !canUseTouchScreen())) {

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

    NA

    What alternative solutions did you explore? (Optional)

    NA

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. thelullabyy commented on Jun 11, 2025

    @thelullabyy
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-06-11 09:40:24 UTC.

  5. github-actions commented on Jun 11, 2025

    @github-actions
    Contributor

    ⚠️ @thelullabyy Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  6. thelullabyy commented on Jun 11, 2025

    @thelullabyy
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-06-11 09:44:55 UTC.

    Proposal

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

    Reports - In reports page, after tapping submit, preview box is shown as 2 different layer

    What is the root cause of that problem?

    In this case, when the submit button is clicked, isParentHovered becomes true, causing the hoveredComponentBG style to be applied to TransactionItemRow.

    if (hovered || isParentHovered) {

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

    In ReportListItem, isParentHovered is added to TransactionItemRow in this PR.

    Image

    In that PR, we introduced the isParentHovered prop when migrating from TransactionListItemRow to TransactionItemRow, following the pattern used in TransactionListItemRow. However, this is redundant because TransactionItemRow already uses useHover, which is the same hook used in BaseListItem. As a result, isParentHovered and the hovered are effectively identical in TransactionItemRow. Therefore, I suggest removing this line.

    For same reason, we also can remove this line

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

    NA

    What alternative solutions did you explore? (Optional)

    Let's remove isParentHovered prop totally

    if (hovered || isParentHovered) {

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  7. nkdengineer commented on Jun 11, 2025

    @nkdengineer
    Contributor

    Proposal

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

    In report page, after tapping submit , preview box is shown as 2 different layer.

    What is the root cause of that problem?

    We're using onMouseEnter and onMouseLeave to detect hover state

    onMouseEnter: () => setHovered(true),
    onMouseLeave: () => setHovered(false),

    so when users click on the approve button, onMouseEnter is trigger, that makes isParentHovered is true

    then hoveredComponentBG is applied to the TransactionItemRow (child component)

    return styles.hoveredComponentBG;

    For BaseListItem, we detect the hover state by PressableWithFeedback

    but onHoverOut and onHoverIn are used to detect hover state

    onHoverIn={(event) => {
    setIsHovered(true);
    if (rest.onHoverIn) {
    rest.onHoverIn(event);
    }
    }}
    onHoverOut={(event) => {
    setIsHovered(false);
    if (rest.onHoverOut) {
    rest.onHoverOut(event);
    }
    }}

    and they're not triggered when users press submit button

    => We can see 2 layers

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

    We should update useHover to use onHoverIn and onHoverOut same as what we did in PressableWithFeedback

    import {useState} from 'react';
    
    const useHover = () => {
        const [hovered, setHovered] = useState(false);
        return {
            hovered,
            bind: {
                onHoverIn: () => setHovered(true),
                onHoverOut: () => setHovered(false),
            },
        };
    };
    
    export default useHover;
    

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

    None

    What alternative solutions did you explore? (Optional)

    NA

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  8. CortneyOfstad commented on Jun 13, 2025

    @CortneyOfstad
    Contributor

    Not able to recreate, so going to see if QA can test this!

  9. CortneyOfstad commented on Jun 13, 2025

    @CortneyOfstad
    Contributor
  10. IuliiaHerets commented on Jun 13, 2025

    @IuliiaHerets
  11. CortneyOfstad commented on Jun 13, 2025

    @CortneyOfstad
    Contributor

    Thanks @IuliiaHerets!

    Getting eyes on this!

  12. 14 remaining items

  13. nkdengineer commented on Jun 18, 2025

    @nkdengineer
    Contributor

    @arosiclair Unfortunately, onHoverIn and onHoverOut are available for PressableWithFeedback only, not View, so we can't use onHoverIn and onHoverOut in here. Furthermore, in the documention

    {% call macro.prop('onHoverIn', '?(e: MouseEvent) => void') %}
    Called when the pointer starts hovering over the element. Touch interactions have no effect.
    {% endcall %}

    so onHoverIn won't call for touch interactions (mweb) that's equivalent to using canUseTouchScreen in #64301

    In conclusion, the PR: #64301 is enough to fix

  14. arosiclair commented on Jun 18, 2025

    @arosiclair
    Contributor

    Alright let's hold until the PR is merged and just verify this bug is also fixed.

  15. changed the title [-][$250] Reports - In reports page, after tapping submit, preview box is shown as 2 different layer.[/-] [+][HOLD][$250] Reports - In reports page, after tapping submit, preview box is shown as 2 different layer.[/+] on Jun 18, 2025
  16. changed the title [-][HOLD][$250] Reports - In reports page, after tapping submit, preview box is shown as 2 different layer.[/-] [+][HOLD for #64301][$250] Reports - In reports page, after tapping submit, preview box is shown as 2 different layer.[/+] on Jun 23, 2025
  17. CortneyOfstad commented on Jun 23, 2025

    @CortneyOfstad
    Contributor

    PR was deployed to staging 3 days ago, so waiting for production 👍

    PR link — #64301

  18. melvin-bot commented on Jun 24, 2025

    @melvin-bot

    @allroundexperts Huh... This is 4 days overdue. Who can take care of this?

  19. CortneyOfstad commented on Jun 25, 2025

    @CortneyOfstad
    Contributor

    Went into production a few hours ago 🎉

    #64301 (comment)

  20. melvin-bot commented on Jun 26, 2025

    @melvin-bot

    @allroundexperts Still overdue 6 days?! Let's take care of this!

  21. melvin-bot commented on Jun 30, 2025

    @melvin-bot

    @allroundexperts 10 days overdue. I'm getting more depressed than Marvin.

  22. melvin-bot commented on Jul 1, 2025

    @melvin-bot

    @allroundexperts 12 days overdue. Walking. Toward. The. Light...

  23. CortneyOfstad commented on Jul 1, 2025

    @CortneyOfstad
    Contributor

    Can close this out as the PR went into production. Thanks team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions