Repository navigation
feat(bot): add icons for the types of case of the list - #424
Conversation
The restricted types, the nickname and the roles showed the shield of the moderators. Each now has an icon of its own, cut from the Discord assets as Discord cuts them. The map of the emojis is a Record, so a new type of case cannot go without one.
|
Architecture Data flow No data-flow sequence changed in this PR. Tip Set 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. Each case type gets its own application emoji, and a Record<TypeVariation, EmojiKey> makes the compiler enforce that a new type has one, which is better than the silent shield fallback.
Reviewed changes — the single commit, in full: the TS changes, the test and sources.json. The PNG and SVG assets are generated and I did not inspect them.
CaseTypeEmojisis exhaustive (wording.ts): it is nowRecord<TypeVariation, EmojiKey>with all 17 members mapped, andgetCaseTypeEmojiKeyno longer falls back to'Moderator'. The three callers (list.ts,view.ts,ModerationCommand.ts) still receive anEmojiKey.- Eight new
EmojiDefinitions(emojis.ts): the names match the uploaded asset files, each with a Unicode fallback for an application that lacks the emoji. - Assets and sources (
assets/emojis/ui/): the PNG/SVG pairs and theirsources.jsonentries, and the AGENTS.md Emojis bullet is updated to match. - Test (
case-menu.test.ts): every type option in the filter select has an emoji, none is the shield, and only VoiceKick and VoiceMute share an icon (emojis.length - 2unique names).
claude-sonnet-5-5 | 𝕏
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #424 +/- ##
=======================================
Coverage 63.05% 63.05%
=======================================
Files 288 288
Lines 10295 10295
Branches 2470 2469 -1
=======================================
Hits 6492 6492
Misses 3365 3365
Partials 438 438
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

🔗 Linked issue
None.
❓ Type of change
📚 Description
In the select menu of
/case list, and wherever a case is shown, the restricted types, the nickname change and the role changes all showed the shield of the moderators. A moderator could not tell an attachment restriction from an embed restriction.Each of these types now has an icon of its own, so the menu reads at a glance:
restricted_attachmentrestricted_embedLink, mirrored, slashedrestricted_emojiEmojisglyph, slashedrestricted_reactionrestricted_voicevoicespeaker, slashedset_nicknameedit profilerole_add,role_removecreate roleandremove role, in one colourThe slashed icons are cut the way Discord cuts a slashed icon: a band is removed around a 33 wide slash with round caps. The paperclip and the chain are mirrored so the slash crosses them instead of running along them. The icons are cells of the
Emojigrid ofIcons (Brand WolfStar), andprojects/bot/assets/emojis/ui/sources.jsonnames each cell.Voice kick and voice mute keep the icons of a kick and of a mute.
CaseTypeEmojisis now aRecordof everyTypeVariation, and the fallback to the shield is gone. A new type of case does not compile until it has an emoji.EmojiDefinitionshas the eight names, each with a Unicode fallback for an application that lacks the emoji.The eight PNGs are already uploaded to the staging, beta and production applications. The bot resolves their IDs by name at start, so no application needs a change before this is deployed.


Confidence Score: 5/5
The PR appears safe to merge.Reviews (1) · Last reviewed commit: "feat(bot): add icons for the types of ca..." · Reviewed by Greptile