Repository navigation
feat: react to remote messages with emoji - #452
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remote messages had no way to react. A quick acknowledgement meant pushing a whole message ("👍", "on it").
Now you can react to any message in a conversation or org:
Reacting on desktop
MP4
Double tap to heart (touch emulation)
MP4
Reacting on a phone (touch emulation)
MP4
Implementation
message_reactionstable (message, user, emoji; unique per triple). Emoji are stored as the character and must be one a shortcode stands for. Each person can leave up to 12 different emoji on a message.POST/DELETE remotes/messages/{message}/reactionsandGET remotes/reactions(your usage counts), on theconversationsthrottle. Reacting needs what pushing needs: an org role, or an open conversation with the partner. A fetched request can't be reacted to until it's merged, blocked pairs get 404, and org events can't be reacted to. Taking a reaction back only needs the message to be visible.conversations.reactions_versionand stamps the message with the new value, in one transaction. Thread responses now includereactions_version, and polls sendreactions_afterto getreaction_changes(the current reactions of every message that changed since then). The version is read before the messages, so a change landing mid-poll is sent again next time instead of being skipped.Reactions.test.ts). After a double tap it cancels the browser's emulated mouse events, so no word gets selected. The long-press overlay ignores the release of the finger that opened it, so lifting it over a quick reaction doesn't react.resources/js/lib/emoji-groups.json) was generated once from Unicode'semoji-test.txt, limited to the 1,870 emoji our shortcodes cover. It loads as its own chunk when you first hover or open the picker.Validation
vendor/bin/peston the affected suites:MessageReactionControllerTest(new), Conversation*, Org*, Message*, Inbox*,DatabaseTest,DatabaseSeederTest,ArchTest. 135 passed.bun run test:unit(47 passed, including the newReactions.test.ts);vp test run tests/Unit/EmojiSearch.test.tsx(5 passed).bun run test:types,bun run test:lint, Pint, plus PHPStan and Rector (dry run) on the touched PHP files.Limitations