Add emote aliases for tab completion and chat#7910
Conversation
night
left a comment
There was a problem hiding this comment.
Thanks for putting this together. Really clean implementation, and following the existing SettingKeywords pattern made it easy to read.
A few things before we can merge:
-
Please rebase onto
master. We just landed a Mantine 9 + React 19 upgrade (#7947), so this branch is now behind. The change should still merge cleanly given how closely it tracks the existing settings patterns. -
Drop the non-English locale changes. Only the English strings (the
defaultMessagevalues in source) need to be edited. Every other locale is managed via Crowdin and gets imported automatically, so hand-edited translations there will get overwritten on the next sync. Removing thecs-CZ.jsonthroughuk-UA.jsonedits will shrink the diff substantially. -
Naming/framing. What you've built isn't really an emote alias system, it's a general text replacement feature (the "target" can be any string, with no validation that it's an emote, and the substitution runs unconditionally on send). That's actually fine, and probably more useful than a strict emote-only version, but the naming ("Emote Aliases",
EMOTE_ALIASES,targetCode) overpromises. Could you rename around "Text Replacements" or "Substitutions" or similar?SettingIds.TEXT_REPLACEMENTS, page name, settings copy, etc. Happy to bikeshed the exact term if you have a preference.
Users can define personal text replacements (e.g. "pog" → "stormW30Pog") that take priority during tab completion and are substituted on message send. A management page is added under Settings → Tab Completion → Text Replacements.
- Strip internal whitespace from trigger on blur so multi-word triggers are not silently unreachable - Deduplicate tab completion suggestions by filtering emote/user lists against alias replacements - Move Text Replacements entry point from Tab Completion group to Chat group - Replace nested ternary in SettingsModal title with a page title lookup map - Add comment explaining applyTextReplacements must remain first in the send pipeline - Reduce CSS duplication in SettingTextReplacements by composing shared styles from SettingKeywords Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…acements # Conflicts: # src/constants.js # src/modules/send_message/index.js # src/modules/settings/components/SettingsModal.jsx # src/modules/settings/components/SideNavigation.jsx # src/modules/settings/settings/twitch/Chat.jsx
Updates imports to the @ alias style and fixes prettier formatting introduced by the upstream merge (webpack -> vite, relative -> alias imports).
Summary
lol→KEKW) that map any typed shortcut to any emote codeloldirectly and hitting Enter sendsKEKWHow it works
Storage: aliases are persisted in
localStorageas{ uuid: { id, alias, targetCode } }underSettingIds.EMOTE_ALIASES, following the same pattern as highlight keywords.Tab completion (
chat_tab_completion):getAliasMatches()checks user aliases before the regular emote list, so matching aliases always surface first.Message send (
send_message):replaceEmoteAliases()is registered in themethodListpipeline and substitutes each word in the message against the alias map before dispatch — the same mechanism used by the emoji substitution module.Test plan
lol→KEKW) in Settings → Tab Completion → Emote Aliaseslolin chat and press Tab — verifyKEKWappears as the first suggestionlolin chat and press Enter directly — verify the message is sent asKEKWPreview
Demo of the feature in action.
Gravando.2026-04-24.120742.1.mp4