Skip to content

refactor(isIOS, isAndroid): prefer userAgentData for platform detection - #573

Closed
rjsgud49 wants to merge 1 commit into
toss:mainfrom
rjsgud49:refactor/platform-user-agent-data
Closed

rjsgud49 wants to merge 1 commit into
toss:mainfrom
rjsgud49:refactor/platform-user-agent-data

Conversation

@rjsgud49

Copy link
Copy Markdown
Contributor

Summary

  • Add internal testUserAgent / testPlatform helpers that prefer navigator.userAgentData and fall back to legacy navigator.platform / navigator.userAgent
  • Migrate isIOS and isAndroid to those helpers while keeping the public userAgent?: string API, SSR behavior, and the iPadOS (Mac + maxTouchPoints) heuristic
  • Update tests, English docs, translations (ko / ja / zh-Hans / es), and the agent skill references

Closes #356

Out of scope

New public utils (isMac, isIPhone, isIPad, …) are left for a follow-up so this PR stays reviewable.

Test plan

  • vitest run for _internal/platform, isIOS, isAndroid (29 tests)
  • Coverage 100% on changed runtime files
  • yarn typecheck in packages/react-simplikit
  • CI on this PR

Made with Cursor

Use Client Hints when available and keep legacy UA/platform fallbacks,
including the existing iPadOS touch heuristic. Closes toss#356.
@changeset-bot

changeset-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 733a3bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-simplikit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hyesungoh

Copy link
Copy Markdown
Member

Thanks to your contribution.

please check closed issue comment #356

@hyesungoh hyesungoh closed this Oct 20, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8ead31d) to head (733a3bf).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #573   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           69        72    +3     
  Lines         2281      2306   +25     
  Branches       737       752   +15     
=========================================
+ Hits          2281      2306   +25     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyesungoh

Copy link
Copy Markdown
Member

[fyi]
Closes #356 closes the issue automatically when this PR is merged

But even if we went ahead with that issue, this PR would only cover part of it, so Closes isn't the right keyword here.
Please keep this in mind for later works. When a PR only covers part of an issue, Refs #356 links it without closing it.

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.

refactor(mobile): modernize platform detection APIs with userAgentData

3 participants