Skip to content

"Add to Essentials" disabled incorrectly when using separate-essentials with multiple workspaces #12852

@thunter009

Description

@thunter009

Preliminary Checks

  • I have read and understood the important section above.
  • I have searched existing issues and avoided creating duplicates.
  • I am not filing an enhancement request.
  • I have checked that this issue cannot be reproduced on Mozilla Firefox.
  • I have checked that this issue can be reproduced once I removed all my Mods and Custom CSS.

What happened?

When zen.workspaces.separate-essentials is enabled (container-specific essentials), the "Add to Essentials" context menu item becomes disabled even when the current workspace has available slots. The badge text also shows the wrong count.

Root cause: canEssentialBeAdded() in ZenPinnedTabManager.mjs checks gBrowser._numZenEssentials < this.maxEssentialTabs, but _numZenEssentials counts essentials globally across all workspaces. When separate-essentials is enabled, the count should only include essentials belonging to the active workspace's container.

Example: With max 12 slots — if workspace A has 5 essentials and workspace B has 7, the global count is 12. Both workspaces show "Add to Essentials" as disabled, even though each individually has room.

The badge text ("5 / 12 slots filled") is also wrong — it shows the global count instead of the per-workspace count.

Expected behavior

When zen.workspaces.separate-essentials is enabled, the slot count and disable check should only count essentials in the active workspace's container, not globally.

Actual behavior

The slot count is always global. "Add to Essentials" gets incorrectly disabled when the total essentials across ALL workspaces reaches the max, regardless of the current workspace's individual count.

Steps to reproduce

  1. Enable zen.workspaces.separate-essentials in about:config
  2. Create two workspaces (A and B)
  3. In workspace A, add several tabs to Essentials (e.g. 7)
  4. Switch to workspace B, add several tabs to Essentials (e.g. 5)
  5. Total is now 12 (the default max)
  6. Try to add another tab to Essentials in either workspace
  7. The context menu shows "Add to Essentials" as disabled with "12 / 12 slots filled", even though neither workspace individually has 12

Version

1.14b (latest dev branch, also reproducible on stable)

What platform are you seeing the problem on?

macOS - aarch64

What component is this issue related to?

Tabs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions