[HNT] Tapping 'x' on Homepage tab shows 'Tab closed' toast without closing it
Categories
(Firefox for Android :: Homepage, defect)
Tracking
()
People
(Reporter: apetridean, Assigned: npoon)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid] [group5])
Attachments
(4 files, 1 external file)
Steps to reproduce
- Launch Fenix with Tab Strip on.
- Ensure one tab is open in the Tab Strip.
- Tap the "x" button directly on the tab in the Tab Strip to close it.
- Observe that the "Tab closed - Undo" toast appears, but the tab remains visible in the Tab Strip.
- Tap "Undo" on the snackbar notification.
Expected behavior
Tapping 'x' on a Homepage tab should not trigger a false "Tab closed" notification if the tab cannot/should not be closed.
The Tab Strip state and the snackbar notification system should remain strictly synchronized.
Actual behavior
Tapping 'x' displays the "Tab closed - Undo" toast, but the Homepage tab remains visible and active in the Tab Strip
Device information
- Firefox version: Nightly 158.0a1 - 24.09.2026
- Android device model: Google Pixel 3 XL (Android 9), Samsung S23 Ultra (Android 14)
| Reporter | ||
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 1•2 months ago
|
||
| ai-triage-wrong-cause frontend-triage | ||
TabStrip.kt invokes onCloseTabClick unconditionally after tabsUseCases.removeTab, and on the homepage that lambda is wired straight to the undo snackbar while onLastTabClose is a no-op (HomeFragment.kt). The last tab really is removed, but HomepageTabBinding.kt then sees zero tabs and adds a fresh about:home tab, so the strip looks unchanged while the snackbar claims a tab was closed; tapping Undo restores the original tab without removing that replacement.
Fix: Have HomeFragment's tab strip close handler mirror removeTabAndShowSnackbar and onUndoTabsRemoved in TabsCleanupFeature.kt: add the replacement homepage tab explicitly, hold its id so Undo can remove it, and skip the snackbar when the removed tab was the last one and was itself about:home. Nothing currently exercises closeTab in TabStrip.kt, so add coverage next to TabStripStateTest.kt.
Suggested severity: S3. The notification is misleading rather than destructive, the tab strip stays usable, and the only lasting effect is a duplicate homepage tab if the user taps Undo.
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.
Comment 2•2 months ago
|
||
With HNT enabled we'd always have at least one HNT tab for the application to show something - the home page.. as a new tab.
Without HNT the homepage is shown and we could have 0 other tabs opened.
So part of this bug is expected.
I think a potential fix here would be to not allow closing the only remaining HNT tab - from the tabstrip or from the tabstray, with maybe a warning snackbar informing that this is not possible/supported. Or just hide the X button and not follow through on swiping the HNT tab off of the tabstray.
| Assignee | ||
Comment 3•2 months ago
|
||
Thanks for commenting Petru. I also looked at what chrome does and closing the last and only homepage tab will open the tabs tray, which we could consider but we would need product confirmation
Comment 4•2 months ago
|
||
(In reply to Nicholas Poon [:Nick] from comment #3)
Thanks for commenting Petru. I also looked at what chrome does and closing the last and only homepage tab will open the tabs tray, which we could consider but we would need product confirmation
I see Chrome rather closing the app when the last tab is closed from the tabstrip.
Which could be the better approach.
| Assignee | ||
Comment 5•2 months ago
|
||
(In reply to Petru-Mugurel Lingurar [:petru] from comment #4)
Created attachment 9648050 [details]
ClosingTheLastTabInChrome.mp4(In reply to Nicholas Poon [:Nick] from comment #3)
Thanks for commenting Petru. I also looked at what chrome does and closing the last and only homepage tab will open the tabs tray, which we could consider but we would need product confirmation
I see Chrome rather closing the app when the last tab is closed from the tabstrip.
Which could be the better approach.
Interesting, yes that would match desktop.
| Assignee | ||
Comment 6•2 months ago
|
||
| Assignee | ||
Comment 7•2 months ago
•
|
||
Discussed with Product and UX and it was decided that we want to show the tabs tray when closing the last tab, which is a homepage. This would also keep it in line with the close all tabs behaviour from the tabs tray.
When the user presses undo on the snackbar, the user shall stay on the tabs tray
https://mozilla.slack.com/archives/C0748C4AJ48/p1790257706777039
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 8•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
Comment 10•1 month ago
|
||
| bugherder | ||
Comment 11•1 month ago
|
||
Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.
Comment 12•1 month ago
|
||
The patch landed in nightly and beta is affected.
:npoon, please make an uplift decision for beta:
- For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set
status-firefox159towontfixif the fix can wait for the next release.
See Requesting an Uplift for documentation on how to request an uplift.
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•1 month ago
|
| Reporter | ||
Comment 13•1 month ago
|
||
Verified as fixed on the latest Nightly 161.0a1 from 26.10.2026 with Pixel 7 PRO (Android 17) and Samsung S25 (Android 15).
| Reporter | ||
Updated•1 month ago
|
Description
•