Skip to content

fix: Fix image preview for Windows paths in playground #12083

Merged
Cristhianzl merged 4 commits into
mainfrom
cz/fix-win-img
Mar 10, 2026
Merged

fix: Fix image preview for Windows paths in playground #12083
Cristhianzl merged 4 commits into
mainfrom
cz/fix-win-img

Conversation

@Cristhianzl
Copy link
Copy Markdown
Member

OBJECTIVE: Fix image files sent from Windows not displaying in the playground chat by normalizing backslash paths to forward slashes across all file utility functions.

CHANGES:

  • Normalize Windows backslash paths (\) to forward slashes (/) in isImageFile, getFileDisplayName, getFilePreviewUrl, and
    extractFileInfo
  • Simplify FilePreviewDisplay by removing manual blob fetch logic and using direct image URLs with crossOrigin="use-credentials"
  • Add crossOrigin="use-credentials" to FileCard image element for consistent auth handling
  • Add comprehensive unit tests for all file utility functions covering Windows paths, Unix paths, and cross-platform scenarios

@Cristhianzl Cristhianzl self-assigned this Mar 6, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 6, 2026

Caution

Review failed

The head commit changed during the review from d953ca2 to 017ebc5.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cz/fix-win-img

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the bug Something isn't working label Mar 6, 2026
@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Mar 6, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 41.66667% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.63%. Comparing base (4fa9cd3) to head (5e2c1f8).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...Component/chat-view/utils/file-preview-display.tsx 0.00% 7 Missing and 4 partials ⚠️
.../playgroundComponent/chat-view/utils/file-utils.ts 76.92% 0 Missing and 3 partials ⚠️

❌ Your project status has failed because the head coverage (42.83%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12083      +/-   ##
==========================================
+ Coverage   37.60%   37.63%   +0.03%     
==========================================
  Files        1623     1623              
  Lines       79603    79583      -20     
  Branches    11971    11964       -7     
==========================================
+ Hits        29932    29950      +18     
+ Misses      48014    47980      -34     
+ Partials     1657     1653       -4     
Flag Coverage Δ
backend 57.03% <ø> (-0.05%) ⬇️
frontend 20.93% <41.66%> (+0.11%) ⬆️
lfx 42.83% <ø> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
...ts/chatView/fileComponent/components/file-card.tsx 0.00% <ø> (ø)
.../playgroundComponent/chat-view/utils/file-utils.ts 85.71% <76.92%> (+67.25%) ⬆️
...Component/chat-view/utils/file-preview-display.tsx 42.50% <0.00%> (-2.12%) ⬇️

... and 16 files with indirect coverage changes

🚀 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.

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Mar 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 23%
23.31% (8254/35409) 16.16% (4494/27796) 15.92% (1185/7442)

Unit Test Results

Tests Skipped Failures Errors Time
2692 0 💤 0 ❌ 0 🔥 43.168s ⏱️

@Cristhianzl Cristhianzl added this pull request to the merge queue Mar 10, 2026
@Cristhianzl Cristhianzl removed this pull request from the merge queue due to a manual request Mar 10, 2026
@Cristhianzl Cristhianzl added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 9ce2b89 Mar 10, 2026
91 of 92 checks passed
@Cristhianzl Cristhianzl deleted the cz/fix-win-img branch March 10, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants