From dee4189c9763966a49f3f51f43fee10cc242aeaf Mon Sep 17 00:00:00 2001 From: Luca Rospocher Date: Sat, 18 Jul 2026 17:53:26 +0200 Subject: [PATCH 1/2] feat: Temporary remove percentage until backend reports type in conversation list --- .../wire/apps/polls/dto/PollVoteCountProgress.kt | 13 +++++-------- .../apps/polls/services/StatsFormattingService.kt | 8 +++----- .../polls/services/StatsFormattingServiceTest.kt | 2 ++ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt b/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt index 25833d0..7691134 100644 --- a/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt +++ b/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt @@ -1,8 +1,5 @@ package com.wire.apps.polls.dto -import com.wire.apps.polls.services.VoteDisplay -import kotlin.math.roundToInt - data class PollVoteCountProgress( val totalVoteCount: Int, val totalMembers: Int @@ -16,12 +13,12 @@ data class PollVoteCountProgress( fun new(): String = initial().display() } + /** + * Percentage voting blocked until WPB-27239 is done + */ fun display(): String { - val percent = if (totalMembers > 0) totalVoteCount.toDouble() / totalMembers else 0.0 - val voteDisplay = VoteDisplay((percent * BLOCKS).roundToInt(), BLOCKS) - val percentDisplay = (percent * PERCENTAGE_FACTOR).roundToInt() - - return "$voteDisplay $percentDisplay%" + val progressString = (0 until totalVoteCount).joinToString("") { "🟢" } + return "$progressString ($totalVoteCount)" } fun everyoneVoted() = (totalVoteCount == totalMembers) diff --git a/src/main/kotlin/com/wire/apps/polls/services/StatsFormattingService.kt b/src/main/kotlin/com/wire/apps/polls/services/StatsFormattingService.kt index 5801eaa..ec475a1 100644 --- a/src/main/kotlin/com/wire/apps/polls/services/StatsFormattingService.kt +++ b/src/main/kotlin/com/wire/apps/polls/services/StatsFormattingService.kt @@ -5,7 +5,6 @@ import com.wire.apps.polls.dto.common.Text import io.github.oshai.kotlinlogging.KotlinLogging import pw.forst.katlib.newLine import pw.forst.katlib.whenNull -import kotlin.math.min class StatsFormattingService( private val repository: PollRepository @@ -71,6 +70,7 @@ class StatsFormattingService( * - ⬛⬛⬛ A (3) * - ⬜⬜⬜ B (1) */ + @Suppress("UnusedParameter") private fun formatVotes( stats: Map, Int>, conversationMembers: Int @@ -79,10 +79,8 @@ class StatsFormattingService( val mostPopularOptionVoteCount = requireNotNull(stats.values.maxOrNull()) { "There were no stats!" } - val maximumSize = min( - conversationMembers, - mostPopularOptionVoteCount + MAX_VOTE_PLACEHOLDER_COUNT - ) + // Percentage voting blocked until WPB-27239 is done + val maximumSize = mostPopularOptionVoteCount return stats .map { (option, votingUsers) -> diff --git a/src/test/kotlin/com/wire/apps/polls/services/StatsFormattingServiceTest.kt b/src/test/kotlin/com/wire/apps/polls/services/StatsFormattingServiceTest.kt index 332c8e5..f42ef03 100644 --- a/src/test/kotlin/com/wire/apps/polls/services/StatsFormattingServiceTest.kt +++ b/src/test/kotlin/com/wire/apps/polls/services/StatsFormattingServiceTest.kt @@ -21,7 +21,9 @@ import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource +import kotlin.test.Ignore +@Ignore("Percentage voting blocked until WPB-27239 is done") class StatsFormattingServiceTest { val pollRepository = mockk() From a9aa6ccac0ef49d849f92f3846a6536746e4599f Mon Sep 17 00:00:00 2001 From: Luca Rospocher Date: Mon, 20 Jul 2026 09:58:59 +0200 Subject: [PATCH 2/2] Remove dots from progress --- .../kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt b/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt index 7691134..a0938e0 100644 --- a/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt +++ b/src/main/kotlin/com/wire/apps/polls/dto/PollVoteCountProgress.kt @@ -16,10 +16,7 @@ data class PollVoteCountProgress( /** * Percentage voting blocked until WPB-27239 is done */ - fun display(): String { - val progressString = (0 until totalVoteCount).joinToString("") { "🟢" } - return "$progressString ($totalVoteCount)" - } + fun display(): String = "Total votes: $totalVoteCount" fun everyoneVoted() = (totalVoteCount == totalMembers) }