Skip to content

feat: Add support for nested folders#154

Open
Vermino wants to merge 3 commits intocogwheel0:mainfrom
Vermino:claude/nested-folders-support-01M1PvXJ2B2arT6PUHyugxK3
Open

feat: Add support for nested folders#154
Vermino wants to merge 3 commits intocogwheel0:mainfrom
Vermino:claude/nested-folders-support-01M1PvXJ2B2arT6PUHyugxK3

Conversation

@Vermino
Copy link

@Vermino Vermino commented Nov 20, 2025

Summary

Implements full support for nested folders with intuitive drag-and-drop interface and visual hierarchy.

Changes

  • Hierarchical folder display with visual indentation for nested structure
  • Create subfolders via context menu on any folder
  • Drag-and-drop folders into other folders to create nesting
  • Drag conversations into nested folders
  • Circular reference prevention - can't drop folder into itself or descendants
  • Smart folder counts - shows both conversations AND subfolders
  • Auto-expand behavior - parent folders expand when items are added

Technical Implementation

  • Created FolderHierarchy utility class to build tree structure from flat folder list
  • Recursive rendering algorithm for nested folder display with depth-based indentation
  • Dual DragTarget system for both conversation and folder drops
  • Removed long-press context menu in favor of explicit menu button to enable drag gestures
  • Leverages existing parentId field in Folder model (API already supported nesting)

UI/UX Improvements

  • Folders show "⋮" menu button for accessing New Subfolder, Rename, Delete
  • Long-press on folder now initiates drag instead of showing menu
  • Visual hover feedback when dragging over valid drop targets
  • Folders automatically expand when new items are nested inside
  • Indentation scales with depth for clear hierarchy visualization

Testing

  • Empty folders with subfolders now show correct count (e.g., "2" instead of "0")
  • Drag-and-drop prevents invalid nesting (circular references)
  • Parent folders expand automatically to show newly created/moved subfolders

Closes #81

Implements nested folder support with the following features:

- Created FolderHierarchy utility to build hierarchical tree from flat folder list
- Updated UI to render nested folders with proper indentation
- Added "Create Subfolder" option to folder context menu
- Implemented drag-and-drop support for:
  - Dragging conversations into nested folders
  - Dragging folders into other folders to create nesting
  - Prevention of circular references (can't drop folder into itself or descendants)
- Folders automatically expand when new subfolders are created or moved into them
- Visual indentation scales with folder depth for clear hierarchy display

The implementation leverages the existing parentId field in the Folder model,
which already supported nesting at the API level. The changes are primarily
UI enhancements to display and manage the folder hierarchy.

Addresses: cogwheel0#81
Previously, long-press on folders triggered the context menu, which prevented
the LongPressDraggable widget from initiating drag operations.

Changes:
- Removed onLongPress handler from folder InkWell
- Added explicit menu button (three dots icon) to folder headers
- Long-press gesture now exclusively handles drag-and-drop

UX flow:
- Tap folder → expand/collapse
- Long-press and drag folder → nest folder into another
- Click menu button → show context menu (new subfolder, rename, delete)
Previously, folder counts only showed conversations, making empty folders
with subfolders appear as "0", with no indication they contained nested
folders. This made it unclear that clicking to expand would reveal content.

Changes:
- Updated folder count to include both conversations AND subfolders
- Empty parent folders now show correct count (e.g., "1" if containing 1 subfolder)
- Makes nested folder structure more discoverable and intuitive

Example:
- Before: Folder with 0 chats and 2 subfolders showed "0"
- After: Same folder now shows "2"
@CrushedAsian255
Copy link

Would love for this to get merged, would make Conduit feel even more powerful than most AI chat apps.

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.

[FEAT] - Allow for folder stacking.

3 participants