feat(mobile): let TextIcon respect IconGlyphSourceContext overrides - #862
Open
adrienzheng-cb wants to merge 3 commits into
Open
feat(mobile): let TextIcon respect IconGlyphSourceContext overrides#862adrienzheng-cb wants to merge 3 commits into
adrienzheng-cb wants to merge 3 commits into
Conversation
TextIcon hardcoded 'CoinbaseIcons' and read directly from the CDS glyphMap, bypassing the IconGlyphSourceContext used by Icon. This meant retail-icons (and any other IconGlyphSourceProvider) had no effect on TextIcon glyphs. - Export IconGlyphSourceContext from createIcon so TextIcon can access it - Resolve context source first (same priority logic as createIcon/resolveGlyph), falling back to the CDS glyphMap when the context source doesn't cover the name - Apply the resolved fontFamily instead of hardcoding 'CoinbaseIcons' - Add TextIcon.test.tsx with 6 cases covering the override and fallback paths Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
cb-ekuersch
reviewed
Aug 26, 2026
hcopp
previously approved these changes
Aug 26, 2026
Collaborator
|
Review Error for hcopp @ 2026-08-26 16:20:02 UTC |
…c between Icon and TextIcon Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
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 changed? Why?
TextIconhardcodedfontFamily: 'CoinbaseIcons'and read directly from the CDSglyphMap, bypassing theIconGlyphSourceContextthatIcon(viacreateIcon) uses. This meant anIconGlyphSourceProvider— such as the one set up byretail-icons— had no effect on glyphs rendered byTextIcon.Changes:
createIcon.tsx: export auseResolvedGlyph(boundSource, args)hook that wrapsuseContext(IconGlyphSourceContext)+ the existingresolveGlyphlogic. Also exportIconGlyphSourceContextdirectly for consumers that need it.createIcon.tsx: refactor thecreateIconinner component to calluseResolvedGlyphinstead of inlininguseContext+resolveGlyph.TextIcon.tsx: calluseResolvedGlyphwith a module-level CDS bound source — same priority logic asIcon, no duplication, no second factory.TextIcon.test.tsx: new test file with 6 cases covering the default CDS path, context override (glyph + font family), fallback when the context source doesn't cover the name, customgetGlyphresolver, and the missing-glyph null return.UI changes
No visual change for existing usages —
TextIconwithout anIconGlyphSourceProviderin the tree behaves identically to before.Testing
How has it been tested?
Testing instructions
Wrap a
<TextIcon>in an<IconGlyphSourceProvider source={retailIconsSource}>and confirm the overridden glyph and font family are applied.Change management
type=routine
risk=low
impact=sev5
automerge=false