ref(replays): use shared platform icon resolver#115705
Draft
Conversation
Delegate generatePlatformIconName to getLogoImage (LOGO_MAPPING in contextIcon) instead of keeping a parallel PLATFORM_ALIASES map. Drops the duplicated alias table and the @ts-expect-error escape. Note: this consolidates onto the canonical events-context mapping, which differs in a few edge cases (e.g. 'google' -> 'android', 'ipod' -> 'apple-iphone'). For browser/OS strings produced by replay SDKs these names are unlikely to surface.
Contributor
📊 Type Coverage Diff
🔍 1 new type safety issue introduced
This is informational only and does not block the PR. |
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.
Stacked on #115701.
generatePlatformIconNameused to maintain its ownPLATFORM_ALIASEStable — a strict subset ofLOGO_MAPPINGincontextIcon.tsx, kept in sync by hand. With the migration to platformicons, the canonical mapping now lives ingetLogoImage. This change drops the duplicate table and delegates togetLogoImage, also clearing the@ts-expect-errorfrom the previous keyed access.Behavior notes
LOGO_MAPPINGis a superset ofPLATFORM_ALIASES, with two divergent entries that consolidation will apply to replays too:google→android(was passing through asgoogle)ipod→apple-iphone(was passing through asipod)Both names only surface here via
generateIconName, which itself convertsPixel *device strings togoogle. For browser/OS values produced by replay SDKs these aren't expected to occur in practice, but flagging them in case a reviewer wants to keep the maps split.Test plan
BrowserOSIconsin the explore replays detail view