Closed Bug 2033806 Opened 4 months ago Closed 3 months ago

The Sidebar Conversation scrolls back to the top when switching tabs

Categories

(Core :: Machine Learning: Frontend, defect)

Desktop
Unspecified
defect

Tracking

()

VERIFIED FIXED
152 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox150 --- unaffected
firefox151 --- verified
firefox152 --- verified

People

(Reporter: rdoghi, Assigned: giulia)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [aife])

Attachments

(3 files)

Attached video scrollback.mp4 โ€”

Found in

  • Nightly 152.0a1 (2026-04-21)

Affected versions

  • Nightly 152.0a1 (2026-04-21)

Affected platforms

  • All

Steps to reproduce

  1. Open Smart Window.
  2. Reach a few websites in different tabs.
  3. Submit a few prompts for each tab.
  4. Switch between tabs back and forth.

Expected result

  • The Conversations should not scroll back to the top.

Actual result

  • The Conversations scroll back to the top when switching tabs.

Regression range
Bug 2026814

:gcardieri, since you are the author of the regressor, bug 2026814, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(gcardieri)

Checked the state of the main branch before Bug 2026814 and can confirm this bug was caused by it. Sorry about that.
I think the root cause is the change in line 256 of this patch https://phabricator.services.mozilla.com/D290626
The goal of that change was: Added this.shadowRoot?.querySelector(".chat-inner-wrapper")?.style.removeProperty("--content-height"); to recalculate the chat inner content height, this was the same for all tabs and was causing the sidebar scrollbar to show up when it shouldn't
The issue is that this reset is happening every time the user changes a tab, which is not what we want.

Flags: needinfo?(gcardieri)
Whiteboard: [genai][chat] → [aife]

(In reply to Giulia Cardieri (:giulia) from comment #2)

Checked the state of the main branch before Bug 2026814 and can confirm this bug was caused by it. Sorry about that.
I think the root cause is the change in line 256 of this patch https://phabricator.services.mozilla.com/D290626
The goal of that change was: Added this.shadowRoot?.querySelector(".chat-inner-wrapper")?.style.removeProperty("--content-height"); to recalculate the chat inner content height, this was the same for all tabs and was causing the sidebar scrollbar to show up when it shouldn't
The issue is that this reset is happening every time the user changes a tab, which is not what we want.

Next week is the final full week of beta for Fx151, do you plan on fixing and requesting uplift in time?
Could this be triaged?

Flags: needinfo?(gcardieri)

(In reply to Donal Meehan [:dmeehan] from comment #3)

(In reply to Giulia Cardieri (:giulia) from comment #2)

Checked the state of the main branch before Bug 2026814 and can confirm this bug was caused by it. Sorry about that.
I think the root cause is the change in line 256 of this patch https://phabricator.services.mozilla.com/D290626
The goal of that change was: Added this.shadowRoot?.querySelector(".chat-inner-wrapper")?.style.removeProperty("--content-height"); to recalculate the chat inner content height, this was the same for all tabs and was causing the sidebar scrollbar to show up when it shouldn't
The issue is that this reset is happening every time the user changes a tab, which is not what we want.

Next week is the final full week of beta for Fx151, do you plan on fixing and requesting uplift in time?
Could this be triaged?

Hey Donal,
This is already in the smart window backlog but not in our current sprint. I messaged my team and I'm still waiting for an answer from product.
My opinion is that this is not an urgent issue and will probably be worked in the upcoming weeks, not aiming for Fx151 beta.

Flags: needinfo?(gcardieri)
Blocks: 2034586

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

For more information, please visit BugBot documentation.

Flags: needinfo?(edilee)
Assignee: nobody → gcardieri
Status: NEW → ASSIGNED
Attachment #9584332 - Attachment description: WIP: Bug 2033806: Save scroll position when tabs are switched on smart window chat → Bug 2033806: Save scroll position when tabs are switched on smart window chat
Pushed by asilaghi@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bbad8cfa8880 https://hg.mozilla.org/integration/autoland/rev/e315660358cd Revert "Bug 2033806: Save scroll position when tabs are switched on smart window chat r=jlewis" for causing bc and TV failures at browser_aichat_content_scrolling_position.js

Backed out for causing bc failures at browser_aichat_content_scrolling_position.js
Backout Link
Push with failures
Failure Log TV
Failure Log bc
Failure line TEST-UNEXPECTED-FAIL | browser/components/aiwindow/ui/test/browser/browser_aichat_content_scrolling_position.js | test_scrolling_is_restored - Uncaught exception in test - Conv 1 scrollTop should be restored to 100 - timed out after 50 tries.

Flags: needinfo?(gcardieri)
Flags: needinfo?(gcardieri)
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
Severity: -- → S3
Flags: needinfo?(edilee)

Verified as fixed in our latest Nightly 152.0a1 (2026-05-13)

QA Whiteboard: [qa-found-in-c152][QA-4747][S4] → [qa-found-in-c152][QA-4747][S4][qa-ver-needed-c152/b151]
QA Contact: rdoghi

The patch landed in nightly and beta is affected.
:giulia, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(gcardieri)

We didn't have any functionality that saved the scrolled position when a conversation is restored via changing tabs. This patch adds this functionality so the user don't see scrolling differences (in most cases) when switching tabs in smart windows.

Original Revision: https://phabricator.services.mozilla.com/D299229

Attachment #9586346 - Flags: approval-mozilla-release?

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: This is a key feature to improve smart window's UX and was chosen by the product team to be uplifted.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: Follow the same test steps as listed in https://phabricator.services.mozilla.com/D299229
  • Risk associated with taking this patch: low
  • Explanation of risk level: This is hidden behind the smart window pref and only updates the scrolling function inside the chat, so low risk.
  • String changes made/needed?: No
  • Is Android affected?: no
Flags: qe-verify+
QA Whiteboard: [qa-found-in-c152][QA-4747][S4][qa-ver-needed-c152/b151] → [qa-found-in-c152][QA-4747][S4][qa-ver-needed-c152/b151][uplift]
Flags: needinfo?(gcardieri)
Attachment #9586346 - Flags: approval-mozilla-release? → approval-mozilla-release+

Verified as fixed in our latest Release 151.0.2

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-found-in-c152][QA-4747][S4][qa-ver-needed-c152/b151][uplift] → [qa-found-in-c152][QA-4747][S4][qa-ver-done-c152/b151][uplift]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: