-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add thumbnails to wire cells upload previews - WPB-19266 #3440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/upload-draft-image-preview-WPB-17604
Are you sure you want to change the base?
feat: add thumbnails to wire cells upload previews - WPB-19266 #3440
Conversation
There was a problem hiding this 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 implements thumbnail generation for image and video assets in the Wire cells attachments carousel, replacing the placeholder nil
thumbnail values with actual generated thumbnails using QuickLook.
- Adds thumbnail generation capability to
AttachmentsCarouselViewModel
using aThumbnailGenerator
protocol - Updates the constructor to use dependency injection instead of hardcoded empty arrays
- Adds comprehensive unit tests for the thumbnail generation functionality
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
ConversationInputBarViewController.swift | Updates constructor call to use parameterless initializer |
AttachmentsCarouselViewModelTests.swift | Adds comprehensive unit tests for thumbnail generation scenarios |
WireCellsDraft+Fixture.swift | Extends test fixture to support file type and size parameters |
UIImage+Fixture.swift | Adds test fixture helper for creating UIImage instances |
AttachmentsCarouselViewModel.swift | Implements core thumbnail generation logic with caching and async generation |
AttachmentsCarouselItem.swift | Updates model to support Equatable/Sendable for testing and concurrency |
ThumbnailGenerator.swift | Defines protocol and QLThumbnailGenerator extension for thumbnail generation |
.../WireMessagingUI/WireCells/Components/AttachmentsCarousel/AttachmentsCarouselViewModel.swift
Outdated
Show resolved
Hide resolved
.../WireMessagingUI/WireCells/Components/AttachmentsCarousel/AttachmentsCarouselViewModel.swift
Outdated
Show resolved
Hide resolved
.../WireMessagingUI/WireCells/Components/AttachmentsCarousel/AttachmentsCarouselViewModel.swift
Outdated
Show resolved
Hide resolved
Test Results1 992 tests 1 965 ✅ 2m 31s ⏱️ Results for commit 01bc21c. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, left one question about thumbnail generation error handling on the UI side
thumbnails[draft.versionID] = thumbnail | ||
refreshItems() | ||
} catch { | ||
WireLogger.wireCells.error("Failed to generate thumbnail for file type: \(fileType.identifier)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: if we fail generating a thumbnail, what happens UI wise ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
The preview will keep showing an activity indicator. Now my assumption is that this is a very rare event which is why I haven't dealt with it specifically but I might be wrong.
Issue
This PR adds thumbnails to the previews when uploading assets to wire cells
ScreenRecording_08-08-2025.08-44-19_1.mov
Testing
Run unit tests
Checklist
[WPB-XXX]
.