mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
Keep message selection active when every message is unselected
Unselecting the last message used to end the selection, closing it without the user asking. Selection mode is now its own state: Forward starts it and it only ends with the close button, once the messages are forwarded, when the timeline changes or the feature is turned off. With nothing selected the forward button stays visible but disabled.
This commit is contained in:
@@ -781,9 +781,14 @@ final class TimelineViewModelTests {
|
||||
viewModel.process(viewAction: .toggleMessageSelection(itemID: items[0].id))
|
||||
#expect(viewModel.state.messageSelection.selectedEventIDs == ["$2"])
|
||||
|
||||
// Deselecting the last item ends the selection.
|
||||
// Deselecting the last item keeps the selection going, with nothing selected.
|
||||
viewModel.process(viewAction: .toggleMessageSelection(itemID: items[1].id))
|
||||
#expect(!viewModel.state.messageSelection.isActive)
|
||||
#expect(viewModel.state.messageSelection.isActive)
|
||||
#expect(viewModel.state.messageSelection.selectedEventIDs.isEmpty)
|
||||
|
||||
// Selecting again still works.
|
||||
viewModel.process(viewAction: .toggleMessageSelection(itemID: items[0].id))
|
||||
#expect(viewModel.state.messageSelection.selectedEventIDs == ["$1"])
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user