App icon indicating copy to clipboard operation
App copied to clipboard

[$250] mWeb-Login- Switch accounts modal contains 2 blue lines on the top

Open applause-bot[bot] opened this issue 1 week ago • 63 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.5.53-0 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 BrowserStack: https://github.com/Expensify/App/pull/105617 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Pixel 7a android 17 App Component: Other

Action Performed:

Preconditions:

  • Must execute on mWeb (Chrome or Safari) in Android or iOS
  • Must clear the cached on the browser
  1. Open https://staging.new.expensify.com/
  2. Login to account A
  3. Open another tab on the same browser
  4. Open staging.expensify.com
  5. Login to account B

Expected Result:

The modal is displayed without any extra lines

Actual Result:

There are 2 blue lines on top of Switch accounts modal

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [x] Android: mWeb Chrome
  • [ ] iOS: App
  • [x] iOS: mWeb Safari
  • [x] iOS: mWeb Chrome
  • [ ] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

https://github.com/user-attachments/assets/959ed09a-d9a9-4643-af34-f32e3c01c33e

Bug7322738_1795508446800!share_4235327771830951070

View all open jobs on GitHub

Applause Internal Information Exported by: Julia Ponikarchuk Bug ID: 7322738

Upwork Automation - Do Not Edit

applause-bot[bot] avatar Nov 24 '26 09:11 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/1588fbb82a7938e57805e5c495bbf24978fed60f38da0868641c3d4f57ae8edc

https://platform.applause.com/services/links/v1/external/31c73e18e7f7beeffe70271c5a3fb2170e24958e71ba9ded61fa5cb5bf61aa0f

applause-bot[bot] avatar Nov 24 '26 09:11 applause-bot[bot]

You have been assigned to this deploy blocker because you recently merged this PR: https://github.com/Expensify/App/pull/105617

@Julesssss @Eskalifer1 you have been assigned to this deploy blocker because you reviewed the offending PR: https://github.com/Expensify/App/pull/105617

@rayane-d you have been assigned to this deploy blocker because you authored the offending PR: https://github.com/Expensify/App/pull/105617

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

:wave: 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.

github-actions[bot] avatar Nov 24 '26 09:11 github-actions[bot]

Deploy-blocker investigation

Likely introducing PR: [V2] Add confirmation and validation during short-lived-token sign-in. It introduced this account-switch confirmation and was included in staging 9.5.53-0. Confidence: medium; the visual mechanism remains unverified.

Likely root cause

The two blue lines appear consistent with the top and bottom edges of a focus ring on an invisible dismiss button, rather than loading indicators.

Supporting code evidence

The dismiss control and focus styling predate this release. The suspected PR exposes existing shared behavior through a new confirmation; it did not introduce those styles.

Recommendation

Prefer a verified, narrowly scoped roll-forward over reverting the entire authentication change. First confirm that the focused dismiss control produces the lines and that blurring it removes them. If confirmed, correct its focus presentation while preserving keyboard and screen-reader accessibility—not by globally disabling focus indicators.

Keep the blocker pending verification of both Stay signed in and Switch accounts. The report establishes a visual defect, not an authentication failure.

Verification blocker

The web tester could not execute this scenario: its supported session prohibits account switching and does not support the required two-account, multi-tab staging flow. No browser reproduction or fix verification was completed.

The missing evidence is the dismiss control’s actual focus-visible state and computed styling during reproduction. Until that is captured, the mechanism above is a source-supported hypothesis, not a confirmed diagnosis.


view run

MelvinBot avatar Nov 24 '26 09:11 MelvinBot

Left comment is Slack thread

Eskalifer1 avatar Nov 24 '26 09:11 Eskalifer1

I agree with @Eskalifer1 that this appears to be an existing bug with the app modals rather than something introduced by our PR, as we didn't touch the related logic.

rayane-d avatar Nov 24 '26 11:11 rayane-d

I think this is minor as well. Demoting this

arosiclair avatar Nov 24 '26 19:11 arosiclair

Hi team! What should we do about this issue now? I believe there should be a more reliable steps to repro this, since i don't get this blue lines with OP steps. And who should work on this one(since this is not related to original PR)?

Eskalifer1 avatar Nov 25 '26 09:11 Eskalifer1

Hi Team, heres the reliable repro steps to repro the bug

Repro steps:

  1. Use mobile web (real device or phone emulation; desktop won't repro).
  2. Sign in as account A on staging.new.expensify.com.
  3. In a new tab, sign in as account B on staging.expensify.com. It redirects to staging.new.expensify.com/transition….
  4. Important: don't touch that tab while it loads. No taps, no scrolling. Even one tap during the spinner and the lines won't show that's why the repro has been flaky.
  5. The "Switch accounts?" sheet opens with the two blue lines already there.

https://github.com/user-attachments/assets/e1574a93-03c1-4e8e-b37c-c742d7efd1bf

This one caught my eye while I was working on https://github.com/Expensify/App/pull/100547. Not related to that change, but that PR had me deep in the /transition flow, so the repro steps immediately made sense to me and I knew exactly where to look

RCA and Fix

Root cause: the two lines are the top and bottom edges of a focus ring. Every bottom-docked modal on mobile web renders an invisible 10px "dismiss" strip at its top edge, and focus-trap focuses it when the modal opens. The browser draws a :focus-visible ring on it whenever no click or tap happened before in that page, I verified this in both Chrome and Safari. A freshly loaded /transition tab is exactly that case.

Normal modals don't show this because they're opened by a tap. On desktop the modal isn't bottom-docked, so the strip doesn't exist - no repro there. So yes, this is a pre-existing modal bug that #105617 just happened to expose, not something that PR introduced.

Fix: hide the ring for that automatic open-time focus only, using the existing suppressFocusRing and getHadTabNavigation utils, wired into BaseModal. Keyboard and screen-reader users still get the ring - it comes back as soon as they actually navigate to the strip. Since the fix is in the shared modal, it covers every bottom-docked modal, not just this one. Small change, plus unit tests. I reproduced the bug with the steps above and verified the fix on the same repro.

Fix demo

https://github.com/user-attachments/assets/60f62978-3d41-4c4a-95e2-fe9b8be325f0

Can I take this one?

cc: @Julesssss @Eskalifer1

neerajbachani avatar Nov 25 '26 12:11 neerajbachani

Hi @neerajbachani, sorry but this is not open for external help(at least yet)

Eskalifer1 avatar Nov 25 '26 12:11 Eskalifer1

No worries, my bad! I mainly wanted to share the repro steps

I've done work around the /transition flow so the bug sounded familiar. Anyway, the analysis and fix are up there if they're useful to whoever picks it up and if it ever opens for external help, I'd be happy to take it.

neerajbachani avatar Nov 25 '26 14:11 neerajbachani

Here is more reliable and easy steps to repro this one:

https://github.com/user-attachments/assets/60c95c02-9eb0-464c-835e-0d5b2a9d3ae0

Precondition: App is less than 800px

  1. Focus FAB via Tab key
  2. Press enter
  3. Bottom-docked mofal opens via 2 blue lines(actually this is focused element at the top of the modal window that can be pressed)

@MelvinBot analyze this steps and post proposal

Eskalifer1 avatar Nov 25 '26 15:11 Eskalifer1

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

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

🤖 Web test steps verification results: ⚠️ partial

Verified a 390px-wide viewport on dev NewDot web. Keyboard reproduction was blocked by unavailable Tab/Enter injection; attempts to open the FAB menu also failed with unusable target bounds. 390px-wide Home screen with global FAB

Step Status
Viewport below 800pxConfirmed 390×844.
390px-wide Home screen with global FAB
✅
Tab to FAB, then press EnterBlocked by testing-tool limitations, not a demonstrated product failure.
❌
Confirm the lines disappear when the dismiss control loses focusNot verified because the menu could not be opened.
❌

Proposal

What is the root cause of that problem?

Source evidence supports the reported mechanism; browser confirmation remains outstanding.

At narrow widths, the FAB menu becomes a bottom-docked modal. The shared modal explicitly chooses an invisible, full-width dismiss button as its initial focus target. Keyboard opening preserves focus-visible styling, which draws a blue inset rectangle around that shallow strip—appearing as two horizontal lines.

The new steps therefore isolate shared modal behavior without requiring account switching.

Code evidence

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

Move opening focus to a visible, meaningful control instead of hiding keyboard focus.

  1. Allow an explicitly supplied initial-focus target to take precedence over the dismiss-strip fallback.
  2. For the FAB menu, focus its first available action and coordinate its inner and outer focus traps.
  3. For the original account-switch confirmation, expose an explicit focus target and select Stay signed in, avoiding accidental emphasis on switching accounts.
  4. Retain accessible dismissal and normal visible focus indicators.

This addresses both reported entry points without changing every confirmation’s default focus policy.

Implementation locations and verification

The FAB’s nested traps require coordination in FABPopoverMenu:113–181. Confirmation focus would need forwarding through ConfirmModal:182–210 to the button rendered by ConfirmContent:244–304, with the account-switch choice configured at LogOutPreviousUserPage:121–128.

Verify Tab → FAB → Enter, pointer opening, fresh-tab account switching, Tab/Shift+Tab, Escape, screen-reader dismissal, and focus return. Confirm the opening Enter does not also activate the newly focused action.

What alternative solutions did you explore? (Optional)

The earlier suggestion to suppress the ring only when no Tab navigation occurred does not cover these steps: Tab sets the navigation flag, and Enter leaves it set (hadTabNavigation:19–47). Unconditionally suppressing the ring would instead leave keyboard users focused on an invisible action.


Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/107818) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run · no recording available

MelvinBot avatar Nov 25 '26 15:11 MelvinBot

@MelvinBot Why this was implemented(I believe a11y requires that somehow, so we want to follow all a11y requirments in a fix)

Eskalifer1 avatar Nov 25 '26 15:11 Eskalifer1

Yes—this was deliberately implemented for accessibility, and my earlier proposal missed an important historical decision.

Why it exists

Fix Screen Reader issue preventing bottom sheet from closing without selection addressed screen-reader users being unable to close bottom sheets without selecting an option.

  • The dismiss button lives inside the sheet because the backdrop is outside the modal and is not a reliable dismissal target for screen-reader navigation (rationale).
  • It is invisible by design, following an explicit design decision.
  • Dismiss receives initial focus intentionally, so users can immediately exit rather than navigate through a potentially long list. The final decision explicitly standardized dismiss-first behavior.

That policy is implemented in BaseModal.tsx:318–319.

What the fix must preserve

Dismiss-first is an approved App design choice—not a universal accessibility requirement. The W3C modal-dialog guidance allows different initial-focus targets, but calls for focus inside the dialog, contained keyboard navigation, dismissal, and appropriate focus return. It also strongly recommends a visible close or cancel button.

Therefore, I would revise my earlier recommendation:

  • Preserve the immediately discoverable, labelled, operable dismissal action.
  • Do not simply hide its keyboard focus indicator.
  • Prefer an understandable visible presentation when Dismiss has keyboard focus; changing initial focus instead requires explicitly revisiting the previous design decision.
  • Validate keyboard navigation and actual VoiceOver/TalkBack dismissal before accepting the fix.

Moving focus directly to a menu action could undo the accessibility behavior this control was introduced to provide. The history establishes that risk; no replacement behavior has been assistive-technology-tested yet.


view run

MelvinBot avatar Nov 25 '26 15:11 MelvinBot