mbnuqw / sidebery

Firefox extension for managing tabs and bookmarks in sidebar.
MIT License
3.42k stars 174 forks source link

[Bug] Using Ctrl+W keyboard shortcut to close tab does not warn if you close parent that has one child #1454

Open devgid opened 8 months ago

devgid commented 8 months ago

Description

There is an option in settings

Close Child Tabs With Parent: All/Folded/None

I set it to "All" as I want to close all tabs in that tree structure when closing a parent tab

Then there is this setting:

Warn on trying to close multiple tabs: Any/Collapsed/None.

I set it to Any as I want warning when multiple tabs are closed

I then create a new parent tab with 1 child tab. I click keyboard shortcut Ctrl +W to delete on the parent tab which closes both parent and child, but I get no warning.

If the parent tab has multiple tabs and you click Ctrl + W to close the parent then I do get the warning but the parents is deleted first and the warning count is the number of children not the number of children + parent.

Take note the above works correctly if you use the close icon next to the tab in sideberry. The issue is only if you use Ctrl +W keyboard shortcut.

devgid commented 8 months ago

I tested it to see when it occurs. The issue is related to using keyboard Ctrl + W that works different to when you use the close button to the right of the tab in sideberry

For the settings

Close Child Tabs With Parent: All Warn on trying to close multiple tabs: Any

Scenario 1

  1. Have a parent and create a 1 child by pressing on a link in the parent webpage by holding in Ctrl+ Left click. This does not navigate to the child but stays on the parent.
  2. Now press Ctrl+W. This closes the parent and child without any warning message (in this situation you should get a warning)

Scenario 2

  1. Have a parent tab and create 2 children by pressing on a link twice in the parent webpage by holding in Ctrl+ Left click. This does not navigate to the children but stays on the parent. (or you can select parent yourself after creating the children)
  2. Now press Ctrl+W. This closes the parent, flattens the two children and you get warning asking you if you want to delete the 2 children. If you say No. The parent has already been closed as it is is closed prior to the warning confirmation. (the parent should not have closed automatically prior to the warning)