Skip to content

ref(replays): use shared platform icon resolver#115705

Draft
priscilawebdev wants to merge 1 commit into
priscilawebdev/ref/de-1262-migrate-contexticon-to-platformiconsfrom
priscilawebdev/ref/consolidate-replay-platform-icon-resolution
Draft

ref(replays): use shared platform icon resolver#115705
priscilawebdev wants to merge 1 commit into
priscilawebdev/ref/de-1262-migrate-contexticon-to-platformiconsfrom
priscilawebdev/ref/consolidate-replay-platform-icon-resolution

Conversation

@priscilawebdev
Copy link
Copy Markdown
Member

Stacked on #115701.

generatePlatformIconName used to maintain its own PLATFORM_ALIASES table — a strict subset of LOGO_MAPPING in contextIcon.tsx, kept in sync by hand. With the migration to platformicons, the canonical mapping now lives in getLogoImage. This change drops the duplicate table and delegates to getLogoImage, also clearing the @ts-expect-error from the previous keyed access.

Behavior notes

LOGO_MAPPING is a superset of PLATFORM_ALIASES, with two divergent entries that consolidation will apply to replays too:

  • googleandroid (was passing through as google)
  • ipodapple-iphone (was passing through as ipod)

Both names only surface here via generateIconName, which itself converts Pixel * device strings to google. 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

  • Verify replay table browser/OS icons render unchanged for common cases (Chrome, Safari, iOS, macOS, Windows, Android)
  • Spot-check BrowserOSIcons in the explore replays detail view

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.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.53% 93.53% ±0%
Typed 135,650 135,648 🔴 -2
Untyped 9,387 9,388 🔴 +1
🔍 1 new type safety issue introduced

any-typed symbols (1 new)

File Line Detail
static/app/utils/replays/generatePlatformIconName.tsx 13 icon (var)

This is informational only and does not block the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant