Skip to content

[$500] Workspace switcher - Both "Expensify" and another workspace are highlighted in WS switcher #37239

Closed

Description

@lanitochka17

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.44-0
Reproducible in staging?: Y
Reproducible in production?: N
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace if there is no workspace
  3. Open workspace switcher

Expected Result:

Only "Expensify" will be highlighted

Actual Result:

"Expensify" and another workspace are highlighted

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

Bug6393389_1708986239721.bandicam_2024-02-27_06-21-36-088.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012b29a531f8eb3037
  • Upwork Job ID: 1762249377835036672
  • Last Price Increase: 2024-02-26
  • Automatic offers:
    • akinwale | Reviewer | 0
    • Krishna2323 | Contributor | 0

Activity

  1. added
    DeployBlockerCash
    External
    on Feb 26, 2024
  2. melvin-bot commented on Feb 26, 2024

    @melvin-bot
  3. changed the title [-]Workspace switcher - Both "Expensify" and another workspace are highlighted in WS switcher[/-] [+][$500] Workspace switcher - Both "Expensify" and another workspace are highlighted in WS switcher[/+] on Feb 26, 2024
  4. added
    Help Wanted
    on Feb 26, 2024
  5. melvin-bot commented on Feb 26, 2024

    @melvin-bot

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

  6. github-actions commented on Feb 26, 2024

    @github-actions
    Contributor

    👋 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.
  7. melvin-bot commented on Feb 26, 2024

    @melvin-bot

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

  8. lanitochka17 commented on Feb 26, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #wave8
    CC @zanyrenney

  9. 23 remaining items

  10. melvin-bot commented on Feb 27, 2024

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  11. akinwale commented on Feb 27, 2024

    @akinwale
    Contributor

    Based on this comment, this inadvertently got fixed in that PR.

    cc @roryabraham

  12. Krishna2323 commented on Feb 28, 2024

    @Krishna2323
    Contributor

    @akinwale, we still have multiple issue here.

    1. When an options gets selected the list doesn't get scrolled to the top, instead it scrolls to the first unselected options which.
    2. The focus is not removed or moved to the first item when the input text gets changed.
    baseOptions_selector_scroll_bug.mp4
  13. akinwale commented on Feb 28, 2024

    @akinwale
    Contributor

    @Krishna2323 Those are entirely separate issues.

    You may still get compensated here since your proposal was selected but that's entirely up to BZ / internal team to decide.

  14. Krishna2323 commented on Feb 28, 2024

    @Krishna2323
    Contributor

    @akinwale, the scroll issue may seem different but the root cause is the same.

    Here we scroll to index 0, which is correct

    if (props.selectedOptions.length !== prevSelectedOptions.current.length || (!!prevValue.current && !value)) {
    prevSelectedOptions.current = props.selectedOptions;
    prevValue.current = value;
    scrollToIndex(0);
    return;

    but this again changes the focusedIndex to props.selectedOptions.length thats why we didn't scroll to top of the selector.
    const newFocusedIndex = props.selectedOptions.length;
    const prevFocusedOption = _.find(newOptions, (option) => focusedOption && option.keyForList === focusedOption.keyForList);
    const prevFocusedOptionIndex = prevFocusedOption ? _.findIndex(newOptions, (option) => focusedOption && option.keyForList === focusedOption.keyForList) : undefined;
    setSections(newSections);
    setAllOptions(newOptions);
    setFocusedIndex(prevFocusedOptionIndex || (_.isNumber(props.focusedIndex) ? props.focusedIndex : newFocusedIndex));

    I'm happy to fix this since I've already spent time on it, but I'll leave the final decision to @roryabraham.

  15. roryabraham commented on Feb 28, 2024

    @roryabraham
    Contributor

    This component was much more complicated than it needed to be, so I've been working on a holistic refactor here. I think I've simplified it to a point where it makes more sense and is easier to follow.

    So far I've only done cursory testing, so my next step is to go through all the open issues related to the BaseOptionsSelector and see if they're reproducible on my branch.

  16. melvin-bot commented on Feb 28, 2024

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  17. Piotrfj commented on Feb 29, 2024

    @Piotrfj
    Contributor

    Update: re-refactoring is ready to be tested, it fixes all the regression issues I was aware of. Please test it (especially the tags, because I could not yet replicate the scenario on my site).
    The fix is based on the @roryabraham solution, so special thanks for him!
    Link to PR: #37494

  18. melvin-bot commented on Mar 4, 2024

    @melvin-bot

    @akinwale, @sakluger, @roryabraham, @Krishna2323 Eep! 4 days overdue now. Issues have feelings too...

  19. sakluger commented on Mar 4, 2024

    @sakluger
    Contributor

    @roryabraham what would you recommend as the next step here? Should we wait to see if your refactored component solves the issue that @Krishna2323 mentioned? Or will we still need a fix after your refactor?

    Also, @Krishna2323 - did you do any work on a PR for your original proposal? If so, do you have a draft PR?

  20. dragnoir commented on Mar 4, 2024

    @dragnoir
    Contributor

    BaseOptionSelector is deprecated #37628

  21. roryabraham commented on Mar 5, 2024

    @roryabraham
    Contributor

    ok, looping back here...

    1. This issue is no longer reproducible because the PR that caused it was reverted
    2. As @dragnoir mentioned, we won't need a follow-up because the component in question has been deprecated
    3. Since @Krishna2323 never actually opened a PR for this issue, I think we can probably just close this issue w/o payments

    thanks everyone!

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

Metadata

Metadata

Labels

BugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions