W-432: drop component-group modifiers from the emoji corpus#148
Merged
Conversation
Bare Fitzpatrick skin-tone swatches (🏻–🏿) and hair modifiers (🦰🦱🦳🦲)
were surfacing as standalone search hits (e.g. `:medium_skin_tone:`). They're
emojibase group 2 ("component") — combining modifiers, useless inserted alone.
The browser already skips this group, so they only leaked through live search.
Filter the component group out of the loaded corpus so it's absent from search
and exact-match, matching the browser. SkinTone applies modifiers via
hardcoded scalars, not the DB, so skin-tone application is unaffected.
Refs: W-432
There was a problem hiding this comment.
Clean filter with a solid matching test — logic is correct and the three-angle test coverage (corpus invariant, byHexcode lookup, search hit) is thorough.
CI: one check (ssot) is in progress (the review pipeline itself); no failed checks.
Nit: The test comment // The reported case: the bare medium skin-tone swatch (🏽) is gone. references the bug-report context ("reported case"), which couples the comment to fix history that rots over time. Per project conventions, comments should describe the invariant, not the fix — e.g. // e.g. the medium skin-tone swatch (🏽) should not appear as a standalone hit says the same thing without the task coupling.
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.
What
Bare Fitzpatrick skin-tone swatches (🏻–🏿, e.g.
:medium_skin_tone:) and hair modifiers (🦰🦱🦳🦲) surfaced as standalone search hits. They're emojibase group 2 ("component") — combining modifiers, useless inserted alone. The browser already skips this group, so they only leaked through live search.Fix
Filter the component group out of the loaded corpus in
EmojiDatabase.load, so it's absent from search and exact-match — matching the browser.SkinToneapplies modifiers via hardcoded scalars, not the DB, so skin-tone application is unaffected.Notes
Test plan
componentModifiersAreExcludedtest: no group-2 entries in the corpus;🏽gone frombyHexcodeand from a:mediumsearch.Refs W-432