Add custom folder coloring#1304
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughFileSystemDock now supports preset and custom folder colors, persists direct ChangesFolder Color Support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant FileSystemDock
participant ColorPicker
participant ProjectSettings
User->>FileSystemDock: Choose Custom folder color
FileSystemDock->>ColorPicker: Open picker for selected folders
User->>ColorPicker: Select and confirm color
ColorPicker->>FileSystemDock: Return Color value
FileSystemDock->>ProjectSettings: Persist folder color assignments
FileSystemDock->>FileSystemDock: Refresh folder color rendering
🚥 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
editor/docks/filesystem_dock.cpp (2)
3298-3313: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winCheck for
NILinstead ofp_colortruthiness
Variant::booleanize()treatsColor(0, 0, 0, 1)as false, so a user-picked pure black folder color gets erased instead of stored. Use a type check here rather thanif (p_color).🤖 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 `@editor/docks/filesystem_dock.cpp` around lines 3298 - 3313, The folder-color assignment in FileSystemDock::_set_folder_color must distinguish an absent color from a valid black Color value. Replace the truthiness check on p_color with a Variant type check for a Color, storing valid colors and erasing the folder entry only when p_color is NIL.
1074-1118: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winHandle direct
Colorfolder assignments here.assigned_folder_colorscan hold preset names orColorvalues, but this lookup still treats every value as a preset key. Direct colors will miss the preset map, render inherited colors incorrectly, and can insert a stray entry intofolder_colors.editor/docks/filesystem_dock.cpp:1084🤖 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 `@editor/docks/filesystem_dock.cpp` around lines 1074 - 1118, The folder color inheritance lookup in the directory scan must support both preset-name and direct Color values in assigned_folder_colors. Update the inheritance logic near the color_scan_dir loop to inspect the stored Variant, resolving string values through folder_colors while using Color values directly, without indexing folder_colors for non-string assignments or creating stray entries.
🤖 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.
Outside diff comments:
In `@editor/docks/filesystem_dock.cpp`:
- Around line 3298-3313: The folder-color assignment in
FileSystemDock::_set_folder_color must distinguish an absent color from a valid
black Color value. Replace the truthiness check on p_color with a Variant type
check for a Color, storing valid colors and erasing the folder entry only when
p_color is NIL.
- Around line 1074-1118: The folder color inheritance lookup in the directory
scan must support both preset-name and direct Color values in
assigned_folder_colors. Update the inheritance logic near the color_scan_dir
loop to inspect the stored Variant, resolving string values through
folder_colors while using Color values directly, without indexing folder_colors
for non-string assignments or creating stray entries.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 63fbc569-a3ba-429e-b954-fdd3cd09b763
⛔ Files ignored due to path filters (1)
editor/icons/FolderQuestion.svgis excluded by!**/*.svg
📒 Files selected for processing (2)
editor/docks/filesystem_dock.cppeditor/docks/filesystem_dock.h
Co-authored-by: memmoxt <109536933+memmoxt@users.noreply.github.com>
This adds in an option to set custom folder colors in the filesystem as suggested by @TheAenema
SVG courtesy of @memmoxt
Summary by CodeRabbit
New Features
Bug Fixes