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

Media gallery #3588

Merged
merged 13 commits into from
Dec 6, 2024
Merged

Media gallery #3588

merged 13 commits into from
Dec 6, 2024

Conversation

stefanceriu
Copy link
Member

This PR contains the initial work done for the new Media Gallery feature which is very much still a work in progress. We've decided to merge it early under a feature flag in order to avoid later conflicts.

This screen is following a novel architecture where 2 different TimelineViewModels are composed together under the MediaEventsTimelineScreenViewModel to provide the 2 separate sections. They're powered by a new RustSDK API that allows filtering room messages based on their type (introduced in 4365)

We're doing this in order to reuse most of the timeline logic we already had in play for the room screen and pinned events timeline. The UI on the other hand is completely custom and only makes use of the TimelineViewStates and related models.

I haven't bothered with cleaning up the commits as I intend to squash all of it on merge and they still might prove useful to see the evolution.

What's not working:

  • only images and videos are supported, no separators, files, voice messages etc.
  • gifs don't animate (yet)
  • separators (even though not rendered) are still computed per day
  • there are no empty states
  • media cannot be enlarged once rendered in the grid
  • and most likely quite a few other things
Simulator.Screen.Recording.-.iPhone.16.-.2024-12-05.at.15.47.52.mp4

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

github-actions bot commented Dec 5, 2024

Warnings
⚠️ This pull request seems relatively large. Please consider splitting it into multiple smaller ones.
⚠️ 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 ad3f2c7

Copy link

codecov bot commented Dec 5, 2024

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
877 2 875 0
View the full list of 2 ❄️ flaky tests
PreviewTests test_userProfileScreen()

Flake rate in main: 19.30% (Passed 46 times, Failed 11 times)

Stack Traces | 2.13s 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)
PreviewTests test_roomMemberDetailsScreen()

Flake rate in main: 16.46% (Passed 66 times, Failed 13 times)

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

@−
"file:.../__Snapshots__/PreviewTests/test_roomMemberDetailsScreen-iPhone-16-en-GB.Verified-User.png"
@+
"file:.../tmp/PreviewTests/test_roomMemberDetailsScreen-iPhone-16-en-GB.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.848999 is less than required 1.0
The lowest perceptual color precision 0.0 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!

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.

Very nice, I like the composition of view models like that, seems reasonable that we should do the same and pass the timeline view model into the room screen view model too at some point. 😎

@pixlwave
Copy link
Member

pixlwave commented Dec 5, 2024

Oh yeah, we should probably figure out if that ordering makes sense too, but that doesn't need to block this PR.

@stefanceriu stefanceriu enabled auto-merge (squash) December 6, 2024 13:44
Copy link

sonarqubecloud bot commented Dec 6, 2024

@stefanceriu stefanceriu disabled auto-merge December 6, 2024 14:55
@stefanceriu stefanceriu merged commit caaa89a into develop Dec 6, 2024
13 checks passed
@stefanceriu stefanceriu deleted the stefan/mediaGallery branch December 6, 2024 14:58
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.

3 participants