Closed Bug 2084942 Opened 1 month ago Closed 28 days ago

The @mention a generated page will not show the correct Favicon

Categories

(Core :: Machine Learning: Frontend, defect, P3)

Desktop
Unspecified
defect

Tracking

()

VERIFIED FIXED
162 Branch
Tracking Status
firefox-esr153 --- disabled
firefox158 --- disabled
firefox159 --- disabled
firefox160 --- disabled
firefox161 --- disabled
firefox162 --- verified

People

(Reporter: rdoghi, Assigned: giulia)

References

(Blocks 1 open bug)

Details

(Whiteboard: [aiaug])

Attachments

(1 file, 1 external file)

Attached video smartbarchips.mp4 —

Found in

  • Nightly 160.0a1 (2026-10-22)

Affected versions

  • Nightly 160.0a1 (2026-10-22)

Affected platforms

  • All

Preconditions
Enable Smart Window.

Steps to reproduce

  1. Reach any website and create a page for it.
  2. Open a new tab And @mention the generated tab.

Expected result

  • The Favicon for that page should be displayed in the Context chip.

Actual result

  • The @mention page does not show the correct Favicon.

Regression range
N/A

The inline @ mention path never uses the tab's real icon. It rebuilds the icon from the URL as page-icon:<url>, and for a generated page (about:smartpage?page=…) that lookup always gets the default globe.

  • A generated page's favicon is a static chrome: SVG in aitab.html. FaviconLoader.sys.mjs only lets Places store data: icons (before pageshow) for trusted schemes. So the tab gets smart-page-16.svg via gBrowser.setIcon, but Places has nothing stored for the about:smartpage URL.

  • The suggestion row gets the right icon: it comes from tab.image in SmartbarMentionsPanelSearch.sys.mjs. Adding the tab through the context "+" button keeps that icon (iconSrc: icon). Typing @ instead calls plugin.mentions.insert() in SmartbarInputUtils.mjs, which drops icon.

  • Every later step then rebuilds the icon from the URL:

    • the editor chip's nodeView (SmartbarInputUtils.mjs) uses page-icon:${node.attrs.id}
    • #calculateCurrentMentions and the tab-group expansion in ai-window.mjs (and line 2237) use UrlbarShared.getIconForUrl()
    • #getIconSrc in ai-chat-message.mjs builds page-icon:${href} for the sent message

    For about:smartpage all of these resolve to the default favicon.

Suggested fix: add a URL-based resolver next to isSmartPageURL in TrustedInternalURLs.mjs. It would return chrome://browser/content/aiwindow/assets/smart-page-16.svg for smart-page URLs and getIconForUrl() for everything else. Note that it takes a parsed URL, as in ai-window.mjs around line 1595. Use it at the three places above. A URL-based resolver is needed because the stored mention markdown only carries href, type and color. An icon attr on the mention node would be lost when a conversation is restored or re-rendered. Keep it out of UrlbarShared.getIconForUrl: that has around 17 urlbar callers. Precedent: #resolveTabIconSrc in SmartbarInput.mjs already lets chrome: icons through for the current-tab chip. Both aiWindow.html and aiChatContent.html allow img-src chrome:. Other about: pages with a chrome: favicon (e.g. about:preferences) very likely have the same problem in live chips. Carrying the chrome: tab.image through mentions.insert would cover those too, but that is a separate change.

Test: no existing test checks a tab-mention chip's icon. Add a case to browser_aiwindow_smartbar_inline_mentions.js. It can open about:smartpage?page=<name> with browser.smartwindow.aitab.enabled set, as browser_aitab_page.js does, then @mention it and check the chip's iconSrc.

Suggested severity: S4. The defect is cosmetic: the mention still works and only its chip shows a generic icon instead of the smart-page icon.


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, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.

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

The severity field is not set for this bug.
:jlevinsohn, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jlevinsohn)
Severity: -- → S3
Priority: -- → P3
Assignee: nobody → gcardieri
Attachment #9673592 - Attachment description: WIP: Bug 2084942: Add aitab favicon to the Places component → Bug 2084942: Add aitab favicon to the Places component
Status: NEW → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch

Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.

The patch landed in nightly and beta is affected.

:giulia, 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-firefox161 to wontfix if the fix can wait for the next release.

Uplift requests can be submitted from Lando: D339241.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(gcardieri)

Verified as fixed in our latest Nightly 162.0a1 (2026-11-06)

QA Whiteboard: [qa-found-in-c160][QA-5482][S4] → [qa-found-in-c160][QA-5482][S4][qa-ver-needed-c161/b160]
QA Contact: rdoghi
Flags: needinfo?(jlevinsohn)
Flags: needinfo?(gcardieri)

Updating the main status flag.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-found-in-c160][QA-5482][S4][qa-ver-needed-c161/b160] → [qa-found-in-c160][QA-5482][S4][qa-ver-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: