W-432: drop component-group modifiers from the emoji corpus#147
Closed
wr wants to merge 1 commit into
Closed
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 fix. The filter is placed at exactly the right point (right after decode, before self.all is assigned), so the component emojis can never leak into byHexcode, the indexed corpus, or search results. The componentGroup constant being static makes it accessible from the test file without needing a test-only accessor.
Test coverage is solid: the allSatisfy guard checks no group-2 survivors exist, the byHexcode assertion is the reported-case regression test, and the FuzzyMatcher.search assertion closes the loop on the original symptom. Nothing to change.
Note: the ssot CI run was still in progress at review time — no failures observed.
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