fix(editor): apply empty-folder explorer ops without the "0 paths" dialog#142
Merged
Conversation
…alog Renaming, moving, or deleting an empty structural folder (pages/styles/ scripts) rewrites no page slugs or file paths, yet it surfaced the Site Explorer confirmation dialog reading "This will rewrite 0 paths" plus a generic warning — pure friction with nothing to review. Worse, the confirm-plan commit only rewrote page/file paths and ignored the section bookkeeping (emptyFolders/expandedFolders/rowOrder), where an empty folder's path actually lives. So the "0 paths" rename/delete was a silent no-op: you confirmed and nothing changed. Fix both at the source: - Core (explorerPathPlans.ts): rewrite plans carry the folder-path change and delete plans carry the removed folderPath. commit now rewrites/removes the emptyFolders/expandedFolders/rowOrder references so empty-folder rename/move/ delete persist. Non-empty folder renames route through the same rewrite, which also keeps their expansion + ordering instead of losing it to the reconcile pruning pass. - UI (SiteExplorerPanel.tsx): a single presentStructuralPathPlan interception applies a plan directly when it has no blockers and rewrites 0 content paths; otherwise it opens the dialog. Covers inline rename, context-menu delete, and drag-drop moves. Verification: bun run build, bun run lint, and the site-explorer + panels test suites all clean; added core + end-to-end store tests for empty folder rename/move/delete bookkeeping. Pre-existing icon-catalog architecture failures are environmental (vendored pixel-art-icons dist not built in this worktree) and unrelated to this change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DavidBabinec
marked this pull request as ready for review
July 1, 2026 13:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Renaming, moving, or deleting an empty structural folder (pages / styles / scripts) in the Site Explorer no longer pops the "This will rewrite 0 paths" confirmation dialog. Those operations rewrite no page slugs or file paths, so they now apply directly. The dialog still appears whenever there is something to review — real slug/path rewrites, or a blocker to explain.
Why
Two problems, one screenshot:
pages[].slug/files[].path. An empty folder's path lives in the section bookkeeping (emptyFolders/expandedFolders/rowOrder), which the commit never touched. So even after clicking Apply, the empty folder was not renamed/deleted — the operation did nothing.Fixing only the UI (hiding the dialog) would have made the silent no-op worse, so both are fixed at the source.
How
Core —
src/core/page-tree/explorerPathPlans.tsfolderPathChange { from, to }; delete plans carry the removedfolderPath.commitrewrites/removes theemptyFolders/expandedFolders/rowOrderreferences so empty-folder rename/move/delete actually persist. Non-empty folder renames route through the same rewrite, which also preserves their expansion + ordering (previously lost to the reconcile pruning pass).UI —
src/admin/pages/site/panels/SiteExplorerPanel/SiteExplorerPanel.tsxpresentStructuralPathPlaninterception applies a plan directly when it has no blockers and rewrites 0 content paths; otherwise it opens the dialog. Covers inline rename, context-menu delete, and drag-drop moves through one code path.Tests
Verification
bun run build✓bun run lint✓bun test src/__tests__/site-explorer/ src/__tests__/panels/✓ (all pass)Pre-existing
icon-catalog-integrityarchitecture failures are environmental (the vendoredpixel-art-icons/distis not built in this worktree) and unrelated to this change.🤖 Generated with Claude Code