Skip to content

Adapt the app for iPhone Duo - #172

Merged
simonhamp merged 54 commits into
NativePHP:mainfrom
cmcmanus96:duo-adaptive-layouts
Nov 24, 2026
Merged

simonhamp merged 54 commits into
NativePHP:mainfrom
cmcmanus96:duo-adaptive-layouts

Conversation

@cmcmanus96

@cmcmanus96 cmcmanus96 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Adapts the app to iPhone Duo, following Apple's guidance for its two displays.

  • Unfolded: in landscape the Log shows the feed beside the open commit, split at the fold; in portrait it stays one column. Profile reflows into two columns, and other screens use a centred readable column.
  • Folded: navigation and toolbar buttons move into the system's vertical bar, and scroll indicators sit at the screen edge.
  • Folding and rotating keep the open commit, drafts and scroll position.
  • Also: iPhone landscape is enabled, separators are inset, and some VoiceOver labels are fixed.

Android is unchanged apart from the Remotes empty-state wording.

NativePHP changes

The NativePHP fixes this needs are merged upstream in NativePHP/mobile-air#705 and NativePHP/mobile-ui#217, so there are no patches. The branch locks nativephp/mobile and nativephp/mobile-ui to their main, as main does.

It also updates the conversation screen's navigate() and back() to match nativephp/mobile 4.8, which otherwise stops the app starting.

Testing

  • Full suite: 1,900 passed, 38 skipped. The skipped tests need the paid Skia and Secure Storage plugins, or ssh-keygen.
  • Re-checked on the iPhone Duo simulator against both packages' main: rotating, folding and unfolding all look right.
  • Checked on the iPhone Duo simulator, a physical Duo (iOS 27.3), an iPhone 17 simulator and a Pixel 9 emulator.
  • Not verified: the half-open pose and inner-display portrait, which the simulator can't drive, and the Skia game shortcut.

Screenshots

  • No visible change

iPhone Duo simulator (iOS 27.2) and Pixel 9 emulator. log, profile and remotes are unfolded; log-folded is the outer display.

log

iOS light iOS dark Android light Android dark
Before
After

log-folded

iOS light iOS dark Android light Android dark
Before
After

profile

iOS light iOS dark Android light Android dark
Before
After

remotes

iOS light iOS dark Android light Android dark
Before
After
Earlier rounds

Split-view and conversation captures use f2ff64e; toolbar captures use 56a57fa (before: f2e38d0). Earlier before images show an intermediate contribution build, not upstream; its exact commit is unknown. Android captures and some dark before images are unavailable.

Landscape split view

Before (light) After (light) After (dark)

Portrait conversation

Before (light) After (light) After (dark)

Landscape → portrait → tap Back to Log: light video · dark video.

Toolbar alignment
Appearance Before After
Light
Dark
Composer, rail and shared-header follow-up

Composer recordings use 1188ded; rail captures use ea3f91a.

Composer swipe dismissal: before · after light / dark.

Screen Before (light) After (light / dark)
Search
Notifications

Shared header surfaces (b143b20); Profile/Remotes before images are user-provided header crops.

Screen Before (dark) After (dark)
Notifications
Remotes
Profile

Light captures: Notifications, Remotes, Profile.

Separator sweep

After captures use b32201b; before images are user-provided crops (New commit: dark; New remote/New org: light).

Screen Before After (light / dark)
New commit
New remote
New org
Ordinary-iPhone keyboard validation

iPhone 17 simulator, iOS 26.5, b32201b; unsent Reply retains text and caret through rotation and stays above the keyboard. This does not verify the Duo rail or folding transitions.

Orientation Light Dark
Portrait
Landscape

ampagent and others added 30 commits November 4, 2026 21:27
On a window of at least 840pt (an iPhone Duo's inner display held sideways)
the log, notifications, remotes, profile, search and commit pages draw their
lists in a centred 672pt column instead of running across the whole display,
and onboarding puts the lockup and the sign-in actions side by side. Narrower
windows, including the closed display, keep the full-width layouts.

The column takes a fixed expanded width rather than max-w: EDGE stretches a
w-full child across its parent regardless of items-center, and its scroll-view
lays children out leading, so the commit page wraps its column in a centring one.

Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1a7bf-8563-75c2-9973-a03b3476f392
On an iPhone Duo the system's rail and status column give a horizontal
pager a trailing safe-area inset. NativeUIPagerRenderer sized pages by the
ScrollView's width but measured progress against visibleRect, which takes
in the inset, so the tab underline lagged further behind each later tab,
landscape Notifications could select the wrong filter, and the next page
drew under the rail.

Apply a patch to nativephp/mobile-ui 0.9.0 through cweagans/composer-patches:
divide by the ScrollView's bounds width and clip the pager's sides only,
leaving the bottom extension under a tab bar and vertical pagers as they
were.

Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1a7bf-8563-75c2-9973-a03b3476f392
Preserve the side-inset width and clipping fixes while reconciling horizontal pager geometry after background resizing. Retain recovery through tracking, accept genuine inactive swipe completion, and reconcile late native acknowledgements without overriding newer selection intent.

Validated exact cand12 renderer SHA1: 5659b5b4395cdb01f710483cf2f7a2b79683d654. Independent Astra source and native-evidence review found no additional concrete blocker. Controlled iOS 27.2 lifecycle races, clean Log/Profile warm resume, 30 extracted-handler checks, and the PHP suite were verified. Physical iOS 27.3 and active fold/rotation retention remain unverified.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ac67-a129-7066-90e3-bf362ac34436
Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Classify geometry before selection reporting and retain resize intent across late clamps with bounded, cancellable corrections. Preserve warm-resume recovery and side-inset paging fixes.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ac67-a129-7066-90e3-bf362ac34436
Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Use an iOS adaptive native host with stable conversation slots, compact navigation, pane-local composer insets and revision-checked native commands. Coordinate retained panes for outbox settlement, optimistic stars, deletion and failed-draft recovery without duplicating side effects.

Preserve exact attached child receivers for async completion through a focused mobile patch. Cover retained state, stale commands, shared writes and recovery/resubmission with component regressions.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ac67-a129-7066-90e3-bf362ac34436
Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Preserve the Duo readable-column constant alongside the upstream timezone fix, and retain both dependency sets with a Composer-generated combined content hash.

Duo workspace and display checks pass (58 tests). Eight new upstream Remotes pan API tests also fail on an unchanged upstream control with the same locked packages; they remain intact and recorded separately.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ac67-a129-7066-90e3-bf362ac34436
Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Recover malformed native tab-container layout after transitions, preserve retained-page geometry, and add unselected conversation guidance with background-only bottom coverage.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ac67-a129-7066-90e3-bf362ac34436
Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Preserve keyboard avoidance and retained control insets while allocating the full container to the adaptive workspace.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ac67-a129-7066-90e3-bf362ac34436
Co-authored-by: Connor McManus <cmcmanus@termbid.com>
Who they are, their activity and their level scroll in a leading column and
the tabs and their commits in a trailing one, with the gap centred on the
fold. The closed display keeps the single column.
The split now changes mode on the horizontal size class instead of a
width breakpoint and an orientation check, and parts its columns on the
fold's division region, an even split when no region crosses it.

The workspace fills the window, so UIKit no longer suppresses the
vertical bar for its navigation controllers: on the outer display the
Log's search and compose and a commit's back button move into the
trailing bar like every other screen. Each column measures its own
horizontal safe area, since a navigation controller passes the window's
insets to pages that never reach the bar.

The feed row whose conversation is open beside it is selected, the
split drops its Close button, and the empty detail is a themed EDGE
placeholder with an icon, title and hint.
…ar's readable column, and label the muted sheet button on its circle

Android resolves a percentage against the parent, so the 40% variant shrank
its lockup; it is iOS-only now. Android seats a bottom bar's root at the
leading edge, so the reply bar keeps a full-width root and centres a readable
child. An a11y-label on a stack already hides its children from VoiceOver, so
the muted sheet button needs no wrapper.
The hinge handler re-read layout only when the hinge status changed,
assuming the division region turns active at the same moment. It now
compares the fold gap with the one last applied and lays out only when
it differs.

The placeholder tag shares the detail renderer instead of a copy, the
safe-area comment describes the vertical bar as observed behavior, and
the selected-row docblocks cover the stacked layout too.
The two-column profile drew the header twice, a hidden copy for each
layout, so every profile, phones included, sent it twice on every render
and every ref in it appeared twice. The pager now draws its own header
beside the pages from the `expanded` breakpoint up (iOS), splitting at the
fold it reads from reservedRegions, or evenly without one, so the header
is in the tree once and the 11:9 weights and the hairline go away.
Android keeps the header above the tabs.
The workspace parted its columns at the unrounded middle of a display without a fold, while the pager rounded it. Both now round, and each copy of the fold rule names the other, since the app's plugin shouldn't depend on a symbol a vendor patch adds.
The division region can turn active just after a hinge update, which left the columns parted at the flat fold until something else laid them out.
@cmcmanus96 cmcmanus96 changed the title Add adaptive iPhone Duo layouts and retained feed conversations Adapt the app for iPhone Duo Nov 8, 2026
@cmcmanus96
cmcmanus96 marked this pull request as ready for review November 8, 2026 04:42
Regular width alone split the unfolded display in portrait into two
skinny columns. Like Apple's arrangements, weigh the window's aspect
ratio as well: only a window wider than it is tall gets the split.
@simonhamp

Copy link
Copy Markdown
Member

This is excellent 🙏🏼 we'll need those patches upstream before this can get merged

It made a screen with a hidden nav bar ignore the top safe area, so a
nested navigation bar stayed tappable after the Duo rotated or folded.
With the current adaptive-layout code it isn't needed: without it, the
feed's Search button and a pushed commit's back button still take taps
3pt inside their top edge after rotating and after folding.

Upstream, it would have moved every hidden-nav-bar screen under the
status bar in every NativePHP app, so it is not proposed there either.
@cmcmanus96

Copy link
Copy Markdown
Contributor Author

Thanks Simon! The patches are now upstream PRs:

I've dropped the fifth patch, the hidden nav bar hit area. With current main and this branch, I couldn't reproduce the bug it fixed: every nested nav bar control still takes taps at its top edge after rotating and folding the Duo.

Once those are released, I'll remove the remaining patches and cweagans/composer-patches, and move this branch to the new versions.

@voshond

voshond commented Nov 18, 2026

Copy link
Copy Markdown

+1! Looking forward to this.

@simonhamp

Copy link
Copy Markdown
Member

@cmcmanus96 The PRs are merged into main on each. Can you check that this PR works with them there before I release?

…o duo-adaptive-layouts

Upstream moved nativephp/mobile and nativephp/mobile-ui to dev-main
(NativePHP#171). The lock is upstream's, with composer-patches and the
adaptive-layout path package added back by a targeted update.
adaptive-layout now also accepts mobile-ui dev-main, which has no
branch alias, so it no longer conflicts with the root requirement.
… conversation screen

NativeComponent::navigate() and back() gained a $transition parameter in nativephp/mobile 4.8.0, so the old overrides no longer match the parent and the app fails to boot.
NativePHP/mobile-air#705 and NativePHP/mobile-ui#217 are merged, so the branch locks nativephp/mobile and nativephp/mobile-ui to their main (mobile-air db7d5db, mobile-ui 3a6096d) instead of patching older commits, and drops the patches and cweagans/composer-patches.
@cmcmanus96

Copy link
Copy Markdown
Contributor Author

Thanks Simon! Yes, it works with both merged into main.

I've brought this branch up to date with main and taken out all the patches, so it now uses the packages' main like the rest of the app. Tests pass, and I tried everything again on the iPhone Duo, including rotating, folding and unfolding. It all looks good.

One heads-up while I was in there: the newest nativephp/mobile (4.8) changed navigate() and back() slightly, and the conversation screen hasn't caught up, so the app won't start on 4.8. You're not seeing it on main because it's still on an older version. I've put the small fix in this PR.

@simonhamp
simonhamp merged commit 42a22cf into NativePHP:main Nov 24, 2026
simonhamp added a commit that referenced this pull request Nov 24, 2026
Brings in #172, the Duo workspace.

A rejected commit is sent to every pane through broadcastOutboxChange, then
checkOrganizations runs once for the pane that sent it. Deleting keeps the
workspace's conversationDeleted and the org refresh when a delete fails.

commit-detail: main put the thread in a readable column inside the scroll
view. Here the rows have to stay the scroll view's own children for
auto-scroll-to, so the readable width goes on the thread stack instead, centred
in a surface column. The reply bar's readable column sits inside reply-rows, so
the iOS tint stays full width. The embedded clearance from main is kept.
Tests that read reply-rows' children now read reply-content.

conversation keeps this branch's composer bar, which has no hairline for main's
border fix to apply to. thread-reply keeps the $hairline condition with main's
border-b line.

FeedWorkspaceTest tapped reply-expand, which this branch removed when the bar
took over photos and preview. The rejected-sheet test now opens a quote of the
conversation's commit instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp added a commit that referenced this pull request Nov 24, 2026
Brings in main (a58df59), the Duo workspace from #172 (42dd4d4) and the
dependency update (d122e60), which puts mobile-ui#227 in the lock.

commit-sheet keeps this branch's layout: no scroll view, the field
filling its slot, and the mention list floating by the caret. From the
base it takes the guild composer and the hairlines drawn with border-b.
The guild placeholder goes on the field. The "Posted to this guild" line
goes first in the slot under the field, so it counts towards that slot's
padding. Guilds are left out of $offersIssues, which hides the issue
commands and the hint as the base did.

commit-detail takes the base's reply-content column, which holds the
readable width inside reply-rows, with #203's 8pt gap under the mention
list on iOS. #203's edge blur and fade row changes merged on their own.

CommitDetailTest and ConversationTest both had new tests added at the
end on each side, so they keep all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

4 participants