Skip to content

fix(web): size the Android fold model from the inner display - #13574

Merged
juliusmarminge merged 2 commits into
mainfrom
device/android-fold-sizing
Sep 25, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
device/android-fold-sizing

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #13534. The Android fold model used one fixed near-square body. That matches the Pixel 9/10 Pro Fold (2076×2152 inner display), but a natively landscape inner panel such as the first-generation Pixel Fold (2208×1840) was stretched onto it.

The fold scene now takes the inner display's aspect and builds the body, bezels, hinge and cover around it. The viewer reads that aspect from the unfolded raw frame. It keeps the last unfolded shape while the cover frame streams, and rebuilds the body at the visible hinge angle when a different inner shape arrives. UVs and touch mapping stay in raw-frame space, so no rotation is added.

Verification

  • Pixel 10 Pro Fold emulator in the web Device panel: unfolded 3D view matches the flat view, with round icons and no stretch.
  • New tests: the inner screen matches portrait (2076×2152) and landscape (2208×1840) frames, and the viewer widens the body for a landscape frame and keeps it through the cover frame. The viewer test fails without the change.
  • packages/client-runtime/src/device tests: 125 passed. Targeted lint and client-runtime TypeScript checks passed.

No landscape-panel emulator was available, so the 2208×1840 case is covered by tests only.

Visual evidence

Pixel 10 Pro Fold, unfolded (unchanged shape, no stretch)

Pixel 10 Pro Fold unfolded

UI-visible behavior only changes for landscape inner panels; the Pixel 10 Pro Fold renders as before.

Model: Claude Opus 5.5. Harness: Claude Code.

🤖 Generated with Claude Code


Devin Review

Summary by CodeRabbit

  • New Features
    • Android foldable phone displays now adapt to the aspect ratio of the source image, including wider landscape displays.
    • Fold display dimensions update when the source image changes, while preserving the current hinge angle and keeping the device model consistent during cover-frame updates.

The fold body used one fixed near-square shape, so a natively landscape
inner panel such as the first Pixel Fold's 2208x1840 was stretched onto
it. The viewer now builds the body from the unfolded frame's aspect and
keeps that shape through cover frames and hinge turns.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 25, 2026
Comment thread packages/client-runtime/src/device/androidFoldScene.ts Outdated
Comment thread packages/client-runtime/src/device/phoneViewer.ts Outdated
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.5 KiB +41 B (+0.3%) 15.1 KiB ✅
Codex Thread snapshot wire 7.1 KiB 7.1 KiB −2 B (−0.0%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.4 KiB 6.5 KiB +43 B (+0.7%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 56.2 KiB 56.3 KiB +44 B (+0.1%) 66.4 KiB ✅
Codex Live turn messages 9 10 +1 (+11.1%) 21 ✅
Claude Total thread wire 13.6 KiB 13.5 KiB −47 B (−0.3%) 15.1 KiB ✅
Claude Thread snapshot wire 7.1 KiB 7.1 KiB −7 B (−0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.5 KiB 6.4 KiB −40 B (−0.6%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 57.1 KiB 57.0 KiB −44 B (−0.1%) 66.4 KiB ✅
Claude Live turn messages 10 9 −1 (−10.0%) 21 ✅

Baseline: 0c84b42 · PR result: df583d6 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 114.0 KiB
  • Claude decoded thread snapshot: 114.7 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR changes Android fold previews from fixed geometry to source-derived geometry and introduces a new fallback default, affecting sizing, framing, cover rendering, and touch mapping. Because the product default behavior changes, the default geometry warrants human review despite the localized scope and added tests.

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

A landscape cover frame passed the inner-display check and widened the
closed model, and an unfolded frame seen before fold mode was ignored.
Bound the inner aspect range and record it from every frame.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: df18b75d-0ab0-46c5-83a6-48e127012660

📥 Commits

Reviewing files that changed from the base of the PR and between 0c84b42 and df583d6.

📒 Files selected for processing (4)
  • packages/client-runtime/src/device/androidFoldScene.test.ts
  • packages/client-runtime/src/device/androidFoldScene.ts
  • packages/client-runtime/src/device/phoneViewer.test.ts
  • packages/client-runtime/src/device/phoneViewer.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Android fold scene now sizes its geometry from an inner-display aspect ratio. The phone viewer derives that ratio from source-canvas dimensions and updates active fold scenes when a valid ratio changes.

Changes

Foldable display aspect

Layer / File(s) Summary
Aspect-driven fold scene geometry
packages/client-runtime/src/device/androidFoldScene.ts, packages/client-runtime/src/device/androidFoldScene.test.ts
The scene accepts an optional inner-display aspect and uses it to size the device panels, screens, camera, keys, and overall width. A test checks the continuous screen bounds against portrait and landscape frame aspects.
Viewer aspect updates and hinge angle
packages/client-runtime/src/device/phoneViewer.ts, packages/client-runtime/src/device/phoneViewer.test.ts
The viewer uses a valid source-canvas aspect or the default aspect when creating fold scenes. When the aspect changes on an active fold scene without an imported model, the viewer rebuilds the scene at its visible hinge angle. Tests check landscape sizing and body retention through cover-frame updates.

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant SourceCanvas
  participant PhoneViewer
  participant createAndroidFoldScene
  SourceCanvas->>PhoneViewer: Provide dimensions for aspect calculation
  PhoneViewer->>PhoneViewer: Validate aspect and read visible hinge angle
  PhoneViewer->>createAndroidFoldScene: Create or rebuild scene with aspect and angle
Loading

Merge Risk: ⚪ Minimal · up to df583

The foldable viewer appears ready to merge after normal checks; no actionable sizing or hinge-animation issue remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: sizing the Android fold model from the inner display aspect ratio.
Description check ✅ Passed The description explains what changed, why it changed, verification performed, test coverage, and visual behavior. It does not use every template heading or include a completed checklist, but it is su…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@juliusmarminge
juliusmarminge merged commit 7b84431 into main Sep 25, 2026
24 checks passed
@juliusmarminge
juliusmarminge deleted the device/android-fold-sizing branch September 25, 2026 05:14
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 25, 2026
## What's Changed
* feat(web): control Android foldables in the Device panel by @juliusmarminge in pingdotgg/t3code#13534
* fix(mcp): preview snapshots fit in the agent's tool output again by @t3dotgg in pingdotgg/t3code#13558
* fix(web): paste after clicking away from the composer lands in it again by @t3dotgg in pingdotgg/t3code#13553
* feat(desktop): keep running threads synced in the background by @t3dotgg in pingdotgg/t3code#13554
* fix(mcp): preview errors tell agents what to do instead by @t3dotgg in pingdotgg/t3code#13559
* feat(web): agents working banner links to the Agents panel by @t3dotgg in pingdotgg/t3code#13572
* fix(web): size the Android fold model from the inner display by @juliusmarminge in pingdotgg/t3code#13574
* fix(clients): a preview app no longer knocks the desktop's own server offline by @t3dotgg in pingdotgg/t3code#13577
* fix(web): keep nested task states out of parent bullets by @dominic-r in pingdotgg/t3code#11477
* feat(release): ship a Linux .deb that updates itself by @t3dotgg in pingdotgg/t3code#13575
* perf(desktop): cache compiled JavaScript between launches by @t3dotgg in pingdotgg/t3code#13501
* fix(dev): one t3.json setup action that works on every OS by @t3dotgg in pingdotgg/t3code#13589
* fix(web): new worktree threads no longer say "checkout" during setup by @t3dotgg in pingdotgg/t3code#13590
* fix(desktop): `t3 app` keeps working after a second desktop app quits by @t3dotgg in pingdotgg/t3code#13585
* fix(usage): price Claude fast-mode requests at the fast rate by @t3dotgg in pingdotgg/t3code#13599
* fix: update OpenAI logo to current brand asset by @aaditagrawal in pingdotgg/t3code#13611
* fix(mobile): render assigned project icons in chat list by @SunkenInTime in pingdotgg/t3code#12810

## New Contributors
* @aaditagrawal made their first contribution in pingdotgg/t3code#13611

**Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260925.2237...v0.0.43-nightly.20260925.2251

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260925.2251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant