Skip to content

feat: add folders in Project tab; d'n'd, in-place rename - #38

Merged
ronak-create merged 3 commits into
ronak-create:mainfrom
PlkMarudny:project-folders
Jul 27, 2026
Merged

ronak-create merged 3 commits into
ronak-create:mainfrom
PlkMarudny:project-folders

Conversation

@PlkMarudny

@PlkMarudny PlkMarudny commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

image

This is a convenience feature so far. Folders are supported in the Project tab. Right-click on 'Project' and the 'New folder' context menu appears. Items can be drag and drop between folders. In-place folder rename is supported. A folder can be deleted without losing the items inside. A number of items in the folder is displayed.

The future idea is to have a number of "Library" items used frequently; grouped in folders, can be fetched into a project.

Type of change

  • Bug fix
  • New feature (human helper/API)
  • Docs
  • Refactor / internal

How was it verified?

  • node --check server.js && node --check app.js && node --check mcp-server.js passes
  • Opened the editor and confirmed the change in preview
  • Confirmed the change in an export (fast or realtime), if it affects rendering
  • Updated CLAUDE.md / README.md if the schema, props, or API changed

Checklist

  • No new runtime dependencies added
  • Preview and export render identically (single compositor)
  • Commits are focused and messages are descriptive

Summary by CodeRabbit

  • New Features
    • Added Project-bin folder trees with expand/collapse, nesting via drag-and-drop, and a dedicated “drop to root” target.
    • Create and rename folders from the Project tab (right-click and inline rename).
    • Import files into a selected folder and move media between folders via drag-and-drop.
  • Bug Fixes
    • Improved project sync to validate folder references for media entries.
  • Documentation
    • Updated the schema example and described Project-bin folder capabilities.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aa866322-6070-4a30-b016-3b7501fa202f

📥 Commits

Reviewing files that changed from the base of the PR and between 774f57c and dc093bc.

📒 Files selected for processing (5)
  • CLAUDE.md
  • README.md
  • app.js
  • index.html
  • style.css

📝 Walkthrough

Walkthrough

The project model now stores nested virtual folders and media folder references. Folder management, persistence, folder-targeted imports, recursive rendering, drag-and-drop behavior, context-menu creation, styling, and documentation were added.

Changes

Project bin folders

Layer / File(s) Summary
Folder data model and persistence
app.js, CLAUDE.md
Projects normalize and serialize folder hierarchies and media folderId values; folder mutations and null defaults for new media are supported.
Folder bin interactions
app.js, index.html, style.css, README.md
The Project tab renders recursive folders, supports folder-targeted imports and drag-and-drop moves, adds right-click folder creation, and documents and styles the new controls.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant ProjectTab
  participant renderBin
  participant importFiles
  User->>ProjectTab: Drop files on a folder
  ProjectTab->>renderBin: Set importFolderId
  renderBin->>importFiles: Import files for selected folder
  importFiles->>ProjectTab: Render media in folder
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding folders to the Project tab with drag-and-drop and inline rename support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app.js (1)

404-418: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Folder mutations bypass the undo stack while media deletion doesn't.

deleteFolder is destructive (it also removes every descendant folder) yet, unlike the media .bin-del handler which calls pushUndo() before mutating (renderBin around Line 791-797), none of addFolder/deleteFolder/moveMediaToFolder/moveFolderToParent snapshot undo state. A mis-drop or accidental delete of a nested folder tree is unrecoverable. Consider calling pushUndo() at the start of the mutating folder operations for parity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app.js` around lines 404 - 418, Update addFolder, deleteFolder,
moveMediaToFolder, and moveFolderToParent to call pushUndo() before changing
project state, matching the existing media deletion undo behavior. For
deleteFolder, snapshot before removing the folder tree or reparenting its media;
avoid recording an undo state for invalid or no-op requests if the operation
returns without mutation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app.js`:
- Around line 770-776: Replace user-controlled interpolations in both renderBin
templates: at app.js lines 770-776, build an empty .bin-name, assign m.name
through textContent and title, and set thumbSrc through style.backgroundImage;
at app.js lines 809-815, build an empty .bin-folder-name and assign f.name
through textContent and title. Preserve the existing rendering and metadata
behavior without inserting names into innerHTML.

---

Nitpick comments:
In `@app.js`:
- Around line 404-418: Update addFolder, deleteFolder, moveMediaToFolder, and
moveFolderToParent to call pushUndo() before changing project state, matching
the existing media deletion undo behavior. For deleteFolder, snapshot before
removing the folder tree or reparenting its media; avoid recording an undo state
for invalid or no-op requests if the operation returns without mutation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e52be85-08cc-46c0-9169-334a65661c48

📥 Commits

Reviewing files that changed from the base of the PR and between d0780a5 and 774f57c.

📒 Files selected for processing (5)
  • CLAUDE.md
  • README.md
  • app.js
  • index.html
  • style.css

Comment thread app.js Resolved
@ronak-create
ronak-create merged commit aa3e0e9 into ronak-create:main Jul 27, 2026
1 check 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