zen-browser / desktop

🌀 Experience tranquillity while browsing the web without people tracking you!
https://zen-browser.app
Mozilla Public License 2.0
16.05k stars 387 forks source link

Last tab behavior config is not respected #2354

Open BowDown097 opened 3 hours ago

BowDown097 commented 3 hours ago

Captchas

What happened?

When closing the last (unpinned) tab in the current window or workspace, a new tab is immediately opened, despite the browser being configured to disable that behavior. I'm fairly certain the cause of this is a logic error with the new zen.workspaces.open-new-tab-if-last-unpinned-tab-is-closed preference.

On a side note, if this is the case, I'm surprised it affects the window as a whole - I feel like the preference should only take effect if multiple workspaces are open, as now an additional preference would have to be set to achieve the effect of browser.tabs.closeWindowWithLastTab.

Relevant Settings

zen.workspaces.open-new-tab-if-last-unpinned-tab-is-closed -> false browser.tabs.closeWindowWithLastTab -> true

Reproducible?

Version

1.0.1-a.13

What platform are you seeing the problem on?

Linux

Relevant log output

No response

dosubot[bot] commented 3 hours ago

Hey @BowDown097! 👋 I'm here to help you with bugs, questions, and becoming a contributor. Let's tackle this issue together!

The issue you're experiencing seems to be related to the zen.workspaces.open-new-tab-if-last-unpinned-tab-is-closed preference. By default, this preference is set to true, which means a new tab will open when the last unpinned tab is closed [1]. If you've set this preference to false and it's not being respected, it might be due to a logic error in the code handling this preference.

Unfortunately, I couldn't find specific details in the codebase about how this preference interacts with browser.tabs.closeWindowWithLastTab or any conditions that might override your settings. It might be worth checking if there are any recent changes or commits that could have introduced this behavior, although I couldn't find any information on that either.

If the preference is affecting the entire window rather than just workspaces, it could be an unintended side effect. You might need to look into the code handling workspace states to see if there's any logic that could be causing this behavior.

To continue talking to Dosu, mention @dosu.