Repository navigation
Conversation
📦 Bundle:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe widget selector parses image paths before constructing ChangesMedia preview URL handling
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Nested image previews now send the filename and subfolder separately. No merge-blocking issue was established; proceed with normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The fix uses an established media URL format and introduces no new endpoint. However, newly forwarded subfolder paths rely on server-side containment and access checks that could not be verified for the deployed service. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
🧰 Additional context used📚 Code guidelines (3)Comment |
0dc861b to
e59dd60
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
e59dd60 to
e7d585f
Compare
Summary
Fix broken thumbnails in the image combo dropdown for values containing subfolder paths (e.g.
subfolder/image.png).Supersedes #12438, which was closed due to branch drift — this branch is rebased onto current main and contains only the single focused commit.
Changes
getMediaUrlinuseWidgetSelectItems.tsnow uses the existingparseImageWidgetValueutility to split subfolder-prefixed filenames into separatefilenameandsubfolderquery parameters when constructing/api/viewURLs. Added a test case for nested subfolder paths.Review Focus
The
/api/viewendpoint callsos.path.basename(filename)on the filename param, stripping any embedded path components. It already supports a separatesubfolderquery parameter (andparseImageWidgetValuealready exists for exactly this split), butgetMediaUrlwasn't using it. Flat filenames are unaffected —parseImageWidgetValuereturns an empty subfolder string and no param is added.Fixes #12437
E2E test rationale: The fix modifies pure URL construction logic in getMediaUrl, which is fully validated by the added unit test. An E2E regression test would require a backend serving images from nested subfolders to verify thumbnail rendering, making it fragile and environment-dependent. The unit test directly asserts the correct filename and subfolder query parameter splitting, which is the root cause of the bug.