Skip to content

feat: refine UI for uploading wire cells assets - WPB-17604 #3428

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 30 commits into
base: develop
Choose a base branch
from

Conversation

samwyndham
Copy link
Contributor

@samwyndham samwyndham commented Aug 5, 2025

TaskWPB-17604 [iOS] Make message editing files carousel design complete

Issue

This PR refines the UI previews that are shown when uploading assets. Previously only placeholder boxes were shown.

ScreenRecording_08-05-2025.17-00-40_1.mov

Specifically it:

  • Replaces old previews (that became of date and weren't used) with new ones matching current designs. E.g. UploadDocumentPreview has been replaced with WireCellsImageAttachmentPreview. The naming convention has changed because this same type will likely also be used elsewhere, not just for uploads. See the snapshots prefixed WireCells* to understand how these previews look.
  • Update AttachmentsCarousel.swift to have correct styling and to make use of the above previews.
  • Adds lots of file icon assets that are used in document previews and will be used elsewhere. Also adds code for determining which file icon to use based on UTType and a files extension.
  • Deleted a bunch of code that is no longer needed (because of design changes)

Additionally this PR moves channel history related tests to a correct location.They had accidentally been left in a dead folder and were not part of any test target.

My apologies for the size of this PR.

Testing

Play around with the swift UI previews in AttachmentsCarousel.swift


Checklist

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

# Conflicts:
#	WireCells/Tests/WireCellsUITests/Components/Previews/WireCellsImageAttachmentPreviewTests.swift
#	WireCells/Tests/WireCellsUITests/Components/UploadPreviews/UploadDocumentPreviewTests.swift
#	WireDebug/Sources/WireViewsDebugUI/WireCellsUIDebugView.swift
#	WireMessaging/Sources/WireMessagingUI/WireCells/Components/CircularIconButtonStyle.swift
#	WireMessaging/Sources/WireMessagingUI/WireCells/Components/DeleteItemButtonViewModifier.swift
#	WireMessaging/Sources/WireMessagingUI/WireCells/Components/LocalImagePreview.swift
#	WireMessaging/Sources/WireMessagingUI/WireCells/Components/UploadPreviews/UploadDocumentPreview.swift
#	WireMessaging/Sources/WireMessagingUI/WireCells/Components/UploadPreviews/UploadImagePreview.swift
#	WireMessaging/Sources/WireMessagingUI/WireCells/Components/UploadPreviews/UploadVideoPreview.swift
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testColorSchemeVariantsEmptyState.dark.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testColorSchemeVariantsEmptyState.light.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.accessibility1.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.accessibility2.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.accessibility3.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.accessibility4.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.accessibility5.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.large.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.medium.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.small.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.xLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.xSmall.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.xxLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadDocumentPreviewTests/testDynamicTypeVariantsEmptyState.xxxLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testColorSchemeVariantsEmptyState.dark.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testColorSchemeVariantsEmptyState.light.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.accessibility1.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.accessibility2.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.accessibility3.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.accessibility4.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.accessibility5.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.large.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.medium.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.small.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.xLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.xSmall.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.xxLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadImagePreviewTests/testDynamicTypeVariantsEmptyState.xxxLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testColorSchemeVariantsEmptyState.dark.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testColorSchemeVariantsEmptyState.light.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDurationFormatVariantsEmptyState.long-duration.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDurationFormatVariantsEmptyState.short-duration.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.accessibility1.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.accessibility2.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.accessibility3.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.accessibility4.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.accessibility5.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.large.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.medium.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.small.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.xLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.xSmall.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.xxLarge.png
#	WireMessaging/Tests/WireMessagingTests/Resources/ReferenceImages/UploadVideoPreviewTests/testDynamicTypeVariantsEmptyState.xxxLarge.png
#	WireMessaging/Tests/WireMessagingTests/WireCells/UITests/Components/UploadPreviews/UploadDocumentPreviewTests.swift
#	WireMessaging/Tests/WireMessagingTests/WireCells/UITests/Components/UploadPreviews/UploadImagePreviewTests.swift
#	WireMessaging/Tests/WireMessagingTests/WireCells/UITests/Components/UploadPreviews/UploadVideoPreviewTests.swift
Currently they are not in a target and not running
@samwyndham samwyndham requested a review from Copilot August 5, 2025 14:23
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 refines the UI for uploading wire cells assets by replacing placeholder boxes with actual preview components for different file types. The changes improve the user experience by providing meaningful visual previews instead of generic placeholders.

  • Replaces generic placeholder preview components with specific attachment preview components for images, videos, and documents
  • Updates the attachments container height to accommodate the refined UI components
  • Adds comprehensive test coverage with snapshot tests for various configuration states

Reviewed Changes

Copilot reviewed 118 out of 157 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
InputBar.swift Increases attachment container height from 74 to 82 pixels
ConversationInputBarViewController.swift Adds WireFoundation import and environment configuration
ColorTheme.swift Makes secondary button color properties public for component access
Multiple test files Removes old placeholder test files and adds new component-specific tests
Preview components Replaces upload preview components with wire cells attachment preview components
AttachmentsCarousel.swift Updates carousel to use new preview components with proper styling
FileIcon.swift Adds file type icon mapping functionality
Resource files Adds file icon assets and reference images for snapshot tests

} else if value.conforms(to: .audio) {
self = .audio(samples: [])
self = .video(thumbnail: nil) // FIXME: [WPB-19267] Set video thumbnail data
} else if value.conforms(to: .audio, ) {
Copy link
Preview

Copilot AI Aug 5, 2025

Choose a reason for hiding this comment

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

There is an extra comma after .audio which will cause a compilation error. Remove the trailing comma.

Suggested change
} else if value.conforms(to: .audio, ) {
} else if value.conforms(to: .audio) {

Copilot uses AI. Check for mistakes.

Copy link
Contributor

github-actions bot commented Aug 5, 2025

Test Results

2 116 tests   2 088 ✅  3m 8s ⏱️
  365 suites     28 💤
    3 files        0 ❌

Results for commit adcd6d7.

@samwyndham samwyndham requested review from jullianm, a team and caldrian and removed request for a team August 5, 2025 15:22
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.

1 participant