Skip to content

[HOLD for payment 2024-06-06] [$500] Empty state image has too much overlap with message in attachment thread #36166

Closed

Description

@m-natarajan

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: 1.4.38-2
Reproducible in staging?: y
Reproducible in production?: y
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: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1707401686727289

Action Performed:

  1. Send a message with a vertical (portrait) image. Then create a thread on this image and view the thread.

Expected Result:

The empty state image/background pattern should not have so much overlap with the message.

Actual Result:

The empty state pattern has a LOT of overlap with the message, almost sitting directly behind it.

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Screen Shot 2024-02-08 at 11 54 22 AM (2)
With vertical tall image
CleanShot 2024-02-08 at 09 13 00@2x (1)
with normal image
CleanShot 2024-02-08 at 09 15 06@2x
without image
CleanShot 2024-02-08 at 09 15 29@2x

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0180e51b2d8c0c04ec
  • Upwork Job ID: 1755638484200894464
  • Last Price Increase: 2024-04-24
  • Automatic offers:
    • cubuspl42 | Reviewer | 0
    • rayane-djouah | Contributor | 0

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 8, 2024
  2. changed the title [-]Empty state image has too much overlap with message in attachment thread[/-] [+][$500] Empty state image has too much overlap with message in attachment thread[/+] on Feb 8, 2024
  3. melvin-bot commented on Feb 8, 2024

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 8, 2024
  5. melvin-bot commented on Feb 8, 2024

    @melvin-bot

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

  6. melvin-bot commented on Feb 8, 2024

    @melvin-bot

    Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  7. rayane-d commented on Feb 8, 2024

    @rayane-d
    Contributor

    @shawnborton could you please share mockups of the expected result ?

  8. neonbhai commented on Feb 8, 2024

    @neonbhai
    Contributor

    Proposal

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

    Empty state image has too much overlap with message in attachment thread

    What is the root cause of that problem?

    This happens as we have and incorrect style justifyContentEnd here:

    <View style={[StyleUtils.getReportWelcomeContainerStyle(isSmallScreenWidth), styles.justifyContentEnd]}>

    This makes the AnimatedEmptyStateBackground image appear behind the content.

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

    We should move the styles.justifyContentEnd from this View to the View just after AnimatedEmptyStateBackground:

    <View style={[styles.p5, StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} />

    Result:

    Before
    Screen.Recording.2024-02-09.at.12.03.48.AM.mov
    After Screenshot 2024-02-08 at 11 51 12 PM
  9. shawnborton commented on Feb 8, 2024

    @shawnborton
    Contributor

    @rayane-djouah shared a rough mockup for you here

    image

  10. rayane-d commented on Feb 9, 2024

    @rayane-d
    Contributor

    Proposal

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

    The empty state image is excessively overlapping with the message within the attachment thread

    What is the root cause of that problem?

    We are applying an incorrect styling attribute, specifically justifyContentEnd, within the following component:

    <View style={[StyleUtils.getReportWelcomeContainerStyle(isSmallScreenWidth), styles.justifyContentEnd]}>

    This particular styling causes the AnimatedEmptyStateBackground image to be positioned behind the thread content, leading to the overlap issue.

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

    we should remove , styles.justifyContentEnd here:

    <View style={[StyleUtils.getReportWelcomeContainerStyle(isSmallScreenWidth), styles.justifyContentEnd]}>

    Result:

    image

    But a lot of overlap is still applied because the report message top margin value here is not enough:

    <View style={[styles.p5, StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} />

    after removing the justifyContentEnd style, an overlap of 135px is still applied.
    the report first item top margin value is here:

    VIEW_HEIGHT: 275,

    we are also applying a padding here that adds 40px:
    <View style={[styles.p5, StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} />

    the background image size is 450px here :
    IMAGE_HEIGHT: 450,

    overlap value = 450px - (275px + 40px) = 135px

    To move the background image a little to the top and use a 60px overlap in all chat reports views,
    we should modify VIEW_HEIGHT here to use 240px for small screens and 390px for wide screens.

            SMALL_SCREEN: {
                IMAGE_HEIGHT: 300,
                CONTAINER_MINHEIGHT: 200,
                VIEW_HEIGHT: 240,
            },
            WIDE_SCREEN: {
                IMAGE_HEIGHT: 450,
                CONTAINER_MINHEIGHT: 500,
                VIEW_HEIGHT: 390,
            },
            MONEY_OR_TASK_REPORT: {
                SMALL_SCREEN: {
                    IMAGE_HEIGHT: 300,
                    CONTAINER_MINHEIGHT: 280,
                    VIEW_HEIGHT: 240,
                },
                WIDE_SCREEN: {
                    IMAGE_HEIGHT: 450,
                    CONTAINER_MINHEIGHT: 280,
                    VIEW_HEIGHT: 390,
                },
            },

    The formula for choosing VIEW_HEIGHT is (after removing the 40px padding in thread screen):
    for WIDE_SCREEN:
    overlap between the report message and the background image= 450px background image height - VIEW_HEIGHT value
    for SMALL_SCREEN:
    overlap between the report message and the background image= 300px background image height - VIEW_HEIGHT value

    the above values (240 and 390) gives 60px overlap.

    we should get the exact overlap value from the design team.

    I asked the design team here for the overlap value, and they fixed a value of 60px for both wide and small screens.

    and here:

    <View style={[styles.p5, StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} />

    remove styles.p5 that we don't need (it adds 40px padding that get added as a top margin to the message).

    <View style={[StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} />

    Result with VIEW_HEIGHT: 390 for wide screens:

    Result for wide screens:

    image

    Dimensions details

    AnimatedEmptyStateBackground image size:

    image

    report message top margin view size:

    image

    Result for small screens:

    image

    Dimensions details

    AnimatedEmptyStateBackground image size:

    image

    report message top margin view size:

    image

    What alternative solutions did you explore? (Optional)

    If we want to use a 60px overlap value in the thread screen only and keep 135px in other screens, we can do the following:

    we should add here this code to make the change only for thread reports:

            THREAD_REPORT: {
              SMALL_SCREEN: {
                  IMAGE_HEIGHT: 300,
                  CONTAINER_MINHEIGHT: 200,
                  VIEW_HEIGHT: 240,  //ajust the view height value here
              },
              WIDE_SCREEN: {
                  IMAGE_HEIGHT: 450,
                  CONTAINER_MINHEIGHT: 500,
                  VIEW_HEIGHT: 390, //ajust the view height value here
              },
            },
    

    and here:

    function getReportWelcomeTopMarginStyle(isSmallScreenWidth: boolean, isMoneyOrTaskReport = false): ViewStyle {
    const emptyStateBackground = isMoneyOrTaskReport ? CONST.EMPTY_STATE_BACKGROUND.MONEY_OR_TASK_REPORT : CONST.EMPTY_STATE_BACKGROUND;

    add isThreadReport :

    function getReportWelcomeTopMarginStyle(isSmallScreenWidth: boolean, isMoneyOrTaskReport = false, isThreadReport = false): ViewStyle {
        let emptyStateBackground;
        if (isMoneyOrTaskReport) {
            emptyStateBackground = CONST.EMPTY_STATE_BACKGROUND.MONEY_OR_TASK_REPORT;
        }
        else if (isThreadReport) {
            emptyStateBackground = CONST.EMPTY_STATE_BACKGROUND.THREAD_REPORT;
        }
        else {
            emptyStateBackground = CONST.EMPTY_STATE_BACKGROUND;
        }
    // rest remains the same

    and here:

    <View style={[styles.p5, StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth)]} />

    pass true for isThreadReport and remove styles.p5 that we don't need (it adds 40px padding that get added as a top margin to the message).

    <View style={[StyleUtils.getReportWelcomeTopMarginStyle(isSmallScreenWidth, false, true)]} />
  11. jakub-trzebiatowski commented on Feb 9, 2024

    @jakub-trzebiatowski
    Contributor

    @shawnborton Does this require any extra approval, as it's a user-observable change? Or is your approval enough?

  12. 120 remaining items

  13. shawnborton commented on Jun 19, 2024

    @shawnborton
    Contributor

    Sorry - what is the exact question you need me to answer?

  14. johncschuster commented on Jun 19, 2024

    @johncschuster
    Contributor

    @rayane-djouah, bump on the above

  15. rayane-d commented on Jun 20, 2024

    @rayane-d
    Contributor

    Sorry - what is the exact question you need me to answer?

    I think this one: #36166 (comment)

    I think the only regression the PR caused is this one: #42760, which is now resolved. Therefore, we can complete the payment based on the payment summary and close the issue.

  16. johncschuster commented on Jun 24, 2024

    @johncschuster
    Contributor
  17. shawnborton commented on Jun 24, 2024

    @shawnborton
    Contributor

    Whatever you all think is best works for me. Just noting that a bunch of regressions came out of this one, and it seems like we have a new one that needs to be addressed here too: #43247

  18. johncschuster commented on Jun 25, 2024

    @johncschuster
    Contributor

    Discussing payment. Will update the issue shortly.

  19. johncschuster commented on Jun 25, 2024

    @johncschuster
    Contributor

    I spoke with @yuwenmemon about this, and it sounds like there were two regressions within the 7-day waiting period: #42760 and #34640. Have I understood that correctly? Once I have a sense of the regressions caused, I'll update the payment summary so we can button this up.

    Thanks for your patience everyone!

  20. rayane-d commented on Jun 26, 2024

    @rayane-d
    Contributor

    Sorry - did you link the wrong issue (#34640)?

    I'll try to drive clarity here.

    The bugs that blame this PR are:

    Note that because we removed the hard-coded space for the background image, Any report action or expense that may be incorrectly displayed above the first report action that has the background image will be overlapped by the image because of zIndex values in this code:

    function CellRendererComponent(props: CellRendererComponentProps) {
    return (
    <View
    // eslint-disable-next-line react/jsx-props-no-spreading
    {...props}
    style={[
    props.style,
    /**
    * To achieve absolute positioning and handle overflows for list items,
    * it is necessary to assign zIndex values. In the case of inverted lists,
    * the lower list items will have higher zIndex values compared to the upper
    * list items. Consequently, lower list items can overflow the upper list items.
    * See: https://github.com/Expensify/App/issues/20451
    */
    {zIndex: -props.index, position: 'relative'},
    ]}
    />
    );
    }

    However, this is correct behaviour because no report action should be displayed above the first report action with the background image. If a bug like this occurs, it is because there is a duplicate report action with the background image or the order of report actions is incorrect; in this case, the root cause of the bug should be fixed. If we reverse my PR, the bug will still occur.

    I think the only bug that my PR may be blamed for is #42760

    It would be nice if we consider that #35921 was combined with this issue, and it took too much effort with two PRs worked on: #36765 #38449

    But I'm okay with whatever you find fair.

  21. johncschuster commented on Jun 28, 2024

    @johncschuster
    Contributor

    @rayane-djouah Ah, I did link the wrong one. Sorry about that!

    Thank you for writing that out so clearly! I've spoken to the team, and we've agreed on the payment amounts originally dictated above. I'll copy them here for ease:

    Payment Summary:

    Contributor: @rayane-djouah - $250 - paid via Upwork - PAID
    Contributor+: @eh2077 - $250 - paid via Upwork - PAID

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions