Fixes #974 - Replace the timeline item contex menu with a bottom sheet

(+10 squashed commits)
[ba1d3160] Update timeline item action menu reaction UI
[410315ac] Move away from item bound action meus plus various tweaks following code review
[c25cd998] Add emoji reactions to the new timeline item action menu
[57001f49] Prevent timeline view layouts from dismissing the action menu
[d1e70538] Various UI tweaks
[652f4143] Switch to a long press gesture, move the header outside of the scroll view
[569a485c] Workaround timeline item action menu presentation state not being stored
[80c29567] Add currently selected item information in the TimelineItemMenu
[ff7790ec] Fixes #974 - Replace the timeline item contex menu with a bottom sheet
[ba1d3160] Rename TimelineItemContextMenu to TimelineIteMenu so that git correctly interprets it
This commit is contained in:
Stefan Ceriu
2023-05-30 13:53:25 +03:00
committed by Stefan Ceriu
parent 8ff5c6144c
commit 5a4f73e2b8
13 changed files with 382 additions and 185 deletions
@@ -51,7 +51,6 @@ enum RoomScreenViewAction {
case itemAppeared(id: String)
case itemDisappeared(id: String)
case itemTapped(id: String)
case itemDoubleTapped(id: String)
case linkClicked(url: URL)
case sendMessage
case sendReaction(key: String, eventID: String)
@@ -59,7 +58,11 @@ enum RoomScreenViewAction {
case cancelEdit
/// Mark the entire room as read - this is heavy handed as a starting point for now.
case markRoomAsRead
case contextMenuAction(itemID: String, action: TimelineItemContextMenuAction)
case timelineItemMenu(itemID: String)
case timelineItemMenuAction(itemID: String, action: TimelineItemMenuAction)
case displayEmojiPicker(itemID: String)
case displayCameraPicker
case displayMediaPicker
@@ -81,7 +84,7 @@ struct RoomScreenViewState: BindableState {
var bindings: RoomScreenViewStateBindings
var contextMenuActionProvider: (@MainActor (_ itemId: String) -> TimelineItemContextMenuActions?)?
var timelineItemMenuActionProvider: (@MainActor (_ itemId: String) -> TimelineItemMenuActions?)?
var composerMode: RoomScreenComposerMode = .default
@@ -102,6 +105,16 @@ struct RoomScreenViewStateBindings {
var alertInfo: AlertInfo<RoomScreenErrorType>?
var debugInfo: TimelineItemDebugInfo?
var actionMenuInfo: TimelineItemActionMenuInfo?
}
struct TimelineItemActionMenuInfo: Identifiable {
let item: EventBasedTimelineItemProtocol
var id: String {
item.id
}
}
enum RoomScreenErrorType: Hashable {