Skip to content

[HOLD for payment 2023-07-12] [$1000] The Keyboard shortcuts modal does not render correctly when the window is resized. #21643

Closed

Description

@kavimuru

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Opened the Website.
  2. Navigated to the Settings page, then to the About page.
  3. Clicked on "View keyboard shortcuts".
  4. Decreased the window size.
  5. Maximized the browser window.
  6. Observed that the Keyboard shortcuts modal is not in the center of the page.

Expected Result:

The Keyboard shortcuts modal should be in the center of the page.

Actual Result:

The Keyboard shortcuts modal does not render correctly when the window is resized.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.32-5
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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-06-21.at.2.58.59.AM.mov
Recording.882.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Tushu17
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687297558102969

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a27dd51f1042e7a5
  • Upwork Job ID: 1673922198285770752
  • Last Price Increase: 2023-06-28

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 26, 2023
  2. GItGudRatio commented on Jun 26, 2023

    @GItGudRatio
    Contributor

    Proposal

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

    The Keyboard shortcuts modal does not render correctly when the window is resized from small screen to large screen.

    What is the root cause of that problem?

    To reproduce this issue, just going from a small width to a large width while the modal is open also causes this issue to happen. Further, we can notice that a console error is thrown in DEV when the resizing happens.
    image

    The reason behind this issue is that when the browser is in large screen width, it has the CSS property flexBasis: auto and flex: 1. Both these values are obtained from here:

    When the window is resized to small screen width, it obtains the styles from modal type BOTTOM_DOCKED, which do not have a flex CSS property set. This leads to a situation where the flex style is removed while the flexBasis style is present, causing the visual glitch to occur. Similarly, when the window is resized to large width, the flex style is set from being undefined, causing the issue to occur,

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

    Ideally, we do not want to change the base styles for the popovers. Taking this into consideration, we can change the style keyboardShortcutModalContainer to use flex: 0 and remove flexShrink and flexGrow. This will ensure that no matter the width, the flex style is always taken into consideration. After resolution, the style will always be set to flex: 0 0 auto.

    What alternative solutions did you explore? (Optional)

    To fix this issue, we can add flex: 1 style to the BOTTOM_DOCKED modal type in modalContainerStyle.
    Alternatively, we can remove flex: 1 style from CENTERED_UNSWIPEABLE modal type from getBaseModalStyles.

  3. melvin-bot commented on Jun 26, 2023

    @melvin-bot

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

  4. melvin-bot commented on Jun 26, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  5. Pujan92 commented on Jun 26, 2023

    @Pujan92
    Contributor

    Proposal

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

    The Keyboard shortcuts modal does not render correctly when the window is resized.

    What is the root cause of that problem?

    Warning: Updating a style property during rerender (flex) when a conflicting property is set (flexShrink) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.
    As the error mentions don't mix the shorthand and no-shorthand properties and seems that we are doing here(where modalContainerStyle contains shorthand property flex: 1 and innerContainerStyle has properties of keyboardShortcutModalContainer which are non-shorthand).

    modalContainerStyle = {...modalContainerStyle, ...innerContainerStyle};

    innerContainerStyle={{...styles.keyboardShortcutModalContainer, ...StyleUtils.getKeyboardShortcutsModalWidth(this.props.isSmallScreenWidth)}}

    App/src/styles/styles.js

    Lines 2998 to 3003 in d76b1ad

    keyboardShortcutModalContainer: {
    maxHeight: '100%',
    flexShrink: 0,
    flexGrow: 0,
    flexBasis: 'auto',
    },

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

    As for the modal container type we are using the flex shorthand syntax here, let's do the same for the keyboardShortcutModalContainer to avoid this conflict issue. This raises the issue for the native, so we need to replace shorthand with the normal properties in the getBaseModalStyles.

    Instead of



    Update to

    flexShrink: 1,
    flexGrow: 1,
    flexBasis: 0,
    
    Result
    Screen.Recording.2023-06-27.at.3.51.20.AM.mp4
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 28, 2023
  7. changed the title [-]The Keyboard shortcuts modal does not render correctly when the window is resized.[/-] [+][$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/+] on Jun 28, 2023
  8. melvin-bot commented on Jun 28, 2023

    @melvin-bot
  9. tjferriss commented on Jun 28, 2023

    @tjferriss
    Contributor

    I'm able to reproduce this one.

    Screenshot 2023-06-27 at 22 11 34
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 28, 2023
  11. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    Current assignee @tjferriss is eligible for the External assigner, not assigning anyone new.

  12. melvin-bot commented on Jun 28, 2023

    @melvin-bot

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

  13. 17 remaining items

  14. changed the title [-][$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/-] [+][HOLD for payment 2023-07-12] [$1000] The Keyboard shortcuts modal does not render correctly when the window is resized.[/+] on Jul 5, 2023
  15. melvin-bot commented on Jul 5, 2023

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Jul 5, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.36-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2023-07-12. 🎊

    After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

    • External issue reporter
    • Contributor that fixed the issue
    • Contributor+ that helped on the issue and/or PR

    As a reminder, here are the bonuses/penalties that should be applied for any External issue:

    • Merged PR within 3 business days of assignment - 50% bonus
    • Merged PR more than 9 business days after assignment - 50% penalty
  17. melvin-bot commented on Jul 5, 2023

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
    • [@0xmiroslav] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • [@0xmiroslav] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • [@0xmiroslav] Determine if we should create a regression test for this bug.
    • [@0xmiroslav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@tjferriss] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  18. tjferriss commented on Jul 12, 2023

    @tjferriss
    Contributor

    @GItGudRatio can you please apply to the job post here for payment? https://www.upwork.com/jobs/~01a27dd51f1042e7a5

    @0xmiroslav can you get started on the checklist?

  19. 0xmiroslav commented on Jul 12, 2023

    @0xmiroslav
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Allow keyboard shortcuts to work on native devices #17708
    • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/17708/files#r1260652917
    • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
    • Determine if we should create a regression test for this bug.
    • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

    As web resizing to mobile window is rare case and we won't be likely to change this style again, I don't think regression test step is needed.

  20. GItGudRatio commented on Jul 12, 2023

    @GItGudRatio
    Contributor

    @tjferriss Thanks, applied!

  21. tjferriss commented on Jul 12, 2023

    @tjferriss
    Contributor

    @0xmiroslav and @Tushu17 payments have been sent. @GItGudRatio once you accept the offer, I'll process your payment and we can close the issue.

  22. GItGudRatio commented on Jul 12, 2023

    @GItGudRatio
    Contributor

    Thank you @tjferriss!

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