Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
4706eca
feat: version history screen
ohassine Nov 26, 2025
a1bc8ef
feat: cleanup
ohassine Nov 26, 2025
857cdf0
feat: cleanup
ohassine Nov 26, 2025
4eefc69
Merge remote-tracking branch 'origin/develop' into fetch-node-versions
ohassine Nov 26, 2025
6c182d8
feat: fetch and display node versions
ohassine Nov 27, 2025
ce46c89
feat: fetch and display node versions
ohassine Nov 27, 2025
f4dd342
feat: unit test
ohassine Nov 27, 2025
92c5b49
feat: kalium
ohassine Nov 27, 2025
ea05b7a
Merge remote-tracking branch 'origin/develop' into fetch-and-display-…
ohassine Nov 27, 2025
c24e792
Merge remote-tracking branch 'origin/develop' into fetch-and-display-…
ohassine Nov 27, 2025
6883656
Merge remote-tracking branch 'origin/develop' into fetch-and-display-…
ohassine Nov 27, 2025
ef20c4c
feat: add feature flag
ohassine Nov 27, 2025
9e3644e
feat: add a TODO
ohassine Nov 27, 2025
794168d
Merge remote-tracking branch 'origin/develop' into fetch-and-display-…
ohassine Nov 27, 2025
db5d4bf
feat: cleanup
ohassine Nov 27, 2025
fec23eb
feat: cleanup
ohassine Nov 27, 2025
0e97c39
feat: cleanup
ohassine Nov 27, 2025
3471ce3
feat: detekt
ohassine Nov 28, 2025
03184d8
feat: kalium reference
ohassine Nov 28, 2025
6913bc2
Merge remote-tracking branch 'origin/develop' into fetch-and-display-…
ohassine Nov 28, 2025
2752835
feat: cleanup
ohassine Nov 28, 2025
357148b
feat: restore node version
ohassine Dec 2, 2025
303ec8f
feat: cleanup
ohassine Dec 3, 2025
5181f83
feat: add file name to top bar
ohassine Dec 3, 2025
3a07db6
feat: pull to refresh
ohassine Dec 3, 2025
4f7c981
feat: dismissOnClickOutside dialog
ohassine Dec 3, 2025
189915c
feat: download node version
ohassine Dec 4, 2025
8e715d1
Merge remote-tracking branch 'origin/develop' into download-version
ohassine Dec 4, 2025
41dbd05
feat: address comments
ohassine Dec 4, 2025
773f29d
Merge remote-tracking branch 'origin/develop' into fetch-and-display-…
ohassine Dec 4, 2025
18a3787
feat: conflicts
ohassine Dec 4, 2025
46de6bf
feat: kalium
ohassine Dec 4, 2025
775abed
feat: show version history in bottom sheet
ohassine Dec 4, 2025
0a14b38
Merge remote-tracking branch 'origin/fetch-and-display-node-versions'…
ohassine Dec 4, 2025
81249c4
feat: conflicts
ohassine Dec 4, 2025
0b5131b
feat: detekt
ohassine Dec 5, 2025
4c71e6c
feat: add TODO
ohassine Dec 5, 2025
4d4f97b
Merge remote-tracking branch 'origin/develop' into download-version
ohassine Dec 5, 2025
f9c7c34
feat: conflicts
ohassine Dec 5, 2025
55e15dd
feat: detekt
ohassine Dec 5, 2025
79bb499
feat: test
ohassine Dec 5, 2025
394f5db
feat: add TODO to handle error case
ohassine Dec 5, 2025
e41c4fc
feat: use AnimatedContent
ohassine Dec 5, 2025
444cfda
feat: lint
ohassine Dec 5, 2025
9afbd69
feat: lint
ohassine Dec 5, 2025
4095775
feat: conflicts
ohassine Dec 5, 2025
b8f18a5
feat: kalium reference
ohassine Dec 5, 2025
4fde618
feat: cleanup
ohassine Dec 8, 2025
55fa027
feat: cleanup
ohassine Dec 8, 2025
b95e72c
feat: conflicts
ohassine Dec 8, 2025
fc65c42
feat: add apple target class
ohassine Dec 8, 2025
1e28823
feat: conflicts
ohassine Dec 8, 2025
5cf6b8a
Merge branch 'restore-node-version' into download-version
ohassine Dec 8, 2025
f880a53
Merge remote-tracking branch 'origin/restore-node-version' into downl…
ohassine Dec 8, 2025
ab90809
feat: cleanup
ohassine Dec 8, 2025
8216d62
feat: cleanup
ohassine Dec 9, 2025
b58a6c6
Merge branch 'develop' into download-version
ohassine Dec 9, 2025
54d6af5
feat: cleanup
ohassine Dec 9, 2025
b515966
feat: cleanup
ohassine Dec 9, 2025
1ae12b9
feat: detekt
ohassine Dec 9, 2025
f2f7689
feat: unit test
ohassine Dec 9, 2025
20170f7
feat: unit test
ohassine Dec 9, 2025
d9a5062
fix: conflicts
ohassine Dec 18, 2025
407e3b0
fix: unit test
ohassine Dec 18, 2025
42761c6
fix: unit test
ohassine Dec 18, 2025
5a6aca0
fix: detekt
ohassine Dec 18, 2025
3503892
Merge branch 'develop' into versionHistoryViewModel-unit-test
ohassine Dec 18, 2025
d155578
fix: uncomment UpdateAppDialog
ohassine Dec 19, 2025
0eeeb47
Merge remote-tracking branch 'origin/versionHistoryViewModel-unit-tes…
ohassine Dec 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,6 @@ class CellsModule {
fun provideGetNodeVersionsUseCase(cellsScope: CellsScope): GetNodeVersionsUseCase =
cellsScope.getNodeVersions

@ViewModelScoped
@Provides
fun provideRefreshHelper(cellsScope: CellsScope, kaliumConfigs: KaliumConfigs): CellAssetRefreshHelper = CellAssetRefreshHelper(
refreshAsset = cellsScope.refreshAsset,
featureFlags = kaliumConfigs
)

@ViewModelScoped
@Provides
fun provideRestoreNodeVersionUseCase(cellsScope: CellsScope): RestoreNodeVersionUseCase =
Expand All @@ -226,4 +219,11 @@ class CellsModule {
@Provides
fun provideDownloadCellVersionUseCase(cellsScope: CellsScope): DownloadCellVersionUseCase =
cellsScope.downloadCellVersion

@ViewModelScoped
@Provides
fun provideRefreshHelper(cellsScope: CellsScope, kaliumConfigs: KaliumConfigs): CellAssetRefreshHelper = CellAssetRefreshHelper(
refreshAsset = cellsScope.refreshAsset,
featureFlags = kaliumConfigs
)
}
30 changes: 30 additions & 0 deletions app/src/test/kotlin/com/wire/android/util/StringUtilTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,36 @@ class StringUtilTest {
assert(expected == actual)
}

@Test
fun givenFilenameWithExtension_whenCalled_thenShouldInsertStringBeforeExtension() {
val originalFilename = "document.pdf"
val textToInsert = "new"

val result = originalFilename.addBeforeExtension(textToInsert)

assertEquals("document_new.pdf", result)
}

@Test
fun givenFilenameWithoutExtension_whenCalled_thenShouldAppendString() {
val originalFilename = "myfile"
val textToInsert = "_version2"

val result = originalFilename.addBeforeExtension(textToInsert)

assertEquals("myfile_version2", result)
}

@Test
fun givenFilenameWithMultipleDots_whenCalled_thenShouldInsertBeforeLastDot() {
val originalFilename = "archive.2024.tar.gz"
val textToInsert = "backup"

val result = originalFilename.addBeforeExtension(textToInsert)

assertEquals("archive.2024_backup.tar.gz", result)
}

@Suppress("LongMethod")
@Test
fun givenDifferentMarkdownsWithOnlyWhitespaces_whenCheckingIfNotBlank_thenReturnProperValues() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ fun String.capitalizeFirstLetter(): String = lowercase().replaceFirstChar(Char::
fun String.normalizeFileName(): String = this.replace("/", "")

fun String.addBeforeExtension(insert: String): String {
val dotIndex = this.lastIndexOf('.')
return if (dotIndex != -1) {
val name = this.take(dotIndex)
val ext = this.substring(dotIndex)
"${name}_$insert$ext"
} else {
this + insert
val lastDotIndex = this.lastIndexOf('.')
if (lastDotIndex <= 0) {
return this + insert
}

val extensionBlockIndex = this.lastIndexOf('.', lastDotIndex - 1).let {
if (it == -1) lastDotIndex else it
}

val name = this.take(extensionBlockIndex)
val ext = this.substring(extensionBlockIndex)

return "${name}_$insert$ext"
}
1 change: 1 addition & 0 deletions features/cells/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dependencies {
testRuntimeOnly(libs.junit5.engine)
androidTestImplementation(libs.androidx.test.extJunit)
androidTestImplementation(libs.androidx.espresso.core)
testImplementation(testFixtures(project(":core:ui-common")))
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ fun VersionHistoryScreen(
private fun VersionHistoryScreenContent(
versionsGroupedByTime: List<VersionGroup>,
versionHistoryState: State<VersionHistoryState>,
onRefresh: () -> Unit,
optionsBottomSheetState: WireModalSheetState<Pair<String, CellVersion>>,
restoreDialogState: RestoreDialogState,
onRefresh: () -> Unit,
modifier: Modifier = Modifier,
fileName: String? = null,
restoreVersion: () -> Unit = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ class VersionHistoryViewModel @Inject constructor(
}
}

// TODO: Unit test coming in another PR
fun showRestoreConfirmationDialog(versionId: String) {
restoreDialogState.value = restoreDialogState.value.copy(
visible = true,
Expand All @@ -166,7 +165,6 @@ class VersionHistoryViewModel @Inject constructor(
)
}

// TODO: Unit test coming in another PR
fun hideRestoreConfirmationDialog() {
restoreDialogState.value = restoreDialogState.value.copy(
restoreVersionState = RestoreVersionState.Idle,
Expand All @@ -175,7 +173,6 @@ class VersionHistoryViewModel @Inject constructor(
)
}

// TODO: Unit test coming in another PR
fun restoreVersion() {
with(restoreDialogState) {
restoreDialogState.value = value.copy(
Expand Down Expand Up @@ -205,7 +202,6 @@ class VersionHistoryViewModel @Inject constructor(
}
}

// TODO: Unit test coming in another PR
fun downloadVersion(versionId: String, versionDate: String) {
viewModelScope.launch {
downloadState.value = DownloadState.Downloading(0, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import android.content.ContentValues
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import android.os.Build
import androidx.core.content.FileProvider
import dagger.hilt.android.qualifiers.ApplicationContext
import okio.Path
Expand Down
Loading
Loading