Skip to content

gterm: support iPhone Duo with size-class-driven layout - #45

Merged
madeye merged 1 commit into
mainfrom
feature/iphone-duo
Sep 15, 2026
Merged

madeye merged 1 commit into
mainfrom
feature/iphone-duo

Conversation

@madeye

@madeye madeye commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Apple's iPhone Duo (ships Oct 23 with iOS 27.1) reports regular x regular size classes on its inner display while its idiom stays .phone. gterm chose its layout purely by idiom, so an opened Duo would have shown the phone tab layout in a 669x951 pt window.

  • Layout rule (RootView.usesWorkspace): split-view workspace when the idiom is .pad or the window is regular in both size classes. Not horizontalSizeClass == .regular alone: Max-class iPhones are regular-width in landscape and must keep tabs. iPad behaviour is unchanged (the .pad short-circuit keeps narrow windows on the collapsing split view).
  • Fold handling: clear the workspace's utility sheet when leaving the workspace so unfolding does not re-present it; only the surface's current host may rebind onOpenURL / onKeyboardShortcut while the layout swaps.
  • Displays: replace the three UIScreen.main fallbacks with TerminalSurfaceView.displayScale (window scene screen, then traitCollection.displayScale) and re-sync on display-scale trait changes.
  • Tests: scripts/test-ipad-ui.py gains --device-type and --only-testing; the workspace tests skip themselves on tab layouts and gate XCUITest pointer events to iPad; new PhoneLayoutTests run on an iPhone 17 Pro Max and cover the regular-width-landscape rule plus, via a DEBUG-only -gtermForceWorkspaceLayout YES launch argument, the workspace branch on the phone idiom (sidebar, sheet, SSH connect, Command-W).
  • Docs: README, CLAUDE.md layout rule, and a refresh of the stale AGENTS.md testing notes.

No project.yml changes: orientations, device family, absent UIRequiresFullScreen, and the single scene are already right for the Duo.

Verification

  • Simulator app build: BUILD SUCCEEDED
  • gtermTests: 107 tests, 0 failures
  • scripts/test-ipad-ui.py (iPad Pro 11-inch M5): 3 passed, 2 phone tests skipped
  • scripts/test-ipad-ui.py --device-type "iPhone 17 Pro Max": 2 passed, 3 iPad tests skipped

Not in this PR (needs Xcode 27.1, not yet released)

Building with the iOS 27.1 SDK for full edge-to-edge use of the inner display, verifying fold/unfold with a live session on the Duo simulator, and a fold XCUITest once the SDK exposes a fold control.

https://claude.ai/code/session_011AGnzfZpK9Jvx13DcS97DZ

Pick the split-view workspace when the idiom is iPad or the window is
regular in both size classes, which is the iPhone Duo's inner display;
the outer display and Split View keep the phone tabs. Not regular width
alone: Max-class iPhones are regular-width in landscape and must keep
tabs. Clear the workspace utility sheet when folding so unfolding does
not re-present it, and let only the surface's current host rebind its
handlers while the layout swaps.

Replace UIScreen.main with a displayScale helper that follows the
display the view is on, and re-sync on display-scale trait changes.

Tests: the UI runner takes --device-type and --only-testing; workspace
tests skip on tab layouts and gate pointer events to iPad; new phone
layout tests on an iPhone 17 Pro Max cover the regular-width landscape
rule and, via a debug launch argument, the workspace branch on the phone
idiom ahead of the iPhone Duo simulator. Document the rule and refresh
the stale AGENTS.md testing notes.

Claude-Session: https://claude.ai/code/session_011AGnzfZpK9Jvx13DcS97DZ
@madeye
madeye merged commit 76c94f0 into main Sep 15, 2026
1 check passed
@madeye
madeye deleted the feature/iphone-duo branch September 15, 2026 08:31
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