feat: add folders in Project tab; d'n'd, in-place rename#38
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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. 📝 WalkthroughWalkthroughThe 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. ChangesProject bin folders
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
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app.js (1)
404-418: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winFolder mutations bypass the undo stack while media deletion doesn't.
deleteFolderis destructive (it also removes every descendant folder) yet, unlike the media.bin-delhandler which callspushUndo()before mutating (renderBinaround Line 791-797), none ofaddFolder/deleteFolder/moveMediaToFolder/moveFolderToParentsnapshot undo state. A mis-drop or accidental delete of a nested folder tree is unrecoverable. Consider callingpushUndo()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
📒 Files selected for processing (5)
CLAUDE.mdREADME.mdapp.jsindex.htmlstyle.css
What does this PR do?
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
How was it verified?
node --check server.js && node --check app.js && node --check mcp-server.jspassesCLAUDE.md/README.mdif the schema, props, or API changedChecklist
Summary by CodeRabbit