Skip to content

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

Open
wants to merge 10 commits into
base: feat/upload-draft-image-preview-WPB-17604
Choose a base branch
from

Conversation

samwyndham
Copy link
Contributor

@samwyndham samwyndham commented Aug 8, 2025

TaskWPB-19266 [iOS] Generate thumbnail for image upload preview

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

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

Copy link

@Copilot 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 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 a ThumbnailGenerator 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

@samwyndham samwyndham changed the title feat/cells image thumbnails wpb 19266 feat: add thumbnails to wire cells upload previews - WPB-19266 Aug 8, 2025
Copy link
Contributor

github-actions bot commented Aug 8, 2025

Test Results

1 992 tests   1 965 ✅  2m 31s ⏱️
  326 suites     27 💤
    2 files        0 ❌

Results for commit 01bc21c.

@samwyndham samwyndham requested review from a team, netbe, johnxnguyen and jullianm and removed request for a team and netbe August 8, 2025 08:45
Copy link
Contributor

@jullianm jullianm left a 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)")
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants