Skip to content

Keep usernames literal in system messages - #8863

Open
MirrorCubeSquare wants to merge 1 commit into
mtgred:masterfrom
MirrorCubeSquare:codex/fix-username-rendering
Open

MirrorCubeSquare wants to merge 1 commit into
mtgred:masterfrom
MirrorCubeSquare:codex/fix-username-rendering

Conversation

@MirrorCubeSquare

@MirrorCubeSquare MirrorCubeSquare commented Sep 12, 2026 •

Copy link
Copy Markdown

Usernames containing card names can be parsed as card links or translated card text in system messages. For example, MirrorCubeSquare can have its Mirror prefix 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 :text field 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):

  • Backend: game.core.say-test, web.lobby-test, and web.game-test — 13 tests, 279 assertions, no failures or errors.
  • Browser: 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.
  • Shadow CLJS release of :app — successful, zero compiler warnings.
  • git diff --check — clean.

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.
@MirrorCubeSquare

MirrorCubeSquare commented Sep 12, 2026 •

Copy link
Copy Markdown
Author

This is a bugfix for issue #8862
After fix it shoud be like the following screen shot (this is taken from my testbench server)
under current version
MirrorCubeSquare will be rendered as"镜子CubeSquare"
and F2PDrafter will be rendered as "免付费内容建筑师"
微信图片_20260906090919_167_153
微信图片_20260906090825_166_153

@NoahTheDuke

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants