Skip to content

Conversation

@Vedaant-Rajoo
Copy link
Contributor

@Vedaant-Rajoo Vedaant-Rajoo commented Nov 18, 2025

Fix:
✅ Detects essential/pinned tabs
✅ Routes them through onCloseTabShortcut to unload instead of remove
✅ Updates the Ctrl+Tab UI properly (removes preview, updates list)

Fixes #9012

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Bug labels Nov 18, 2025
@Vedaant-Rajoo
Copy link
Contributor Author

Ctrl-Tab is a little finnicky, because we need to define that pinned/essential tabs always get unloaded from that menu.

Copy link
Member

@mr-cheffy mr-cheffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some minor changes, could you please guide me on how you would remove a tab from the ctrl+tab menu though?

- gBrowser.removeTab(aPreview._tab);
+ const tab = aPreview._tab;
+
+ if (tab.hasAttribute("zen-essential") || tab.pinned) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All essentials already have tab.pinned guaranteed.

+ new KeyboardEvent('keydown', { key: 'w', ctrlKey: true }),
+ tab
+ );
+ // Manually update UI since unloading doesn't trigger TabClose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the comments, to reduce patch sizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Essentials getting removed when trying to close tab from recently used menu

2 participants