Skip to content

Commit

Permalink
Merge branch 'release/0.4.7' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Mar 26, 2024
2 parents 5b1ae24 + 25b97b6 commit 7994e5d
Show file tree
Hide file tree
Showing 416 changed files with 1,822 additions and 701 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/clear-cache.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/nightlyReports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: ./gradlew verifyPaparazziDebug $CI_GRADLE_ARG_PROPERTIES

- name: 📈 Generate kover report and verify coverage
run: ./gradlew :app:koverHtmlReport :app:koverXmlReport :app:koverVerify $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
run: ./gradlew :app:koverXmlReportGplayDebug :app:koverHtmlReportGplayDebug :app:koverVerifyGplayDebug $CI_GRADLE_ARG_PROPERTIES

- name: ✅ Upload kover report
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
with:
name: linting-report
path: |
*/build/reports/**/*.*
**/build/reports/**/*.*
- name: Prepare Danger
if: always()
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ jobs:
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}

- name: ⚙️ Run unit tests, debug and release
run: ./gradlew test $CI_GRADLE_ARG_PROPERTIES
- name: ⚙️ Run unit tests for debug variant
run: ./gradlew testDebugUnitTest $CI_GRADLE_ARG_PROPERTIES

- name: 📸 Run screenshot tests
run: ./gradlew verifyPaparazziDebug $CI_GRADLE_ARG_PROPERTIES

- name: 📈Generate kover report and verify coverage
run: ./gradlew :app:koverHtmlReport :app:koverXmlReport :app:koverVerify $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
run: ./gradlew :app:koverXmlReportGplayDebug :app:koverHtmlReportGplayDebug :app:koverVerifyGplayDebug $CI_GRADLE_ARG_PROPERTIES

- name: 🚫 Upload kover failed coverage reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: kover-error-report
path: |
app/build/reports/kover/verify.err
app/build/reports/kover/verifyGplayDebug.err
- name: ✅ Upload kover report (disabled)
if: always()
Expand All @@ -85,5 +85,5 @@ jobs:
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
# with:
# files: build/reports/kover/xml/report.xml
files: app/build/reports/kover/reportGplayDebug.xml
verbose: true
2 changes: 0 additions & 2 deletions .maestro/tests/account/login.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ appId: ${MAESTRO_APP_ID}
- inputText: ${MAESTRO_PASSWORD}
- pressKey: Enter
- tapOn: "Continue"
- runFlow: ../assertions/assertWelcomeScreenDisplayed.yaml
- tapOn: "Continue"
- runFlow: ../assertions/assertAnalyticsDisplayed.yaml
- tapOn: "Not now"
- runFlow: ../assertions/assertHomeDisplayed.yaml
Expand Down
6 changes: 0 additions & 6 deletions .maestro/tests/assertions/assertWelcomeScreenDisplayed.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
Changes in Element X v0.4.7 (2024-03-26)
========================================

Features ✨
----------
- Enable the feature "RoomList filters". ([#2603](https://github.com/element-hq/element-x-android/issues/2603))
- Enable the feature "Mark as unread" ([#2261](https://github.com/element-hq/element-x-android/issues/2261))
- Implement MSC2530 (Body field as media caption) ([#2521](https://github.com/element-hq/element-x-android/issues/2521))

Bugfixes 🐛
----------
- Use user avatar from cache if available. ([#2488](https://github.com/element-hq/element-x-android/issues/2488))
- Update member list after changing member roles and when the room member list is opened. ([#2590](https://github.com/element-hq/element-x-android/issues/2590))

Other changes
-------------
- Compound: add `BigIcon`, `BigCheckmark` and `PageTitle` components. ([#2574](https://github.com/element-hq/element-x-android/issues/2574))
- Remove Welcome screen from the FTUE. ([#2584](https://github.com/element-hq/element-x-android/issues/2584))


Changes in Element X v0.4.6 (2024-03-15)
========================================

Expand Down
23 changes: 1 addition & 22 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import extension.gitBranchName
import extension.gitRevision
import extension.koverDependencies
import extension.setupKover
import org.jetbrains.kotlin.cli.common.toBooleanLenient

plugins {
id("io.element.android-compose-application")
Expand Down Expand Up @@ -189,7 +188,7 @@ androidComponents {
val abiCode = abiVersionCodes[name] ?: 0
// Assigns the new version code to output.versionCode, which changes the version code
// for only the output APK, not for the variant itself.
output.versionCode.set((output.versionCode.get() ?: 0) * 10 + abiCode)
output.versionCode.set((output.versionCode.orNull ?: 0) * 10 + abiCode)
}
}
}
Expand All @@ -215,26 +214,6 @@ knit {
}
}

val ciBuildProperty = "ci-build"
val isCiBuild = if (project.hasProperty(ciBuildProperty)) {
val raw = project.property(ciBuildProperty) as? String
raw?.toBooleanLenient() == true || raw?.toIntOrNull() == 1
} else {
false
}

kover {
// When running on the CI, run only debug test variants
if (isCiBuild) {
excludeTests {
// Disable instrumentation for debug test tasks
tasks(
"testDebugUnitTest",
)
}
}
}

dependencies {
allLibrariesImpl()
allServicesImpl()
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ allprojects {

// Register quality check tasks.
tasks.register("runQualityChecks") {
dependsOn(":tests:konsist:testDebugUnitTest")
project.subprojects {
// For some reason `findByName("lint")` doesn't work
tasks.findByPath("$path:lint")?.let { dependsOn(it) }
Expand Down
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/40004070.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Main changes in this version: Enable the feature "RoomList filters" and "Mark as unread".
Full changelog: https://github.com/element-hq/element-x-android/releases
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import io.element.android.features.ftue.api.FtueEntryPoint
import io.element.android.features.ftue.impl.notifications.NotificationsOptInNode
import io.element.android.features.ftue.impl.state.DefaultFtueState
import io.element.android.features.ftue.impl.state.FtueStep
import io.element.android.features.ftue.impl.welcome.WelcomeNode
import io.element.android.features.lockscreen.api.LockScreenEntryPoint
import io.element.android.libraries.architecture.BackstackView
import io.element.android.libraries.architecture.BaseFlowNode
Expand Down Expand Up @@ -73,9 +72,6 @@ class FtueFlowNode @AssistedInject constructor(
@Parcelize
data object Placeholder : NavTarget

@Parcelize
data object WelcomeScreen : NavTarget

@Parcelize
data object NotificationsOptIn : NavTarget

Expand Down Expand Up @@ -110,15 +106,6 @@ class FtueFlowNode @AssistedInject constructor(
NavTarget.Placeholder -> {
createNode<PlaceholderNode>(buildContext)
}
NavTarget.WelcomeScreen -> {
val callback = object : WelcomeNode.Callback {
override fun onContinueClicked() {
ftueState.setWelcomeScreenShown()
lifecycleScope.launch { moveToNextStep() }
}
}
createNode<WelcomeNode>(buildContext, listOf(callback))
}
NavTarget.NotificationsOptIn -> {
val callback = object : NotificationsOptInNode.Callback {
override fun onNotificationsOptInFinished() {
Expand Down Expand Up @@ -146,9 +133,6 @@ class FtueFlowNode @AssistedInject constructor(

private fun moveToNextStep() {
when (ftueState.getNextStep()) {
FtueStep.WelcomeScreen -> {
backstack.newRoot(NavTarget.WelcomeScreen)
}
FtueStep.NotificationsOptIn -> {
backstack.newRoot(NavTarget.NotificationsOptIn)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import android.os.Build
import androidx.annotation.VisibleForTesting
import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.features.ftue.api.state.FtueState
import io.element.android.features.ftue.impl.welcome.state.WelcomeScreenState
import io.element.android.features.lockscreen.api.LockScreenService
import io.element.android.libraries.di.SessionScope
import io.element.android.libraries.permissions.api.PermissionStateProvider
Expand All @@ -40,14 +39,12 @@ class DefaultFtueState @Inject constructor(
private val sdkVersionProvider: BuildVersionSdkIntProvider,
coroutineScope: CoroutineScope,
private val analyticsService: AnalyticsService,
private val welcomeScreenState: WelcomeScreenState,
private val permissionStateProvider: PermissionStateProvider,
private val lockScreenService: LockScreenService,
) : FtueState {
override val shouldDisplayFlow = MutableStateFlow(isAnyStepIncomplete())

override suspend fun reset() {
welcomeScreenState.reset()
analyticsService.reset()
if (sdkVersionProvider.isAtLeast(Build.VERSION_CODES.TIRAMISU)) {
permissionStateProvider.resetPermission(Manifest.permission.POST_NOTIFICATIONS)
Expand All @@ -62,12 +59,7 @@ class DefaultFtueState @Inject constructor(

fun getNextStep(currentStep: FtueStep? = null): FtueStep? =
when (currentStep) {
null -> if (shouldDisplayWelcomeScreen()) {
FtueStep.WelcomeScreen
} else {
getNextStep(FtueStep.WelcomeScreen)
}
FtueStep.WelcomeScreen -> if (shouldAskNotificationPermissions()) {
null -> if (shouldAskNotificationPermissions()) {
FtueStep.NotificationsOptIn
} else {
getNextStep(FtueStep.NotificationsOptIn)
Expand All @@ -87,7 +79,6 @@ class DefaultFtueState @Inject constructor(

private fun isAnyStepIncomplete(): Boolean {
return listOf(
{ shouldDisplayWelcomeScreen() },
{ shouldAskNotificationPermissions() },
{ needsAnalyticsOptIn() },
{ shouldDisplayLockscreenSetup() },
Expand All @@ -99,10 +90,6 @@ class DefaultFtueState @Inject constructor(
return runBlocking { analyticsService.didAskUserConsent().first().not() }
}

private fun shouldDisplayWelcomeScreen(): Boolean {
return welcomeScreenState.isWelcomeScreenNeeded()
}

private fun shouldAskNotificationPermissions(): Boolean {
return if (sdkVersionProvider.isAtLeast(Build.VERSION_CODES.TIRAMISU)) {
val permission = Manifest.permission.POST_NOTIFICATIONS
Expand All @@ -120,19 +107,13 @@ class DefaultFtueState @Inject constructor(
}
}

fun setWelcomeScreenShown() {
welcomeScreenState.setWelcomeScreenShown()
updateState()
}

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun updateState() {
shouldDisplayFlow.value = isAnyStepIncomplete()
}
}

sealed interface FtueStep {
data object WelcomeScreen : FtueStep
data object NotificationsOptIn : FtueStep
data object AnalyticsOptIn : FtueStep
data object LockscreenSetup : FtueStep
Expand Down
Loading

0 comments on commit 7994e5d

Please sign in to comment.