Extract composer toolbar to a dedicated component (#1427)

* Extract composer toolbar to a dedicated component

* Use publisher for composer mode

* Introduce `RoomScreenComposerProvider`

* Add `ComposerToolbarViewModelTests`

* Rename protocols and add passthrough subjects for focused and composer mode

* Remove `ComposerToolbarViewActionHandler` and `ComposerToolbarCoordinatorParameters`

* Remove `RoomScreenComposerActionHandlerProtocol` and `RoomScreenComposerProviderProtocol`

* Re-arrange code a bit

* Remove composer mode being stored on `RoomScreen`

* Rename `process(viewAction: ComposerToolbarViewAction)` to `process(composerAction: ComposerToolbarViewAction)`

* Replace PassthroughSubject with direct function call

* Remove `ComposerToolbarCoordinator`

* Remove `cancelEdit` and `cancelReply` from external composer view model actions

* Use `RoomScreenComposerAction` as a sub-`RoomScreenViewModelAction`

* Move `ComposerToolbarViewModel` callback to actionsSubject

* Move `RoomScreenViewModel` callback to actionsSubject

* Fix `RoomScreenViewModelTests`

* Rename `composerAction` parameter to `roomAction`

* Fix unit tests
This commit is contained in:
aringenbach
2023-08-08 14:25:23 +02:00
committed by GitHub
parent 9a7a9c8d98
commit 59865a4b16
19 changed files with 513 additions and 204 deletions
@@ -14,10 +14,13 @@
// limitations under the License.
//
import Combine
import Foundation
import SwiftUI
@MainActor
protocol RoomScreenViewModelProtocol {
var callback: ((RoomScreenViewModelAction) -> Void)? { get set }
var actions: AnyPublisher<RoomScreenViewModelAction, Never> { get }
var context: RoomScreenViewModelType.Context { get }
func process(composerAction: ComposerToolbarViewModelAction)
}