Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] Web - Blue selection border on plan option after a refresh #54502

Open
1 of 8 tasks
IuliiaHerets opened this issue Dec 24, 2024 · 10 comments
Open
1 of 8 tasks

[$250] Web - Blue selection border on plan option after a refresh #54502

IuliiaHerets opened this issue Dec 24, 2024 · 10 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 24, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.78-1
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Windows 11 pro/chrome
App Component: Workspace Settings

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Create a workspace
  3. Navigate to Workspace Settings > Profile > Plan
  4. Refresh the page

Expected Result:

No border around a plan

Actual Result:

A blue selection on the selected plan after a refresh

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6701563_1735001860450.bandicam_2024-12-24_03-54-31-141.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021871677812777227550
  • Upwork Job ID: 1871677812777227550
  • Last Price Increase: 2024-12-24
Issue OwnerCurrent Issue Owner: @hoangzinh
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

Copy link

melvin-bot bot commented Dec 24, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 24, 2024
Copy link
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.

@DylanDylann
Copy link
Contributor

I think we can demote this as a normal bug. This is a bug from SelectionList and It also happens on other selection list. Ex:

Screen.Recording.2024-12-24.at.17.06.22.mov

cc @jayeshmangwani

@jayeshmangwani
Copy link
Contributor

Agreed @DylanDylann, it happens with other pages as well.

@cristipaval cristipaval added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 24, 2024
@cristipaval
Copy link
Contributor

Demoting

@daledah
Copy link
Contributor

daledah commented Dec 24, 2024

Proposal

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

A blue selection on the selected plan after a refresh

What is the root cause of that problem?

We have the logic to focus the element programmatically in

useSyncFocus(pressableRef, !!isFocused, shouldSyncFocus);

ref.current?.focus();

The :focus-visible pseudo-class is triggered when the browser detects that focus was moved via an interaction that implies intent, such as keyboard navigation (Tab key) or assistive technology usage.

If users open the new page by clicking menu item, after focus, :focus-visible is not added since it's not focused by keyboard navigation.

but after refreshing page, browser somehow detects the previous users intent was keyboard interaction.

=> :focus-visible is applied

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

At the first time the button render, if isFocused is true, we shouldn't sync focus since users haven't performed any action on that item.

We should sync focus when the isFocused changes from false to true (actual users interaction)

Here's the sample code

const shouldDisable = useRef(isFocused);

    useLayoutEffect(() => {
        if(shouldDisable && !isFocused){
            shouldDisable.current = false;
        }
        if (!isFocused || !shouldSyncFocus || !didScreenTransitionEnd || shouldDisable.current) {
            return;
        }

        ref.current?.focus();
...

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

What alternative solutions did you explore? (Optional)

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.

@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Dec 24, 2024
@melvin-bot melvin-bot bot changed the title Web - Blue selection border on plan option after a refresh [$250] Web - Blue selection border on plan option after a refresh Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 24, 2024
Copy link

melvin-bot bot commented Dec 24, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

7 participants