BLOG-166 Fix image rendering on post preview #174
Reference in New Issue
Block a user
Delete Branch "BLOG-166_fix_image_preview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
w-full,h-full, andobject-coverPackage Changes
Screenshots
Reference
Resolves #166.
Checklist
/improve
PR Code Suggestions ✨
Stricter URL validation for image previews
The
z.url()schema allows for any URL scheme. For apreview_image_url, it istypically expected to be an HTTP or HTTPS URL. Consider using
z.httpUrl()forstricter validation to ensure only web-accessible image URLs are accepted,
preventing potential issues with unsupported schemes.
frontend/src/lib/post/adapter/gateway/postInfoResponseDto.ts [10]
Suggestion importance[1-10]: 7
__
Why: The suggestion to use
z.httpUrl()instead ofz.url()provides stricter validation, ensuring thatpreview_image_urlis a web-accessible URL. This improves data integrity, even though the PR changed it fromz.httpUrl()toz.url().Remove debug logging from production code
The
console.logstatement is likely for debugging purposes. It should be removedbefore merging to production to prevent exposing internal validation details to
end-users and to keep the browser console clean.
frontend/src/lib/post/framework/ui/EditPostDialog.svelte [93]
Suggestion importance[1-10]: 6
__
Why: Removing
console.logstatements before merging to production is a good practice to prevent exposing internal details and keep the console clean. This improves code quality and maintainability.BLOG-166_fix_image_previewto BLOG-166 Fix image rendering on post previewAddressed in
14d57daffc.