Skip to content

Conversation

@kswenson
Copy link
Member

@kswenson kswenson commented Jan 15, 2026

[CODAP-1074] Image tile serialization of dropped images is broken

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 82.66667% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.76%. Comparing base (6bd01be) to head (7539011).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
v3/src/hooks/use-import-helpers.ts 11.11% 8 Missing ⚠️
v3/src/utilities/image-utils.ts 90.19% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2295      +/-   ##
==========================================
+ Coverage   86.75%   86.76%   +0.01%     
==========================================
  Files         724      724              
  Lines       38741    38810      +69     
  Branches     9586     9595       +9     
==========================================
+ Hits        33608    33674      +66     
- Misses       4829     5127     +298     
+ Partials      304        9     -295     
Flag Coverage Δ
cypress 72.02% <1.35%> (-0.13%) ⬇️
jest 55.67% <82.66%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link

cypress bot commented Jan 15, 2026

codap-v3    Run #9573

Run Properties:  status check passed Passed #9573  •  git commit 7539011dde: chore: add Copilot-written test suite
Project codap-v3
Branch Review CODAP-1074-image-serialization
Run status status check passed Passed #9573
Run duration 08m 09s
Commit git commit 7539011dde: chore: add Copilot-written test suite
Committer Kirk Swenson
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
Tests that did not run due to a developer annotating a test with .skip  Pending 48
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 301
View all changes introduced in this branch ↗︎

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes image serialization by converting images to data URLs instead of using ephemeral object URLs, enabling proper persistence and export of image tiles.

Changes:

  • Adds utility functions to convert files to data URLs and downscale large images to prevent bloat
  • Updates image import to use data URLs with automatic downscaling to 512px max dimension
  • Ensures image tiles export correctly as DG.ImageComponentView type in v2 format

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
v3/src/utilities/importable-files.ts Adds stripExtensionFromFilename utility to extract clean filename for image titles
v3/src/utilities/importable-files.test.ts Tests for the new filename stripping utility
v3/src/utilities/image-utils.ts Adds fileToDataUrl and downscaleImageFile functions for image conversion and size optimization
v3/src/utilities/image-utils.test.ts Tests for data URL conversion and downscaling functions
v3/src/hooks/use-import-helpers.ts Updates image import to use data URLs instead of object URLs, adds filename as title
v3/src/components/web-view/web-view-registration.ts Fixes image export to use correct DG.ImageComponentView component type
v3/src/components/web-view/web-view-registration.test.ts Updates and adds tests for image tile export verification

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Base automatically changed from CODAP-223-image-sizing to main January 15, 2026 21:29
@kswenson kswenson marked this pull request as ready for review January 15, 2026 23:53
@kswenson kswenson requested a review from bfinzer January 15, 2026 23:53
Copy link
Contributor

@bfinzer bfinzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻LGTM
I'm going to write a new story describing the problem when running on MacOS26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants