Add expand/collapse UI for reactions (#1249)

* Add expand/collapse UI for reactions

- 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.

* Add comment for reactionsCollapsed binding.

* Remove Flow and simplify implementation

- 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

* Address PR comments

- 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.
This commit is contained in:
David Langley
2023-07-10 16:13:58 +01:00
committed by GitHub
parent c453cc0680
commit 2cec1858ff
29 changed files with 610 additions and 143 deletions
-6
View File
@@ -161,12 +161,6 @@ class RoomScreenUITests: XCTestCase {
try await app.assertScreenshot(.roomSmallTimelineWithReadReceipts)
}
func testTimelineReactions() async throws {
let app = Application.launch(.roomSmallTimelineWithReactions)
try await app.assertScreenshot(.roomSmallTimelineWithReactions)
}
// MARK: - Helper Methods
private func performOperation(_ operation: UITestsSignal, using client: UITestsSignalling.Client) async throws {
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:88d2c242919c115dc9cf1fdedc2e8fce72b8b744430d98174c7c7d87525b117d
size 250731
oid sha256:2536457833f1e02d6526f3cce18bfd89629f715cb28266bbc4c2c4117ea65caa
size 292394
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7d2280697193c1ce77a7c1fbcae22e0dc745f8a1fa1b29e809ca0685b1a3daba
size 250495
oid sha256:4f8ff0d944bce8228a6c656d0a4e694be4262237c956545eb02bf4ccefd99524
size 292274
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b129972c4051695fe66991ce4d73f5fab08974598eb45c484affbb1b5899784
size 249350
oid sha256:d1dddcb5b5b2c22c08494e9f1d009a3d96f25049acd1ce39ce6c40681fb59bee
size 290746
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2adbb2c8a1131cbead5a3dd54ab03edda7f3b7ad3563978a944816b1cb60ac3d
size 362015
oid sha256:53bb76fe68c4191683679d2640447f1197ca332c9f6d54baaece8892da4d6e65
size 374657
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7342a00c360a31e37efce90162884b1337e5996c82d1d8d5b5b4c6ee99652c77
size 361539
oid sha256:295992c13e2831693a810b7034c1ab41cb81f969de802a238e691599f4718950
size 374348
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a11b4cf742ea5e6b2a6074d0cdfa7691f7da8b2bbe1a4a7926a240171f76312f
size 359297
oid sha256:02088ebf095f90a47b5690d08877e19bb3f9ff34685b3401b6d575a51d87d4dd
size 372218
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3e2be6670a34a788dc1e61d16ed27475c4994c9a1c56b4ffd80a6222faf901c5
size 251812
oid sha256:c15292dae68fb8d0680fe6dcffba981801016df4e5601a9cb0bcca5748bc7fd9
size 293483
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a6c85164fbf45e58fdaa664e6438347931459b7cc5406e3fc4234dcf764cafea
size 251570
oid sha256:40cf545f40203e7e77231aa44cf43756f00f9a0860c1260b7db13d4a69b6399b
size 293363
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f36517e412982bbc83f4b7d1f460fd60667b0d2a1d776e39ebc7da9baa7cd93f
size 250438
oid sha256:cb4e61ee05553aaa73b68656bac3f80538c8bba55d32c3de133a5c1fe8472d39
size 291849
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:efc0147b8245abce5d881b9605882b115002c54f9d7d165cb5e6431fea18c938
size 362606
oid sha256:cd9b2eca15f4756abb3865f7488de286ce8e210e61c0e15ac2aa3f1899246964
size 367914
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2925f0c4a1210948c9b863cb861026041d60afb24b593f15cdf9d82e9628c841
size 362130
oid sha256:277ffaa4c038e5e41e0092190c045ce886a757ff6fc478feec7c0ee2c8c5282b
size 367605
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dbf860ed8cb7cee2d0e4b45e9817aafb9c414e1e846b9d3d9e87b6098894ba2d
size 359888
oid sha256:6b4f4f40e06cf45694cf98764839abb285ea474588387985a6caffb15aa604d0
size 365475