Plain composer suggestions and pills (#2751)

* Move ComposerToolbar files to withing the RoomScreen folder (as it's not a screen on its own)

* Switch the plain composer to NSAttributedStrings

* Enable suggestions on the plain composer

* Introduce a new `MatrixUserDisplayName` attributed string attributed and use it for mention building

* Implement mention pill rendering and sending on the plain message composer

* Fix plain composer snapshot tests

* Fix broken formatting options layout

* Add clarifying comment.
This commit is contained in:
Stefan Ceriu
2024-05-03 12:06:16 +03:00
committed by GitHub
parent d067e844da
commit 38416dbb5c
27 changed files with 418 additions and 232 deletions
@@ -26,6 +26,13 @@ enum UserIDAttribute: AttributedStringKey {
static var name = "MXUserIDAttribute"
}
/// This attribute is used to help the composer convert a mention into to a markdown link before sending
/// the message. It doesn't interact mention pills, as these fetch display names live from the room.
enum UserDisplayNameAttribute: AttributedStringKey {
typealias Value = String
static var name = "MXUserDisplayNameAttribute"
}
enum RoomIDAttribute: AttributedStringKey {
typealias Value = String
static var name = "MXRoomIDAttribute"
@@ -65,6 +72,7 @@ extension AttributeScopes {
let blockquote: BlockquoteAttribute
let userID: UserIDAttribute
let userDisplayName: UserDisplayNameAttribute
let roomID: RoomIDAttribute
let roomAlias: RoomAliasAttribute
let eventOnRoomID: EventOnRoomIDAttribute