Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Rich text Editor: Auto-replace plain text emoticons with emoji #12828

Merged
merged 16 commits into from
Aug 7, 2024

Conversation

langleyd
Copy link
Contributor

Depends on matrix-org/matrix-rich-text-editor#1009

What it looks like

Screen.Recording.2024-07-25.at.19.58.54.mov

@langleyd langleyd added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Jul 25, 2024
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise looks good!

@@ -52,6 +53,19 @@ export function PlainTextComposer({
rightComponent,
eventRelation,
}: PlainTextComposerProps): JSX.Element {
const [isAutoReplaceEmojiEnabled, setIsAutoReplaceEmojiEnabled] = useState(
SettingsStore.getValue<boolean>("MessageComposerInput.autoReplaceEmoji"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's also useSettingValue to do the getting + watching + unsubscribing for you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I actually looked for something as such, obviously not hard enough. 😂 thanks Dave

@@ -61,9 +68,26 @@ export const WysiwygComposer = memo(function WysiwygComposer({
const autocompleteRef = useRef<Autocomplete | null>(null);

const inputEventProcessor = useInputEventProcessor(onSend, autocompleteRef, initialContent, eventRelation);

const [emojiSuggestions, setEmojiSuggestions] = useState(
getEmojiSuggestions(SettingsStore.getValue<boolean>("MessageComposerInput.autoReplaceEmoji")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

@langleyd langleyd added this pull request to the merge queue Aug 7, 2024
Merged via the queue into develop with commit 5d16a38 Aug 7, 2024
29 checks passed
@langleyd langleyd deleted the langleyd/rte_auto_replace_emoji branch August 7, 2024 08:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants