-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add expand/collapse UI for reactions #1249
Conversation
- Adds a CollapsibleFlowLayout for controlling the layout - Adds tests for this layout and some mocks for testing layouts generally - Improves the rendering of the reaction buttons which were not pixel perfect - Adds the UI for the expand collapse buttons including the count of hidden items in the collapsed state.
Generated by 🚫 Danger Swift against aa7cabd |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #1249 +/- ##
===========================================
+ Coverage 39.96% 40.27% +0.31%
===========================================
Files 428 429 +1
Lines 27244 27392 +148
Branches 14043 14096 +53
===========================================
+ Hits 10887 11032 +145
- Misses 16064 16065 +1
- Partials 293 295 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There is a large enough amount of logic in this and layouts can be tricky, so probably worth waiting to merge this until after the release. |
Moving back to draft as it's not ready, noticed a couple of things. Happy to receive any early feedback thought :) |
- Remove SwiftUI-Flow - Add strings by importing from Localyse - Remove count on expand button as requires GeometryReader and can cause loops - Don't use GeometryReader for hiding reactions with opacity(just put them way off screen for now) - Fix unit and UI tests
…into langleyd/reactions_expand_collapse
…into langleyd/reactions_expand_collapse
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.
So great, really appreciate the level of documentation in this code, and tests for Layout
are :chefs-kiss:
ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleFlowLayout.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Screens/RoomScreen/View/Supplementary/TimelineReactionsView.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Screens/RoomScreen/View/Supplementary/TimelineReactionsView.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Screens/RoomScreen/View/Supplementary/TimelineReactionsView.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleFlowLayout.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleFlowLayout.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleFlowLayout.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleFlowLayout.swift
Outdated
Show resolved
Hide resolved
ElementX/Sources/Other/CollapsibleFlowLayout/CollapsibleFlowLayout.swift
Show resolved
Hide resolved
- use synthesized inits - use rows rather than lines for naming flow layout - other naming improvements - reactions were already rendered in another ui test, removing my test on favour of those and updating the screenshots for those.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What's in this PR
Improves the rendering of the reaction buttons which were not pixel perfectAlready done on develop.including the count of hidden items in the collapsed state.I removed the count of items on the collapse button as it required watching the the frames with GeometryReader which can cause infinite loops. As you need:
The custom layout api was introduced to avoid this kind of use of GeometryReader as apple detail here at WWDC. I encountered the loops when testing so I think it's probably best to keep things simple/reliable.
What it looks like
Todo
SwiftUI-Flow
)