Composer mode UI updates (#984)

* Fixes #975 - Update editing message UI

* Fixes #976 - Update reply composer mode UI to include message being replied to

* Use different icon corner radii in the timeline reply view depending on its placement
This commit is contained in:
Stefan Ceriu
2023-05-31 14:51:51 +03:00
committed by GitHub
parent 87075eecfd
commit 83e3d828cd
19 changed files with 230 additions and 93 deletions
@@ -339,7 +339,10 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
}
case .reply:
state.bindings.composerFocused = true
state.composerMode = .reply(id: eventTimelineItem.id, displayName: eventTimelineItem.sender.displayName ?? eventTimelineItem.sender.id)
let replyDetails = TimelineItemReplyDetails.loaded(sender: eventTimelineItem.sender, contentType: buildReplyContent(for: eventTimelineItem))
state.composerMode = .reply(itemID: eventTimelineItem.id, replyDetails: replyDetails)
case .viewSource:
let debugInfo = timelineController.debugInfo(for: eventTimelineItem.id)
MXLog.info(debugInfo)
@@ -410,6 +413,14 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
}
}
}
private func buildReplyContent(for item: EventBasedTimelineItemProtocol) -> EventBasedMessageTimelineItemContentType {
guard let messageItem = item as? EventBasedMessageTimelineItemProtocol else {
return .text(.init(body: item.body))
}
return messageItem.contentType
}
}
// MARK: - Mocks