brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.57k stars 2.28k forks source link

[cr129 follow up] Fix side panel continuity for shared pinned tabs #40681

Open mkarolin opened 3 weeks ago

mkarolin commented 3 weeks ago

Description

Currently, if you have the shared pinned tabs feature enabled, you pin a tab and open a contextual side panel for it (for example Leo AI, summarize page), and then you open a new window and activate the pinned tab there, the side panel in the new window has the same content as it did in the old window.

With the upstream change https://chromium.googlesource.com/chromium/src/+/2fd6b53ceaf1144ff7e4cf1a867a954b53271d1b the SidePanelRegistry is no longer owned by the WebContents, but instead is owned by TabFeatures, so when we move the WebContents from the old window to the new window the SidePanelRegistry doesn't move with it. The result is that the old window still has the side panel in the state it was before the move and the new window doesn't show the side panel.

Additional code changes beyond the scope of the Chromium bump are needed to get this working again.

Test plan:

  1. Start the browser and navigate to brave://flags
  2. Search for brave-shared-pinned-tabs and verify that it's set to disabled (default).
  3. Enable the brave-shared-pinned-tabs flag and click Relaunch button.
  4. Once the browser restarts, navigate to brave://settings/appearance and scroll down to the [Tabs] section
  5. Enable the "Show pinned tabs in all windows" in the Settings -> Appearance [Tabs]
  6. Navigate to brave.com
  7. Right-click on the tab and select Pin
  8. Observe the tab is now pinned
  9. Click on Leo AI button and when the side panel opens click Summarize button
  10. Open a new browser window via the hamburger menu
  11. Verify the new window has brave.com pinned tab.
  12. Click on the pinned tab in the new window
  13. Verify that the side panel is opens in the tab and has the same content as it did in the old window
  14. In the old window verify that the side panel is not shown.
mkarolin commented 3 weeks ago

cc: @simonhong @petemill