Skip to content

[codex] Add platform icons and alias resolution#1

Merged
nathangathright merged 1 commit into
mainfrom
codex/add-platform-icons-and-aliases
May 18, 2026
Merged

[codex] Add platform icons and alias resolution#1
nathangathright merged 1 commit into
mainfrom
codex/add-platform-icons-and-aliases

Conversation

@nathangathright
Copy link
Copy Markdown
Contributor

@nathangathright nathangathright commented May 18, 2026

Summary

  • add the Netflix source icon files already prepared locally
  • add the Great Pods source icon from the Gmail-provided SVG and register it as an active platform
  • add platform alias resolution APIs so canonical IDs, aliases, and common slugs resolve consistently
  • document the new platform lookup APIs and add focused tests

Validation

  • pnpm test
  • pnpm validate
  • pnpm format:check

Summary by CodeRabbit

  • New Features

    • Platform aliases support—common variations like "amazon" now resolve to the correct platform.
    • New resolvePlatformId() function for flexible platform ID lookup with normalization.
    • New hasPlatformIcon() function to check icon availability.
    • Added Great Pods and Netflix to the platform catalog.
  • Bug Fixes

    • SVG viewBox attributes now trigger console warnings when missing.
  • Tests

    • Added comprehensive platform resolution test suite.
  • Documentation

    • Updated README with new API exports and types.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cd493f3d-a4dd-45a9-bb1b-090bae38e6cb

📥 Commits

Reviewing files that changed from the base of the PR and between 144b644 and 0d658f0.

⛔ Files ignored due to path filters (2)
  • src/source-icons/greatpods/icon.svg is excluded by !**/*.svg
  • src/source-icons/netflix/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (8)
  • README.md
  • src/core/index.ts
  • src/core/platforms.test.ts
  • src/core/platforms.ts
  • src/core/svg.ts
  • src/core/types.ts
  • src/data/platforms.json
  • src/source-icons/netflix/netflix-divided.eps

📝 Walkthrough

Walkthrough

This PR adds alias-aware platform ID resolution to the icons library. Platform data and types are extended to support aliases, normalization logic resolves aliases and slugs to canonical IDs, icon lookups are updated to use resolved IDs, viewBox extraction gains logging, and comprehensive tests validate the complete flow.

Changes

Platform Alias Resolution and Icon Lookup Enhancement

Layer / File(s) Summary
Platform data model and alias data
src/core/types.ts, src/data/platforms.json
Platform interface adds optional aliases field; platforms.json adds "amazon" alias to Amazon Music and introduces Great Pods and Netflix entries.
Platform ID resolution and normalization
src/core/platforms.ts
Introduces normalizePlatformInput to normalize and canonicalize platform input, builds platformIdMap from canonical IDs and aliases, exports resolvePlatformId to map input to canonical PlatformId, and updates getPlatform to resolve IDs before lookup.
Icon lookup and availability API
src/core/index.ts
getIconData resolves the incoming platform ID before indexing iconDataMap, and new hasPlatformIcon helper checks whether a platform identifier resolves to icon data.
SVG viewBox extraction logging
src/core/svg.ts
extractViewBox now logs a warning when viewBox is missing, instead of silently falling back to the default.
Platform resolution and icon lookup tests
src/core/platforms.test.ts
Tests verify resolvePlatformId behavior with canonical IDs, aliases, and slug normalization; getPlatform resolution; getIconData alias handling; and hasPlatformIcon icon availability reporting.
Public API documentation
README.md
Documents new resolvePlatformId and hasPlatformIcon exports, and adds PlatformId to the Types import example.

Sequence Diagram(s)

N/A — the changes do not meet the conditions for a sequence diagram (primarily data structure updates, lookup optimization, and supporting logic without new multi-component workflows).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit hops through aliases bright,
Normalizing slugs to canonical light,
Icons found by path and name,
With warnings logged, no silent game!
Great Pods and Netflix join the fray,
Platform resolution leads the way! 🎵

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nathangathright nathangathright force-pushed the codex/add-platform-icons-and-aliases branch from 122874b to 0d658f0 Compare May 18, 2026 02:26
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

Icon Preview

Built from 0d658f0view all static assets

greatpods (added)

Before After
Icon (new)
Badge (light) (new)
Badge (dark) (new)

netflix (added)

Before After
Icon (new)
Badge (light) (new)
Badge (dark) (new)

github-actions Bot added a commit that referenced this pull request May 18, 2026
@nathangathright nathangathright marked this pull request as ready for review May 18, 2026 02:28
@nathangathright nathangathright merged commit 0a3d228 into main May 18, 2026
3 checks passed
@nathangathright nathangathright deleted the codex/add-platform-icons-and-aliases branch May 18, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant