-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message Reactions 🥳 #140
Message Reactions 🥳 #140
Conversation
…nd message.reactions from this check and use the triggerRedraw functionality correctly)
…eyboards frame as well as whether it's shown or not.
…height to 1 px (when `viewSize` was used with large leadingPadding or trailingPadding values the height would effect the views layout, this was noticeable in the rendering of leading vs trailing aligned Message Menu Buttons).
…xtFeild but when focused launches the keybaord in Emoji mode.
…iguration. The ReactionDelegate provides an interface for both responding to message reactions and configuring the message menu for reactions on a per message basis.
…existing frame and size getter, but captures the maximum height of a view instead of just it's current height (useful for laying out the message menu with dynamic system font sizes).
…ont.Title3 size across the full range of dynamic text sizes (including accessiblity fonts). We use these values when constructing the ReactionSelection view.
…essage when invoking the message menu. This value gets populated by a `frameGetter` call in `MessgeView` when `isDisplayingMessageMenu` is true.
…FloatingButton packages.
…when launching the message menu.
… the new MessageMenu.
…g the default delegate on per closure basis. Also added a modifier for adjusting the MessageMenu's animation duration.
…source and an add(draftReaction:, to:) method for simulating reacting to messages.
…ctorProtocol. Also added a method for updating a reactions status.
…/ support message reactions.
…andom reaction and a function for appending a reaction to an existing MockMessage.
…l for reaction support in our ChatExampleView. Also added a remove function so we can actually remove messages when a user uses the MessageMenu to delete a message.
…e now that our datasource supports it.
#Conflicts: # Package.swift # Sources/ExyteChat/ChatView/ChatView.swift
… and for a width to be specified by the parent view, instead of using UIScreen bounds.
…dently 4 different times.
…e constraint (the previous layout resulted in very jittery scrolling).
…with the background. A transparent friendMessageColor presents an issue when overlaying reactions on message bubbles.
…cking the message sender.
While working on this, I noticed that the UIList(...)
.transparentNonAnimatingFullScreenCover(...) modifier doesn't seem to be preventing animations upon launching anymore. This results in a moving background while launching the menu while the keyboard is deployed. I tried a couple of things to keep the ChatView static during the keyboard dismissal but I didn't have any luck. I believe this behavior is consistent with the current main branch. I'm not sure when |
@btoms20, wow, cool! thank you so much for making the lib better, have a great day! |
What:
Changes:
Models:
Reaction
modelReaction
has the sameid
,user
,createdAt
andstatus
params thatMessage
hasReaction
contains aReactionType
ReactionType
is an emoji, but other types can be added later.ReactionDelegate
Message
model to accept an array ofReactions
.ChatView
initializers have been updated to accept aReactionDelegate
, but default tonil
to maintain backward compatibility.Note
If no
ReactionDelegate
is provided to theChatView
then all reaction related views are disabled within theMessageMenu
Views
MessageReaction View

.sending
reactions by animating the bubbles strokeReactionSelection View

ReactionDelegate
Reactions
(so developers can support removing reactions if they chose to)ReactionOverview View

Users
avatars by reactions for an easy overviewReactionDelegate
New MessageMenu view that doesn't rely on swift-introspection
snappy
the Menu feels)func messageMenuAnimationDuration(_ duration:Double) -> ChatView
Configuring:
The following configuration using the
ChatView
modifier....Results in the following message menu layouts...
The developer can also set a
ReactionDelegate
on theChatView
using either the initializers or the.messageReactionDelegate(...)
method.Supporting Reactions
Custom Message Builder:
Fixes / Addresses:
#120
#129
Examples:
Testing:
Dependencies:
Disclosure: