Keep usernames literal in system messages - #8863
Open
MirrorCubeSquare wants to merge 1 commit into
Open
MirrorCubeSquare wants to merge 1 commit into
MirrorCubeSquare wants to merge 1 commit into
Conversation
Separate username parts from card, icon, and pronoun processing in lobby and game logs, commands, notifications, and saved logs. Preserve legacy text, player highlighting and timestamps, and plain spectator styling.
Author
|
This is a bugfix for issue #8862 |
Collaborator
|
this is a great idea and i've considered something similar for a while (like card names or symbols). i'm gonna wait to review/merge this until i've merged my i18n message PR, because these both touch a lot of the same code paths. |
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.


Usernames containing card names can be parsed as card links or translated card text in system messages. For example,
MirrorCubeSquarecan have itsMirrorprefix replaced in spectator notifications or repeated names in side-swap messages. Icon and special-message tokens inside a username can also be interpreted as formatting.Keep usernames separate from renderable text using structured system-message parts. Only message text goes through card, icon, special-code, and pronoun processing. Apply this to lobby events, side swaps, commands, game notifications, and saved game logs. Retain the flattened
:textfield and the existing rendering fallback for older messages and replays.Preserve player highlighting and timestamps, including after a player leaves. Explicitly mark spectator names before removing them from the lobby so their join/leave messages remain plain and have no player timestamp.
Validation on current
master(d94d18cdc):game.core.say-test,web.lobby-test, andweb.game-test— 13 tests, 279 assertions, no failures or errors.nr.utils-test— 5 tests, 117 assertions, all passing in Chromium. Covers translated card names, icon/special tokens, HTML escaping, timestamps, spectator styling, departed players, and legacy messages.releaseof:app— successful, zero compiler warnings.git diff --check— clean.