Skip to content

Conversation

@Builder14122
Copy link

@Builder14122 Builder14122 commented Sep 10, 2025

Add Right-Click Folder Creation to Sidebar

Summary

This PR introduces the ability to create folders in the sidebar through a right-click context menu, allowing users to better organize their tabs hierarchically.
AI Disclosure: This was all done with Opus 4.1

What's Changed

Core Features

  • Right-click context menu: Right-clicking anywhere in the sidebar now shows a "Create New Folder" option
  • Folder management: Users can create, rename, and delete folders
  • Tab organization: Tabs can be dragged into folders or moved via context menu
  • Expand/Collapse: Folders can be expanded or collapsed to show/hide their contents
  • Visual indicators: Folder icons and tab counts are displayed for easy navigation

Technical Implementation

Data Model Changes

  • Enhanced Folder model to support tabs with an order property
  • Added folder relationship to Tab model for organizing tabs into folders
  • Maintained backward compatibility with existing tab structures

New Components

  • FolderView: Displays folders in the sidebar with expand/collapse functionality
  • CreateFolderSheet: Dialog for creating new folders
  • FolderDropDelegate & FolderTabDropDelegate: Handle drag-and-drop operations

Updated Components

  • ContainerView: Added right-click context menu and folder display logic
  • TabItem: Enhanced context menu with folder management options
  • TabManager: Added methods for folder operations (create, rename, delete, move tabs)

Screenshots/Demo

[Add screenshots or GIF showing the feature in action]

  1. Right-clicking in the sidebar to show context menu
  2. Creating a new folder
  3. Dragging tabs into folders
  4. Expanding/collapsing folders

Testing

  • ✅ Build succeeds without errors
  • ✅ Right-click context menu appears correctly
  • ✅ Folders can be created with custom names
  • ✅ Tabs can be dragged into folders
  • ✅ Folders can be expanded/collapsed
  • ✅ Folders can be renamed by double-clicking
  • ✅ Empty folders can be deleted
  • ✅ Folders with tabs show confirmation before deletion
  • ✅ Tabs can be moved between folders via context menu

Compatibility

  • Requires macOS 14.0+
  • Compatible with existing tab management features
  • No breaking changes to existing functionality

Future Enhancements

  • Nested folders support
  • Keyboard shortcuts for folder operations
  • Folder color/icon customization
  • Bulk tab operations within folders
  • Folder templates/presets

Related Issues

This feature addresses the need for better tab organization in the sidebar, as discussed in community feedback.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • Code builds without warnings
  • Feature tested on macOS
  • No existing functionality broken
  • Documentation updated (if applicable)

How to Test

  1. Clone this branch
  2. Run xcodegen to generate the Xcode project
  3. Build and run the app
  4. Right-click in the sidebar area
  5. Select "Create New Folder"
  6. Try dragging tabs into the folder
  7. Test renaming (double-click folder name) and deletion (right-click folder)

Notes for Reviewers

  • The implementation uses SwiftUI's native context menu and drag-and-drop APIs
  • Folder state persistence is handled through the existing SwiftData framework
  • The UI follows the existing design patterns in the Ora browser

Please test the feature thoroughly and provide feedback on:

  • UI/UX improvements
  • Edge cases that need handling
  • Performance with many folders/tabs
  • Integration with other features

- Enhanced Folder model to support tabs with order property
- Added folder relationship to Tab model for organizing tabs into folders
- Implemented folder management methods in TabManager (create, rename, delete, move tabs)
- Created FolderView component for displaying folders in sidebar with expand/collapse functionality
- Added CreateFolderSheet for folder creation dialog
- Updated ContainerView with right-click context menu for creating folders
- Enhanced TabItem context menu with folder management options
- Implemented drag-and-drop support for moving tabs into folders

This feature allows users to right-click in the sidebar to create folders
for better tab organization. Users can drag tabs into folders, expand/collapse
folders, rename them, and move tabs between folders.
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