Skip to content

Add Sort Tabs Context Menu with Preference Toggle#40

Open
ninjaeon wants to merge 4 commits intoDarsh-A:mainfrom
ninjaeon:sort-tabs-context-menu
Open

Add Sort Tabs Context Menu with Preference Toggle#40
ninjaeon wants to merge 4 commits intoDarsh-A:mainfrom
ninjaeon:sort-tabs-context-menu

Conversation

@ninjaeon
Copy link

@ninjaeon ninjaeon commented Oct 9, 2025

Summary

  • Add "Sort Tabs" option to tab context menu when right-clicking
  • Add independent preference toggle for context menu visibility
  • Add automatic restart confirmation popup when toggling preference
  • Context menu positioned before "Reload Tab" for logical grouping
  • Smart visibility based on sort feature and workspace state
  • Hides when multiple tabs selected (encourages button usage)

Test plan

  • Verify "Sort Tabs" appears in tab context menu when enabled
  • Verify context menu item respects preference toggle setting
  • Verify restart confirmation popup appears when toggling preference
  • Test context menu functionality with single vs multiple tab selection
  • Verify context menu hides when sort feature is disabled
  • Test restart functionality from confirmation popup

Implementation Details

  • Uses Zen Browser's MozXULElement.parseXULToFragment() pattern
  • Integrates with existing cmd_zenSortTabs command
  • Adds CSS media queries for proper visibility control
  • Follows Sine mod patterns for preference handling

💘 Generated with Crush CLI using GLM-4.6 to vibe code these features. Manual review is recommended as I'm not a programmer.

- Added context_zenSortTabs menu item to tab context menu
- Positioned before "Reload Tab" for logical grouping
- Added separator for better visual separation
- Smart visibility based on sort feature and workspace state
- Hides when multiple tabs selected (use button instead)
- Uses existing cmd_zenSortTabs command for consistency
- Updated initialization to check for tabContextMenu availability

💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>
- Added "Enable the sort tabs context menu item" toggle under Feature Toggles
- New preference key: extensions.tabgroups.enable_context_menu
- Context menu item now respects this toggle preference
- Added CSS media query to hide menu item when disabled
- Updated CONFIG.featureConfig to include contextMenu setting
- Only sets up context menu when the feature is enabled

💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>
- Added "restart": true to context menu preference
- Sine will automatically show restart confirmation when toggling
- Provides one-click restart functionality via toast notification
- Improves user experience with clear feedback about required restart
- Consistent with other Sine mod behavior

💘 Generated with Crush
Co-Authored-By: Crush <crush@charm.land>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant