Skip to content

Commit 10c2859

Browse files
committed
Merge branch 'develop' into feature/fga/waiting_ss_room
2 parents 7dd243c + 3b6385f commit 10c2859

File tree

249 files changed

+3134
-664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+3134
-664
lines changed

.github/ISSUE_TEMPLATE/story.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,28 @@ labels: [T-Story]
66
body:
77
- type: textarea
88
attributes:
9-
label: A story should take roughly a week or a sprint to finish. Each story is usually made up of a number of tasks that take half to a full day.
9+
label: Story
10+
description: A story should take roughly a week or a sprint to finish. Each story is usually made up of a number of tasks that take half to a full day.
1011
value: |
1112
As a user…
1213
I want to…
1314
so that I can…
1415
1516
## Scope
16-
<!-- These should be a list of technical tasks which take ½-1 day to complete -->
17+
<!--These should be a list of technical tasks which take ½-1 day to complete-->
1718
```[tasklist]
1819
### Tasklist
1920
- [ ] Task 1
21+
```
22+
2023
- [ ] QA signoff on completion
2124
- [ ] Design signoff on completion
2225
- [ ] Product signoff on completion
23-
```
26+
2427
2528
## Stretch goals
2629
None at this time
27-
<!-- or add a tasklist -->
30+
<!--or add a tasklist-->
2831
2932
## Out of scope
3033
-

.github/workflows/maestro.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ jobs:
5050
USERNAME=maestroelement
5151
PASSWORD=${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }}
5252
ROOM_NAME=MyRoom
53+
INVITEE1_MXID=@maestroelement2:matrix.org
54+
INVITEE2_MXID=@maestroelement3:matrix.org
5355
APP_ID=io.element.android.x.debug

.maestro/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ From root dir of the project
2323
```shell
2424
maestro test \
2525
-e APP_ID=io.element.android.x.debug \
26-
-e USERNAME=user \
26+
-e USERNAME=user1 \
2727
-e PASSWORD=123 \
2828
-e ROOM_NAME="MyRoom" \
29+
-e INVITEE1_MXID=user2 \
30+
-e INVITEE2_MXID=user3 \
2931
.maestro/allTests.yaml
3032
```
3133

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
appId: ${APP_ID}
2+
---
3+
# Purpose: Test the creation and deletion of a DM room.
4+
- tapOn: "Create a new conversation or room"
5+
- tapOn: "Search for someone"
6+
- inputText: ${INVITEE1_MXID}
7+
- tapOn:
8+
text: ${INVITEE1_MXID}
9+
index: 1
10+
- takeScreenshot: build/maestro/330-createAndDeleteDM
11+
- tapOn: "maestroelement2"
12+
- tapOn: "Leave room"
13+
- tapOn: "Leave"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
appId: ${APP_ID}
2+
---
3+
# Purpose: Test the creation and deletion of a room
4+
- tapOn: "Create a new conversation or room"
5+
- tapOn: "New room"
6+
- tapOn: "Search for someone"
7+
- inputText: ${INVITEE1_MXID}
8+
- tapOn:
9+
text: ${INVITEE1_MXID}
10+
index: 1
11+
- tapOn: "Next"
12+
- tapOn: "e.g. your project name"
13+
- inputText: "aRoomName"
14+
- tapOn: "What is this room about?"
15+
- inputText: "aRoomTopic"
16+
- tapOn: "Create"
17+
- takeScreenshot: build/maestro/320-createAndDeleteRoom
18+
- tapOn: "aRoomName"
19+
- tapOn: "Invite people"
20+
# assert there's 1 memeber and 1 invitee
21+
- tapOn: "Search for someone"
22+
- inputText: ${INVITEE2_MXID}
23+
- tapOn:
24+
text: ${INVITEE2_MXID}
25+
index: 1
26+
- tapOn: "Send"
27+
- tapOn: "Back"
28+
- tapOn: "aRoomName"
29+
- tapOn: "People"
30+
# assert there's 1 memeber and 2 invitees
31+
- tapOn: "Back"
32+
- tapOn: "Leave room"
33+
- tapOn: "Leave"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
appId: ${APP_ID}
2+
---
3+
# Purpose: Test the context menu of a room in the room list
4+
- longPressOn: ${ROOM_NAME}
5+
- takeScreenshot: build/maestro/310-RoomList-ContextMenu
6+
- tapOn:
7+
text: "Settings"
8+
index: 0
9+
- tapOn: "Back"
10+
- longPressOn: ${ROOM_NAME}
11+
- tapOn:
12+
text: "Leave room"
13+
index: 0
14+
- tapOn: "Cancel"
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
appId: ${APP_ID}
22
---
3-
- takeScreenshot: build/maestro/300-RoomList
43
- runFlow: searchRoomList.yaml
4+
- takeScreenshot: build/maestro/300-RoomList
55
- runFlow: timeline/timeline.yaml
6-
6+
- runFlow: roomContextMenu.yaml
7+
- runFlow: createAndDeleteRoom.yaml
8+
- runFlow: createAndDeleteDM.yaml

appnav/src/main/kotlin/io/element/android/appnav/BackstackExt.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package io.element.android.appnav
1818

1919
import com.bumble.appyx.navmodel.backstack.BackStack
2020
import com.bumble.appyx.navmodel.backstack.operation.NewRoot
21+
import com.bumble.appyx.navmodel.backstack.operation.Remove
2122

2223
/**
2324
* Don't process NewRoot if the nav target already exists in the stack.
@@ -29,3 +30,14 @@ fun <T : Any> BackStack<T>.safeRoot(element: T) {
2930
if (containsRoot) return
3031
accept(NewRoot(element))
3132
}
33+
34+
/**
35+
* Remove the last element on the backstack equals to the given one.
36+
*/
37+
fun <T : Any> BackStack<T>.removeLast(element: T) {
38+
val lastExpectedNavElement = elements.value.lastOrNull {
39+
it.key.navTarget == element
40+
} ?: return
41+
accept(Remove(lastExpectedNavElement.key))
42+
}
43+

appnav/src/main/kotlin/io/element/android/appnav/LoggedInFlowNode.kt

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import io.element.android.libraries.architecture.animation.rememberDefaultTransi
5858
import io.element.android.libraries.architecture.bindings
5959
import io.element.android.libraries.architecture.createNode
6060
import io.element.android.libraries.architecture.inputs
61-
import io.element.android.libraries.designsystem.theme.components.CircularProgressIndicator
6261
import io.element.android.libraries.designsystem.utils.SnackbarDispatcher
6362
import io.element.android.libraries.di.AppScope
6463
import io.element.android.libraries.matrix.api.MatrixClient
@@ -93,7 +92,7 @@ class LoggedInFlowNode @AssistedInject constructor(
9392
snackbarDispatcher: SnackbarDispatcher,
9493
) : BackstackNode<LoggedInFlowNode.NavTarget>(
9594
backstack = BackStack(
96-
initialElement = NavTarget.SplashScreen,
95+
initialElement = NavTarget.RoomList,
9796
savedStateMap = buildContext.savedStateMap,
9897
),
9998
buildContext = buildContext,
@@ -105,22 +104,14 @@ class LoggedInFlowNode @AssistedInject constructor(
105104
.distinctUntilChanged()
106105
.onEach { isConsentAsked ->
107106
if (isConsentAsked) {
108-
switchToRoomList()
107+
backstack.removeLast(NavTarget.AnalyticsOptIn)
109108
} else {
110-
switchToAnalytics()
109+
backstack.push(NavTarget.AnalyticsOptIn)
111110
}
112111
}
113112
.launchIn(lifecycleScope)
114113
}
115114

116-
private fun switchToRoomList() {
117-
backstack.safeRoot(NavTarget.RoomList)
118-
}
119-
120-
private fun switchToAnalytics() {
121-
backstack.safeRoot(NavTarget.AnalyticsSettings)
122-
}
123-
124115
interface Callback : Plugin {
125116
fun onOpenBugReport() = Unit
126117
}
@@ -196,9 +187,6 @@ class LoggedInFlowNode @AssistedInject constructor(
196187
}
197188

198189
sealed interface NavTarget : Parcelable {
199-
@Parcelize
200-
object SplashScreen : NavTarget
201-
202190
@Parcelize
203191
object Permanent : NavTarget
204192

@@ -224,12 +212,11 @@ class LoggedInFlowNode @AssistedInject constructor(
224212
object InviteList : NavTarget
225213

226214
@Parcelize
227-
object AnalyticsSettings : NavTarget
215+
object AnalyticsOptIn : NavTarget
228216
}
229217

230218
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
231219
return when (navTarget) {
232-
NavTarget.SplashScreen -> splashNode(buildContext)
233220
NavTarget.Permanent -> {
234221
createNode<LoggedInNode>(buildContext)
235222
}
@@ -322,7 +309,7 @@ class LoggedInFlowNode @AssistedInject constructor(
322309
.callback(callback)
323310
.build()
324311
}
325-
NavTarget.AnalyticsSettings -> {
312+
NavTarget.AnalyticsOptIn -> {
326313
analyticsOptInEntryPoint.createNode(this, buildContext)
327314
}
328315
}
@@ -341,12 +328,6 @@ class LoggedInFlowNode @AssistedInject constructor(
341328
}
342329
}
343330

344-
private fun splashNode(buildContext: BuildContext) = node(buildContext) {
345-
Box(modifier = it.fillMaxSize(), contentAlignment = Alignment.Center) {
346-
CircularProgressIndicator()
347-
}
348-
}
349-
350331
@Composable
351332
override fun View(modifier: Modifier) {
352333
Box(modifier = modifier) {

0 commit comments

Comments
 (0)