brave / brave-browser

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

Another two inactive new tabs are created in new window after detaching a new tab from window #42588

Open simonhong opened 3 days ago

simonhong commented 3 days ago

Description

@Ilie-Lesan reported from https://github.com/brave/brave-browser/issues/41272#issuecomment-2452981864

When detaching a new tab, new window is created but that new window has another two inactive new tabs.

@llie-Lesan 's recording:

https://github.com/user-attachments/assets/b9694bae-fd76-42b8-bdc6-c560178f8ba3

Steps to reproduce

  1. Create one window
  2. Turn off Close window when closing last tab from brave://settings/system
  3. There is one new tab in the window
  4. Close that new tab and new tab is created
  5. Create another new tab and detach it and make another window with it

Actual result

New window has three new tabs

Expected result

New window should have only one detached tab

Reproduces how often

Easily reproduced

Brave version (brave://version info)

1.75.59 Chromium: 131.0.6778.85 (Official Build) nightly (arm64)

Channel information

Reproducibility

Miscellaneous information

cc @rebron @brave/qa-team

simonhong commented 3 days ago

This doesn't happen when we select Open the New Tab page of On startup option from brave://settings/getStarted. Investigating where two new tabs came from and why they are restored to detached window.