Repository navigation
feat: add folders in Project tab; d'n'd, in-place rename - #38
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe 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. 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
Possibly related PRs
🚥 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
# Conflicts: # CLAUDE.md # README.md # app.js # style.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