Skip to content

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

Open
PlkMarudny wants to merge 2 commits into
ronak-create:mainfrom
PlkMarudny:project-folders
Open

feat: add folders in Project tab; d'n'd, in-place rename#38
PlkMarudny wants to merge 2 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 folders with expandable hierarchies.
    • Create folders from the Project tab context menu and rename them inline.
    • Drag and drop folders to organize them into nested structures.
    • Import files directly into selected folders.
    • Move media between folders with drag and drop.
    • Updated Project tab tooltip to indicate the new folder option.
  • Documentation
    • Documented Project bin folder functionality and updated the project schema example.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PlkMarudny, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a1975a65-30a5-4cea-9d36-1b7b21065213

📥 Commits

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

📒 Files selected for processing (1)
  • app.js
📝 Walkthrough

Walkthrough

The project model now stores nested virtual folders and media folder references. Folder creation, deletion, renaming, moving, folder-targeted imports, persistence, 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 now normalize and serialize folder hierarchies, media folderId values, and folder mutations; newly created media defaults to folderId: null.
Folder bin interactions
app.js, index.html, style.css, README.md
The Project tab renders recursive folders, supports drag-and-drop moves and folder-targeted imports, 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

Suggested reviewers: xusnitdinov

🚥 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
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