Skip to content

feat: support nested (sub-)folders - #73

Merged
Wikid82 merged 1 commit into
developmentfrom
feature/41-nested-folders
Aug 22, 2026
Merged

feat: support nested (sub-)folders#73
Wikid82 merged 1 commit into
developmentfrom
feature/41-nested-folders

Conversation

@Wikid82

@Wikid82 Wikid82 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds an optional parentId to BookmarkFolder, capped at MAX_FOLDER_DEPTH = 3 levels (root-level folders are depth 1) — depth limit and DnD-reparenting scope were confirmed with the maintainer before implementing.
  • createSubfolder (context menu on a folder): creates a folder directly under it, skipping a parent picker since the parent is implied by the click. Blocked with a warning if it would exceed the depth cap.
  • moveFolderToParent (context menu on a folder): reparents an existing folder via a picker (pickParentFolder) that excludes the folder itself, its descendants, and any parent that would exceed the depth cap.
  • deleteFolder now promotes direct child folders to the root (not deleted) the same way it already does for direct bookmarks.
  • getChildren recurses through the hierarchy; FolderGroupItem carries its direct child folders and shows a subfolder count alongside the bookmark count. List view shows a full breadcrumb path (Backend › Auth Service) instead of just the immediate folder name.
  • Drag-and-drop: dropping a folder onto another folder now nests it as that folder's last child. VS Code's tree DnD API can't distinguish "dropped near" from "dropped directly on" a target, so this collides with the sibling-reordering shipped in Reorder bookmarks and folders via drag-and-drop #38 — nesting wins since it's the primary reason to drag a folder onto another folder (confirmed this tradeoff with the maintainer). Reordering root-level folders now happens by dropping on empty tree space, which still appends to the end. Nesting that would exceed the depth cap or create a cycle is refused with a warning message.
  • pickFolder (for bookmarks) now renders breadcrumb labels too, for disambiguating same-named folders at different nesting levels — a no-op change for anyone not using nesting, since a root folder's breadcrumb is just its name.

Closes #41

Test plan

  • npm run lint
  • npm run test:coverage — 100% statements/lines, 95.71% branches
  • npm run build
  • npm run test:e2e — 8/8 passing against a real VS Code instance, including nested creation/recursion and a real drag-and-drop reparent
  • npm audit --audit-level=high — 0 vulnerabilities
  • scripts/local-patch-report.sh — 100% patch coverage (112/112)

Adds an optional parentId to BookmarkFolder, capped at
MAX_FOLDER_DEPTH = 3 levels (root-level folders are depth 1). New
commands:
- createSubfolder (context menu on a folder): creates a folder
  directly under it, skipping a parent picker since the parent is
  implied by the click. Blocked with a warning if it would exceed
  the depth cap.
- moveFolderToParent (context menu on a folder): reparents an
  existing folder via a picker (pickParentFolder) that excludes the
  folder itself, its descendants, and any parent that would exceed
  the depth cap.

deleteFolder now promotes direct child folders to the root (not
deleted) the same way it already does for direct bookmarks.
getChildren recurses through the hierarchy; FolderGroupItem carries
its direct child folders and shows a subfolder count alongside the
bookmark count. List view shows a full breadcrumb path
("Backend › Auth Service") instead of just the immediate folder name.

Drag-and-drop: dropping a folder onto another folder now nests it as
that folder's last child (VS Code's tree DnD API can't distinguish
"dropped near" from "dropped on," so nesting wins over the reordering
shipped in #38 — reordering root-level folders now happens by
dropping on empty space, which still appends to the end). Nesting
that would exceed the depth cap or create a cycle is refused with a
warning message.

pickFolder (for bookmarks) now renders breadcrumb labels too, for
disambiguating same-named folders at different nesting levels; its
match-by-name matching becomes match-by-breadcrumb, a no-op change
for anyone not using nesting since a root folder's breadcrumb is
just its name.

Includes unit tests for the store, the depth/cycle helper functions,
both new commands, the provider's recursive getChildren, and the
new drag-and-drop nesting semantics, plus an e2e test exercising
real nested creation, tree recursion, and drag-and-drop reparenting.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.58120% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
extension.ts 96.58% 0 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@Wikid82
Wikid82 merged commit ffebd9d into development Aug 22, 2026
7 checks passed
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.

2 participants