Closed Bug 2072356 Opened 2 months ago Closed 2 months ago

[HNT] When user chooses homepage as opening screen and on cold start, navigating to any URL replaces last accessed tab

Categories

(Firefox for Android :: Homepage, defect)

All
Android
defect

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: npoon, Assigned: npoon)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

(Whiteboard: [fxdroid] [group5])

Attachments

(3 files, 1 external file)

Precondition

  1. Have homepage as new tab enabled
  2. Set opening screen to homepage (under homepage settings)

Steps to reproduce

  1. Open a tab and go to a url. Ex: https://www.google.com/
  2. Kill the app and then reopen it
  3. Click on the homepage toolbar
  4. Type in the any url and press enter

Expected behavior

Open a new tab that goes to the same url

Actual behavior

When opening a fresh fenix instance, the user lands on the homepage (and it doesn't count as a tab). When the user navigates, they are directed to the same opened tab, which is now replaced by the second url, instead of opening a new tab with the second url

With HNT enabled, BrowserToolbarSearchMiddleware.kt hardcodes newTab = false on URL commit, as does FenixSearchMiddleware.kt for awesomebar suggestions, so FenixBrowserUseCases.kt takes the loadUrlUseCase branch and navigates whichever tab is selected. That assumes the homepage on screen is always backed by a selected about:home tab, which is false on a cold start with "open on homepage": HomeActivity.kt only skips navigateToBrowserOnColdStart() and leaves the restored tab selected, while HomepageTabBinding.kt adds a homepage tab only when the current mode has zero tabs. Any URL typed from that screen therefore loads into the restored tab, which reads as "switched to the existing tab" when the typed URL happens to match it.

Fix: In HomeActivity.onCreate, when shouldStartOnHome() and enableHomepageAsNewTab are both true, select or add a homepage tab so the selected tab matches what is displayed, and derive newTab in both search middlewares from whether the selected tab is a homepage tab (isHomepageTab, BrowserState.kt, currently private) rather than hardcoding false.

Suggested severity: S3. A URL entered from the homepage after a cold start replaces the user's restored tab instead of opening a new one, though opening a tab explicitly from the tab manager first works around it and the feature is still Nimbus-gated to nightly.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-wrong-file, ai-triage-wrong-cause, ai-triage-hallucination, ai-triage-out-of-scope, ai-triage-wrong-fix, ai-triage-shallow-fix.

Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.

Assignee: nobody → npoon
Status: NEW → ASSIGNED
Summary: [HNT] Navigating to a URL that already exists in homepage opens existing tab → [HNT] When user chooses homepage as opening screen and on cold start, navigating to a URL that already exists replaces last accessed tab
Summary: [HNT] When user chooses homepage as opening screen and on cold start, navigating to a URL that already exists replaces last accessed tab → [HNT] When user chooses homepage as opening screen and on cold start, navigating to any URL replaces last accessed tab
Pushed by npoon@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7f3aa4f478f9 https://hg.mozilla.org/integration/autoland/rev/bb7dbcbe7ecf [HNT] Add a new homepage tab on cold start when user sets opening screen as homepage r=android-reviewers,gl
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
Flags: qe-verify+

Hey QA,
Can we also confirm that the behaviour for homepage as new tab off hasn't changed? Thanks

Verified as fixed on Nightly 159.0a1 with Samsung S23 Ultra(Android 14) and Pixel 3 XL (Android 9). Also the behaviuor of HNT off is not changed.

Flags: qe-verify+
Regressions: 2080636
Regressions: 2079704
Regressions: 2084506
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: