Conversation
This comment has been minimized.
This comment has been minimized.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused image-preparation bug fix that replaces blocking canvas/base64 work with asynchronous Blob-based processing while preserving existing attachment and stash interfaces. Its production impact is confined to the existing image utility, with targeted coverage for browser canvas modes, size boundaries, and pass-through behavior. You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughImage encoding now produces blobs and estimates data-URL length from blob metadata. Thumbnail and stash paths convert blobs to data URLs where needed. Byte-limited compression creates files directly from encoded blobs. Tests cover canvas encoding and stash compression outcomes. ChangesImage Encoding and Compression
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The reviewed image-preparation changes have no established merge-blocking issue; proceed with normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What Changed
Keep image encodings as
Blobs until the caller needs a data URL orFile. Use asynchronous canvas blob encoding andFileReaderin place of synchronoustoDataURLand JavaScript base64 conversion. Check size budgets from blob bytes before reading the output. This PR contains only the image-preparation change split from #13261.Why
Preparing a large pasted image could block the web UI during canvas conversion and base64 work. The new path removes those synchronous conversions and avoids reading oversized source bytes before compression. Small images keep their original bytes.
Verification
ChatView.logic.ts,imageCompression.ts, and its focused test file.Checklist
Model: GPT-6. Harness: Codex.
Summary by CodeRabbit