Skip to content

[$175] Distance - Address line 1 is not auto focused when opened from home address link #100235

Open

Description

@applause-bot

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


Version Number: 9.4.69-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: #99767
Email or phone of affected tester (no customers): applausetester+ssndjois2jd1@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Log in with Expensifail accounts.
  • Create a workspace and add an address to workspace.
  • Enable Distance rates. Select Calculate by home and office in Distance rates > Settings > Exclude commutes.
  • Invite another member to the workspace.
  • Perform the steps below as invited member.
  1. Go to staging.new.expensify.com
  2. Go to invited workspace chat.
  3. Click Add address button.
    → Address line 1 field is auto focused.
  4. Go back to invited workspace chat.
  5. Click home address link.

Expected Result:

Address line 1 will be auto focused when opened from home address link.

Actual Result:

Address line 1 is not auto focused when opened from home address link.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7249544_1788390090796.1.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7249544

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @getusha

Activity

  1. applause-bot commented on Sep 2, 2026

    @applause-bot
    Author

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

  2. added
    DeployBlockerCash
    Bug
    on Sep 2, 2026
  3. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #99767

  4. github-actions commented on Sep 2, 2026

    @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.
  5. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    @Gonals @getusha you have been assigned to this deploy blocker because you reviewed the offending PR: #99767

  6. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    @iwiznia you have been assigned to this deploy blocker because you authored the offending PR: #99767

  7. melvin-bot commented on Sep 2, 2026

    @melvin-bot

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

  8. MelvinBot commented on Sep 2, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #99767 - "Add link to home address message" by @iwiznia (High confidence)
    Related Issues: #99740 (the issue #99767 fixed), #100228 (StagingDeployCash — #99767 is item 26)

    Recommendation: ROLL FORWARD

    The two entry points are not equivalent: the Add address button navigates via openPrivatePersonalDetailsPage(INPUT_IDS.ADDRESS_LINE_1), which appends ?fieldToFocus=addressLine1 to the route, while the new home address link is a plain anchor in the report action HTML that navigates to the same page without that param — and autoFocus on Address line 1 is driven entirely by that param. Reverting #99767 would reintroduce #99740 ("Home address is shown as text"), so a targeted fix is safer and smaller than a revert.

    Assigned: @iwiznia (PR author), @Gonals and @getusha (approving reviewers) — already assigned by Melvin.
    Labels: No changes. DeployBlockerCash stays (an App PR caused this). DeployBlocker was never applied, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    • Add link to home address message #99767 is the only PR on the current staging checklist that touches this message. It changed HomeAddressRequiredContent.tsx from rendering getReportActionText(action) as plain text to rendering getReportActionHtml(action) through RenderHTML. That change is exactly what turned "home address" into a clickable link — i.e. the second entry point in the repro did not exist before this PR, which is why the bug is staging-only and N/A on production.
    • The PR's own three touched files are HomeAddressRequiredContent.tsx plus two unit test files, so the regression surface is small and fully contained in this component.
    • The button in the same component still works because it was untouched: it calls openPrivatePersonalDetailsPage(INPUT_IDS.ADDRESS_LINE_1) at line 43.

    Verification — how the two entry points differ

    1. Button path. openPrivatePersonalDetailsPage builds the route with a field to focus, then swaps the background tab and defers the RHP navigation until that transition settles.
    2. Route param. ROUTES.SETTINGS_PRIVATE_PERSONAL_DETAILS.getRoute only appends ?fieldToFocus=… when a field is passed; with no argument the route is the bare settings/profile/private-personal-details.
    3. Consumer. PrivatePersonalDetailsPage.tsx#L54 reads route.params?.fieldToFocus, and Address line 1 sets autoFocus={fieldToFocus === INPUT_IDS.ADDRESS_LINE_1}. No param ⇒ autoFocus={false}. There is no other focus mechanism on that input.
    4. Link path. Anchors inside a comment are handled by AnchorRenderer, which calls openLink(attrHref, …). For an internal NewDot path that ends in a bare Navigation.navigate(internalNewExpensifyPath) — it forwards the href verbatim (query string included, via Url.getPathFromURL) and never calls openPrivatePersonalDetailsPage.

    So the link renders and navigates correctly, but the href it navigates to carries no fieldToFocus, and nothing in the link path adds one.

    Root Cause

    Autofocus on this screen is opt-in and driven purely by the fieldToFocus query param. #99767 introduced a second way to reach the screen — the anchor in the report action HTML — that bypasses the openPrivatePersonalDetailsPage helper and therefore ships no fieldToFocus, so autoFocus resolves to false for Address line 1.

    Suggested fix (App-side, no backend dependency). In HomeAddressRequiredContent.tsx, normalize the private-personal-details href in the action HTML before handing it to RenderHTML so it matches the CTA's destination, e.g. rewrite settings/profile/private-personal-details to ROUTES.SETTINGS_PRIVATE_PERSONAL_DETAILS.getRoute(INPUT_IDS.ADDRESS_LINE_1). That keeps both entry points on one destination string and needs no backend change. Alternatively, the backend can include ?fieldToFocus=addressLine1 in the anchor it generates for this action — openLink already preserves the query string, so that would work with no App change.

    One more divergence worth fixing at the same time: the button also swaps the background tab to the profile page before opening the RHP, so it doesn't open over the workspace chat. openLink only performs that swap when an RHP is already open on a wide layout, so the link will open the RHP over the report. That's cosmetic relative to this report, but it's the same "two entry points, one destination" mismatch.

    Severity note: this is UX polish on a brand-new feature — the primary Add address CTA sitting directly under the message works correctly, and the link still reaches the right screen. If a quick fix isn't available before the deploy, this is a reasonable candidate to demote rather than hold the release.


    view run

  9. 68 remaining items

  10. melvin-bot commented on Nov 6, 2026

    @melvin-bot

    @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. jeffrey-graham commented on Nov 7, 2026

    @jeffrey-graham
  12. melvin-bot commented on Nov 7, 2026

    @melvin-bot
  13. getusha commented on Nov 9, 2026

    @getusha
    Contributor

    @MelvinBot implement this

  14. MelvinBot commented on Nov 9, 2026

    @MelvinBot
    Contributor

    Implementation blocked: the approved proposal no longer matches current code.

    Let members set their home address from Distance preferences without a magic code, merged November 4, replaced the proposed navigation helper. The new helper intentionally opens without autofocus, so making the link match the button would no longer solve this issue.

    The revised fix needs opt-in autofocus on the new address-only page and transition-safe navigation to avoid repeating the validation regression.

    No files changed or PR created. Please confirm that both entry points should autofocus Address line 1 on the new Home address page.


    view run

  15. getusha commented on Nov 9, 2026

    @getusha
    Contributor

    @MelvinBot we just need to autofocus when navigated from home address link

  16. MelvinBot commented on Nov 9, 2026

    @MelvinBot
    Contributor

    🤖 Web test steps verification results: ⚠️ partial

    Testing on dev NewDot web was blocked by missing fixtures. No requested behavior is verified.

    Preferences without the Home address entry

    Step Status
    Home address link autofocuses without a required-field errorNo workspace or home-address-required message was available.
    ⚠️
    Add address button retains existing focus behaviorThe message’s button fixture was unavailable.
    ⚠️
    Opening Home address through Preferences does not autofocusThe account lacked the commuter-exclusions beta entry.
    Preferences without the Home address entry
    ⚠️

    Implemented in draft PR: Autofocus home address only when opened from the message link, assigned to getusha. Button and Preferences behavior remain unchanged.

    Checks: 38,254 automated tests passed, along with lint, typecheck, compiler, spelling, and Storybook checks. The repository has no Prettier script; this is documented in the PR. Manual browser verification remains outstanding.


    view run

  17. melvin-bot commented on Nov 12, 2026

    @melvin-bot

    @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  18. added
    Reviewing
    and removed
    Daily
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugEngineeringExternalReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions