Skip to content

feat(native): project foldable controls with SwiftUI - #214

Merged
rdlabo merged 35 commits into
feat/foldable-togglefrom
feat/native-foldable-shell
Sep 24, 2026
Merged

rdlabo merged 35 commits into
feat/foldable-togglefrom
feat/native-foldable-shell

Conversation

@rdlabo

@rdlabo rdlabo commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Project foldable tabs, back navigation, menu buttons, and eligible fixed-toolbar actions from the Web fallback to a native SwiftUI adaptive surface when iOS exposes a physical side rail.
  • Keep Ionic controls as the source of truth and forward native activation through the existing event, routing, and form-submit path.
  • Clip and hit-test the hosting surface to the physical Duo rail so Web content remains visible and interactive elsewhere.
  • Keep ion-menu, ion-modal, and ion-popover as independent surfaces.
  • Retain the Web projection on Web, Android, older iOS, older plugin versions, and supported iOS devices without a foldable rail.

Transition and ownership

  • Capture each toolbar control's foldable placement per routed-page epoch, and prehide rail-owned sources before Ionic's first transition paint. Text-only or opted-out controls stay on Web.
  • Disable Ionic's fixed back-button clone animation on foldable pages through the shared transition's optional predicate, for both Web and native projection. Ordinary iPhone transitions are unchanged.
  • Hand off suspension after the active projection retires, and resume prehide only after projection returns. Destroyed shells cannot be revived by stale suspension leases.
  • Ignore the Web projection observer's own marker and ARIA mutations while retaining content, class, and DOM updates.
  • The foldable-rail placement hint is optional and backward-compatible. SwiftUI owns adaptive placement and Liquid Glass; Ionic owns labels, icons, disabled and selected state, actions, and navigation.

Stack

  1. feat: support iPhone Duo with vertical bars #213 — Web-first foldable layout and controls
  2. This PR — Native-first SwiftUI ownership for controls relocated into the foldable rail
  3. ionic-theme-utils#3 — shared transition opt-out, pinned until merged

Base: feat/foldable-toggle

Verification

  • Theme TypeScript/CSS build and lint passed.
  • 83 related Playwright E2E tests passed, including foldable handoff, back navigation, layouts, animations, and Native UI Shell.
  • iPhone Duo iOS 27.1 simulator native rail UI test passed; transition video checked for the removed back-button clone.
  • Shared utils: 16 unit tests, build, lint, format, and CI passed.
  • Self, senior, independent acceptance, and OSS review cycles completed with no remaining findings.

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 3 potential issues.

Devin Review

Comment thread src/native/components/index.ts Outdated
Comment thread ios/Sources/IonicNativeUIShellPlugin/IonicNativeUIShellPlugin.swift Outdated
@rdlabo

rdlabo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Review cycle completed.

  • Self-review: confirmed the tests are split by contract (DOM/native ownership, Swift state reconciliation, and real Duo interaction) without duplicating route screenshot coverage.
  • Senior review: requested clearer ancestor/element opt-out and ordinary-fill ownership boundaries; fixed and re-reviewed to approval.
  • Independent acceptance review: found the missing non-Duo capability boundary and combined status accounting. Added an explicit native foldableRail capability, retained Web projection when unavailable, preserved ordinary native controls, and fixed the public status aggregation. Re-reviewed to approval with no remaining findings.
  • Validation: lint and TypeScript/CSS build passed; Native UI Shell Playwright suite 69/69 passed; Swift package tests on iPhone Duo Simulator 23/23 passed.

The fallback test verifies native non-ownership, visible/operable Web back and tab controls, and the public projected-count contract. Commit: 69bdf05.

@rdlabo
rdlabo changed the base branch from feat/foldable-back-button to feat/foldable-toggle September 22, 2026 08:48
@rdlabo
rdlabo merged commit 7451754 into feat/foldable-toggle Sep 24, 2026
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