diff --git a/DesignKit/Package.swift b/DesignKit/Package.swift index 77560275b..8d95072b6 100644 --- a/DesignKit/Package.swift +++ b/DesignKit/Package.swift @@ -12,7 +12,7 @@ let package = Package( .library(name: "DesignKit", targets: ["DesignKit"]) ], dependencies: [ - .package(url: "https://github.com/vector-im/compound-ios", revision: "71b0c887880de639c854600a9ada6b5bcc93c719"), + .package(url: "https://github.com/vector-im/compound-ios", revision: "cbb4e9edbc6489e883b67d1016eb90705e998ba5"), .package(url: "https://github.com/vector-im/element-design-tokens", exact: "0.0.3"), .package(url: "https://github.com/siteline/SwiftUI-Introspect", from: "0.9.0") ], diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index b0fd012f9..f350b3225 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -5617,7 +5617,7 @@ repositoryURL = "https://github.com/vector-im/compound-ios"; requirement = { kind = revision; - revision = 71b0c887880de639c854600a9ada6b5bcc93c719; + revision = cbb4e9edbc6489e883b67d1016eb90705e998ba5; }; }; 9A472EE0218FE7DCF5283429 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2666fd58d..da7c4b8ea 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -13,7 +13,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/vector-im/compound-ios", "state" : { - "revision" : "71b0c887880de639c854600a9ada6b5bcc93c719" + "revision" : "cbb4e9edbc6489e883b67d1016eb90705e998ba5" } }, { diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 7fa842a03..4de45b6ac 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -96,7 +96,6 @@ "common_password" = "Password"; "common_people" = "People"; "common_permalink" = "Permalink"; -"common_poll_final_votes" = "Final votes: %1$@"; "common_poll_total_votes" = "Total votes: %1$@"; "common_poll_undisclosed_text" = "Results will show after the poll has ended"; "common_privacy_policy" = "Privacy policy"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index e4d1a3777..ecc03f9cd 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -214,10 +214,6 @@ public enum L10n { public static var commonPeople: String { return L10n.tr("Localizable", "common_people") } /// Permalink public static var commonPermalink: String { return L10n.tr("Localizable", "common_permalink") } - /// Final votes: %1$@ - public static func commonPollFinalVotes(_ p1: Any) -> String { - return L10n.tr("Localizable", "common_poll_final_votes", String(describing: p1)) - } /// Total votes: %1$@ public static func commonPollTotalVotes(_ p1: Any) -> String { return L10n.tr("Localizable", "common_poll_total_votes", String(describing: p1)) diff --git a/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollOptionView.swift b/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollOptionView.swift index 0a19525f9..096fba371 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollOptionView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollOptionView.swift @@ -40,17 +40,13 @@ struct PollOptionView: View { } } - progressView + PollProgressView(progress: progress) } } } // MARK: - Private - private var progressView: some View { - PollProgressView(progress: progress) - } - private var progress: Double { switch (showVotes, pollOption.allVotes, pollOption.isSelected) { case (true, let allVotes, _) where allVotes > 0: @@ -74,7 +70,7 @@ private struct PollProgressView: View { GeometryReader { geometry in ZStack(alignment: .leading) { Capsule() - .foregroundColor(.compound.borderDisabled) + .foregroundColor(.compound._bgEmptyItemAlpha) Capsule() .frame(maxWidth: progress * geometry.size.width) diff --git a/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift b/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift index 1837d6b5d..7628e7f9c 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift @@ -23,6 +23,8 @@ struct PollRoomTimelineView: View { @ScaledMetric private var summaryPadding = 32 @ScaledMetric private var iconSize = 22 + private let feedbackGenerator = UIImpactFeedbackGenerator(style: .heavy) + var body: some View { TimelineStyler(timelineItem: timelineItem) { VStack(alignment: .leading, spacing: 16) { @@ -30,8 +32,9 @@ struct PollRoomTimelineView: View { ForEach(poll.options, id: \.id) { option in Button { - guard let eventID else { return } + guard let eventID, !option.isSelected else { return } context.send(viewAction: .selectedPollOption(pollStartID: eventID, optionID: option.id)) + feedbackGenerator.impactOccurred() } label: { PollOptionView(pollOption: option, showVotes: showVotes, @@ -99,7 +102,7 @@ private extension Poll { var summaryText: String? { guard !hasEnded else { return options.first.map { - L10n.commonPollFinalVotes($0.allVotes) + L10n.commonPollTotalVotes($0.allVotes) } } diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithDisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithDisclosedPolls.png index 2bb710492..88915bfd4 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithDisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithDisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c85ea14e8c7399560a0e1cb808983a60e70431b8eee7c060515df8216b36790 -size 165644 +oid sha256:a540ae05fbea15546bcaed5b22ee582b94e83cc0408ed5a56dec25d56fbb3d4b +size 165586 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithUndisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithUndisclosedPolls.png index 791baffc2..72a6437dd 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithUndisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomWithUndisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:49703bc56ceb2c05edc04a3a963d22b109e64d644d6eff8f0d0c3bb9694d7177 -size 162836 +oid sha256:dc2a885aa81cd5679b42f4f8741a4b861d0f96571bbb9085fe16d051a8fba3b7 +size 162767 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithDisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithDisclosedPolls.png index 35b6f17ed..b2f24b376 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithDisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithDisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f28aa90c1921e4a6d47f12ea66a608f1f36e893b46951c9a7b17b7d242598d13 -size 256763 +oid sha256:9defbd1b672e4c28f7081357fb57584d6d7a7b619c72f306c07cfb78db6d82b6 +size 256536 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithUndisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithUndisclosedPolls.png index 0492b3355..47ac7881a 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithUndisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomWithUndisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7ce9878396fbdaae20932741b89c227f1534a5f7cb658f582839579b1802ff8b -size 253727 +oid sha256:c04e8a7f52844ff3408a8a83cf285a58f40bbdeef32a2fda0896bf993ff85c83 +size 253455 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithDisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithDisclosedPolls.png index 95c8c8e2b..825409fa4 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithDisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithDisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:854c4b00493f89988906fac51aa3bdc2a019779f5db335c0b0c8d5ffe596b980 -size 191462 +oid sha256:06701f44d87783df173d2a54f4df1119b8514865e4b17626c6a2eacdfd8efafd +size 191314 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithUndisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithUndisclosedPolls.png index 9540a5846..99ab5590a 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithUndisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomWithUndisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:959f3d9c3f866f5d9175a6a3a078d248a29d0003e5cbb23bf9a9c7750e9de6e7 -size 180430 +oid sha256:ceecae18977ab13a9d7cc0f56a26121021d38d97e3c544a56499d1b8885ebe13 +size 180169 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithDisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithDisclosedPolls.png index c274c26fd..4ec6a482b 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithDisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithDisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc48fc413d3647e3fe5ab461cf97e869767995a99be8b6d8fe3b8e1d72352449 -size 275889 +oid sha256:5363a709d79a849239fceb5d90ea456eb9d66dda3d25b4d89223d7e0c2b4baa0 +size 276181 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithUndisclosedPolls.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithUndisclosedPolls.png index c42b2d57c..661586fc3 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithUndisclosedPolls.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomWithUndisclosedPolls.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4673fc84f4630c58afd953338b0c5e9dfaf7dc17294bb4727148c6a30eac95c9 -size 268908 +oid sha256:5826907aa1fef35d8b051cde817117f494088d2aba909c2f4458edbcd2402d40 +size 269161 diff --git a/project.yml b/project.yml index f7781297d..ce04cbbd8 100644 --- a/project.yml +++ b/project.yml @@ -52,7 +52,7 @@ packages: path: DesignKit Compound: url: https://github.com/vector-im/compound-ios - revision: 71b0c887880de639c854600a9ada6b5bcc93c719 + revision: cbb4e9edbc6489e883b67d1016eb90705e998ba5 # path: ../compound-ios AnalyticsEvents: url: https://github.com/matrix-org/matrix-analytics-events