Skip to content
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

Custom media gallery views for files and voice messages #3610

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

stefanceriu
Copy link
Member

@stefanceriu stefanceriu commented Dec 12, 2024

This PR extracts the timeline item backgrounds from the BubbledStyler and into its own modifier so that it can be reused for the media gallery views.
It also introduces different views for the files, audios and voice messages making use of the above.

Screenshot 2024-12-12 at 15 28 52

@stefanceriu stefanceriu added the pr-wip for anything that isn't ready to ship and will be enabled at a later date label Dec 12, 2024
@stefanceriu stefanceriu requested a review from a team as a code owner December 12, 2024 14:03
@stefanceriu stefanceriu requested review from Velin92 and removed request for a team December 12, 2024 14:03
Copy link

github-actions bot commented Dec 12, 2024

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against 23845ac

Copy link

codecov bot commented Dec 12, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
887 1 886 0
View the full list of 1 ❄️ flaky tests
PreviewTests test_userProfileScreen()

Flake rate in main: 12.14% (Passed 152 times, Failed 21 times)

Stack Traces | 2.79s run time
failed - Snapshot "Verified User" does not match reference.

@−
"file:.../__Snapshots__/PreviewTests/test_userProfileScreen-iPhone-16-pseudo.Verified-User.png"
@+
"file:.../tmp/PreviewTests/test_userProfileScreen-iPhone-16-pseudo.Verified-User.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
      // ...
    }

The percentage of pixels that match 0.892395 is less than required 1.0
The lowest perceptual color precision 0.31062502 is less than required 0.98 (PreviewTests/Sources/PreviewTests.swift:84)

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@stefanceriu stefanceriu force-pushed the stefan/mediaGallery-part4 branch from 4e0de2a to 23845ac Compare December 12, 2024 15:15
Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

👌

private struct TimelineItemBubbleBackgroundModifier: ViewModifier {
@Environment(\.timelineGroupStyle) private var timelineGroupStyle

let timelineItem: EventBasedTimelineItemProtocol
Copy link
Member

Choose a reason for hiding this comment

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

From the perspective of using this for previews, if we passed in the isOutgoing boolean instead of the whole timeline item here, we could use this modifier in places like SwipeRightAction_Previews, LongPressWithFeedback_Previews and FormattedBodyText_Previews and get rid of those made up ones.

@stefanceriu stefanceriu merged commit 256ae4d into develop Dec 12, 2024
13 checks passed
@stefanceriu stefanceriu deleted the stefan/mediaGallery-part4 branch December 12, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-wip for anything that isn't ready to ship and will be enabled at a later date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants