Skip to content

feat(web): 3D bodies for iPhone 14 through 17 and iPhone Air - #27933

Open
Kaloyanes wants to merge 2 commits into
pingdotgg:mainfrom
Kaloyanes:feat/device-models-iphone-14-17
Open

Kaloyanes wants to merge 2 commits into
pingdotgg:mainfrom
Kaloyanes:feat/device-models-iphone-14-17

Conversation

@Kaloyanes

Copy link
Copy Markdown

Split from #26884 as asked there: this PR is only the new model catalog. The renamed-simulator fix is #27932. Neither depends on the other.

The 3D view only had bodies for iPhone 18 Pro, 18 Pro Max, Duo, and iPad Pro 13-inch (M5). Every other iPhone simulator fell back to the generated slab.

Models. resolveDeviceModelId is now one name table. I converted Apple's AR files from the iPhone compare page with the existing scripts/convert-device-model.py:

  • New: 17 Pro and Pro Max, 17, Air, 17e, 16 Pro and Pro Max, 16 and 16 Plus, 15 and 15 Plus, 14 and 14 Plus.
  • Mapped to an existing body: 14 Pro and 15 Pro use 16 Pro (same back and screen aspect), 16e uses 17e, and iPad Pro 13 M4 uses M5.

Each entry in sources.json records the source URL, checksum, chosen body and screen nodes, and Blender version. The converter gained excludeNodes because the Air's source file stacks every colour variant's back glass.

Size (commit by @DominikScholz, from Kaloyanes#12). All 18 models compress from 39.9 MB to 12.0 MB (8.3 MB gzipped) with meshopt on one scene-wide 16-bit grid, plus removal of 478 parts that never change a pixel. The loader decodes meshopt and bakes display transforms back to float geometry. That commit also fixes z-fighting on the iPhone 16 and 16 Plus camera glass. It recompresses the five existing models too, so they need the new loader to ship together with them.

Tradeoffs for maintainers:

  • Repo size: the models folder is 12 MB. Only the matching GLB downloads, and only when 3D view opens.
  • License: these are Apple assets with no redistribution license, the same status sources.json already records for the existing five.

Evidence

Blender renders of the converted models (front and back):

17 Pro, 17 Pro Max, 16 Pro, 16 Pro Max, 16, 16 Plus
15, 15 Plus, 14, 14 Plus
iPhone 17
iPhone Air
iPhone 17e

Compression before/after renders are in Kaloyanes#12. Close-up renders average 0.06/255 per pixel against the originals.

Checks:

  • vp test run packages/client-runtime/src/device/model.test.ts packages/client-runtime/src/device/modelScene.test.ts: the name table rows, and a quantized display accepted once its transform is baked.
  • vp run check:changed: format, lint, knip, typecheck, tests, and react compiler pass.

Not checked: the new models live in the app; I only had iPhone 18 Pro simulators booted. Android is unchanged. Mobile has no 3D viewer.

Model: Claude Opus 5.5 in Claude Code (T3 Code); compression by DominikScholz with Claude Opus 5.5.

Kaloyanes and others added 2 commits October 31, 2026 03:32
The 3D view only had bodies for iPhone 18 Pro, 18 Pro Max, Duo, and iPad Pro
13-inch (M5); every other simulator fell back to the flat view. This adds
Apple's AR models for iPhone 14 through 17, 17e, and Air, and maps the
hardware names that share a body (14/15 Pro onto 16 Pro, 16e onto 17e,
iPad Pro M4 onto M5).

Done with Claude Opus 5.5 in T3 Code.
The 18 device GLBs were 39.9 MB (22.3 MB gzipped), almost all
uncompressed geometry, and the iPhone 16 and 16 Plus camera glass
z-fought with the layer beneath it.

- Compress geometry with EXT_meshopt_compression on one scene-wide
  16-bit grid. Per-mesh grids round Apple's coincident layers apart and
  z-fight. The loader registers three's MeshoptDecoder and bakes display
  meshes back into float model-space geometry, which the screen checks,
  UVs and touch projection need.
- Drop 478 parts that never change a pixel (sources.json hiddenNodes).
- Push the iPhone 16 and 16 Plus glass shells 0.0003 units outward
  (sources.json surfaceOffsets) so they stop crossing the base layer.

The converter applies both new fields; docs/internals/devices.md records
the pipeline constraints. Models now total 12.0 MB (8.3 MB gzipped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 31, 2026 01:35
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T01:35:26.564850Z
We couldn’t complete this review. Comment @codex review to try again.
e8d0743 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Oct 31, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Newly recognized iPhones automatically use bundled 3D bodies instead of the procedural fallback, alongside compressed updates to existing models. Human confirmation is required for this change to the default device presentation.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e9a11d4 and e8d0743.

Files selected for processing: 26
  • apps/web/src/components/device/deviceModels.ts
  • apps/web/src/components/device/models/ipad-pro-13-m5-magic-keyboard.glb
  • apps/web/src/components/device/models/ipad-pro-13-m5.glb
  • apps/web/src/components/device/models/iphone-14-plus.glb
  • apps/web/src/components/device/models/iphone-14.glb
  • apps/web/src/components/device/models/iphone-15-plus.glb
  • apps/web/src/components/device/models/iphone-15.glb
  • apps/web/src/components/device/models/iphone-16-plus.glb
  • apps/web/src/components/device/models/iphone-16-pro-max.glb
  • apps/web/src/components/device/models/iphone-16-pro.glb
  • apps/web/src/components/device/models/iphone-16.glb
  • apps/web/src/components/device/models/iphone-17-pro-max.glb
  • apps/web/src/components/device/models/iphone-17-pro.glb
  • apps/web/src/components/device/models/iphone-17.glb
  • apps/web/src/components/device/models/iphone-17e.glb
  • apps/web/src/components/device/models/iphone-18-pro-max.glb
  • apps/web/src/components/device/models/iphone-18-pro.glb
  • apps/web/src/components/device/models/iphone-air.glb
  • apps/web/src/components/device/models/iphone-duo.glb
  • apps/web/src/components/device/models/sources.json
  • docs/internals/devices.md
  • packages/client-runtime/src/device/model.test.ts
  • packages/client-runtime/src/device/model.ts
  • packages/client-runtime/src/device/modelScene.test.ts
  • packages/client-runtime/src/device/modelScene.ts
  • scripts/convert-device-model.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The change adds source and runtime support for additional device models. It expands hardware-name resolution and web asset registration, adds meshopt conversion and decoding, and bakes display-mesh transforms into float geometry.

Changes: Device model assets and runtime support

Layer / File(s) Summary
Model source catalog and conversion
apps/web/src/components/device/models/sources.json, scripts/convert-device-model.py, docs/internals/devices.md
The source catalog adds model metadata and node mappings. The converter filters configured hidden nodes and applies surface offsets. The documentation describes the conversion and runtime handling of quantized display meshes.
Model IDs and asset registration
packages/client-runtime/src/device/model.ts, packages/client-runtime/src/device/model.test.ts, apps/web/src/components/device/deviceModels.ts
The runtime resolves supported iOS hardware names through a case-insensitive mapping and strips trailing memory suffixes. The web catalog registers assets for additional iPhone models. Tests cover mapped and unmatched names, including an Android case.
Quantized scene loading and display transforms
packages/client-runtime/src/device/modelScene.ts, packages/client-runtime/src/device/modelScene.test.ts
The loader configures MeshoptDecoder and bakes display-mesh transforms into float geometry. Tests check the resulting position attribute type and UV value.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant loadDeviceModel
  participant GLTFLoader
  participant MeshoptDecoder
  participant bakeDisplayTransforms
  loadDeviceModel->>GLTFLoader: Configure MeshoptDecoder
  GLTFLoader->>MeshoptDecoder: Decode meshopt data
  GLTFLoader-->>loadDeviceModel: Return parsed scene
  loadDeviceModel->>bakeDisplayTransforms: Bake display transforms
Loading

Possibly related PRs

  • pingdotgg/t3code#26884: Adds the initial hardware-type model selection and model-loading support that this change expands.
  • pingdotgg/t3code#12787: Introduces the device workspace and imported phone-scene loader used by this change.
  • pingdotgg/t3code#12813: Adds the iPhone Duo model and shared viewer; this change updates the shared imported-asset pipeline.

Suggested reviewers: juliusmarminge, t3dotgg

Merge Risk: Minimal · up to e8d07

The model catalog and loader changes have no established merge blocker. Visual behavior of the new models remains unverified in the running app.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: adding 3D device bodies for iPhone 14 through 17 and iPhone Air. Supporting loader, compression, and mapping changes do not need to appear in the title…
Description check Passed The description is mostly complete. It explains the problem, implementation, scope split, asset and license tradeoffs, evidence, verification commands, and unchecked scenarios. It uses different headi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly identifies the primary change: adding 3D device bodies for iPhone 14 through 17 and iPhone Air. Supporting loader, compression, and mapping changes do not need to appear in the title.

Full details: Description check

Explanation

The description is mostly complete. It explains the problem, implementation, scope split, asset and license tradeoffs, evidence, verification commands, and unchecked scenarios. It uses different headings from the template and does not state explicit maintainer approval, but the required context is otherwise present.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

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

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants