Logo di Iphone Duo Capacitor

Iphone Duo Capacitor

Community
mirzaaghazadeh
iphone-duo-capacitor

Adapt a Capacitor or Ionic app to iPhone Duo, Apple's first foldable iPhone — why the standard Device Posture and Viewport Segments CSS does not reach a web view, what CSS gives you today, and how to get fold state, hinge angle and bar placement from the native side. Use when a Capacitor, Ionic, Angular, React or Vue app needs foldable iPhone support.

Panoramica

Pubblicato damirzaaghazadeh
Repositoryiphone-duo-skills
Nome della skilliphone-duo-capacitor
Stelle
188
Fork
9
File inclusi
Solo istruzioni
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da mirzaaghazadeh su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Iphone Duo Capacitor in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-capacitor
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mirzaaghazadeh/iphone-duo-skills.git /tmp/iphone-duo-skills
mkdir -p .claude/skills
cp -r /tmp/iphone-duo-skills/skills/iphone-duo-capacitor .claude/skills/iphone-duo-capacitor
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Iphone Duo Capacitor in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Iphone Duo Capacitor non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Iphone Duo Capacitor non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Capacitor on iPhone Duo

Start here, because it is the thing that will waste your afternoon otherwise:

WebKit 27.1 implements Device Posture and Viewport Segments, but both sit behind an experimental flag that only Safari can set.

A Capacitor app runs in a WKWebView it does not control the flags of, so navigator.devicePosture, the device-posture media query and the env(viewport-segment-*) variables are all absent there, while the same page in Safari on the same device can see them. Feature-detect rather than assume, and plan for both to be missing.

So the web platform gives you no fold awareness on this device out of the box. What it does give you is most of what matters. Work in two tiers.

Tier 1 — works today, no native code

Trust safe areas, and never assume symmetry

This is the one that produces real bugs. iOS moves its bars to one side of the display, and that side depends on the pose and the reading direction.

The bar arrives as a genuine safe-area inset: measured on the 27.1 simulator it is env(safe-area-inset-right) of 84px, and it moves to env(safe-area-inset-top) of 82px if the app opts out of vertical bars, live and without a reload. So most layouts need nothing more than honest env(safe-area-inset-*) padding on all four edges.

Any expression of the form width - env(safe-area-inset-left) * 2 is a defect on this device.

Resize correctly

The window changes size constantly: opening, closing, folding, rotating, Split View. Read sizes when you need them rather than caching, and prefer container queries and %/fr layout over stored pixel values. Anything measured in a useEffect or ngOnInit and kept will be stale within seconds.

Think in size classes, not device checks

iOS reasons about this device in size classes: the outer display is compact width, the inner display is regular width. Branch on the size you were given, never on a user-agent string or an orientation, since the inner display does not honour supported orientations.

Measured on the simulator: inner display 951×669 in landscape, outer display 466×678.

Move navigation to the side on the wide display

When iOS moves its own tab bars and toolbars to a vertical rail, an HTML tab bar pinned to the bottom looks unconverted next to every native app. A side rail on the inner display and a bottom bar on the outer one is the web analogue, and it costs one breakpoint.

Tier 2 — needs the native side

Everything genuinely iPhone Duo-specific is invisible to the web view until something native hands it over.

Native API (iOS 27.1)Why you want it in the web view
reservedRegions(kind:options:) on UIViewWhere the fold and the camera are, so layout can avoid them
UIHingeInteractionContinuous hinge angle, for effects and posture
verticalBarEdge on the trait collectionWhich edge iOS moved the bars to, so your own chrome matches
Size class from traitCollectionThe signal iOS actually uses, rather than your breakpoint guess

Two details worth knowing before you write any of this yourself. A flat phone's fold region is reported inactive, so reading it needs options: .includeInactive or you will conclude the device has no hinge. And UIHinge.status updates lazily, so it disagrees with the angle mid-fold; treat the angle as the truth when both are available.

Use the existing bridge

@erkamyaman/capacitor-foldable is an MIT plugin that already does this, and also fills in Device Posture and Viewport Segments so the standard CSS works in an app today:

bash
npm install @erkamyaman/capacitor-foldable
npx cap sync
typescript
import { Foldable, installFoldablePolyfill } from '@erkamyaman/capacitor-foldable';

await installFoldablePolyfill();

const fold = await Foldable.getFoldState();
await Foldable.addListener('foldStateChange', (state) => layout(state));

The polyfill sets --fold-left, --fold-width and friends on <html>, so a grid can put its gutter exactly on the crease rather than guessing. The same build covers Android foldables through androidx.window.

Deeper material lives in iphone-duo-capacitor-skills: the CSS patterns, the full API, Ionic specifics, and how to test on the simulator and on an Android emulator.

Ionic apps

Ionic's ion-tabs is HTML, so it stays at the bottom while native bars move. Two routes: a stylesheet that turns the tab bar into a side pill on the edge iOS chose, or @rdlabo/ionic-theme-ios27, which repositions existing ion-buttons, ion-button, ion-back-button and ion-tab-bar controls and projects them into native UI. The theme takes device state as input, so the two compose rather than compete.

What to do, in order

  1. Audit every safe-area expression for assumed symmetry. Most bugs die here.
  2. Stop caching sizes, and branch on the size you were handed.
  3. Give the wide display a real layout rather than a stretched phone one.
  4. Add the plugin, and feature-detect the standard APIs so the same build still works in a browser that has them.
  5. Only then reach for hinge angle effects, which are the smallest part of a good port.

Steps 1 to 3 need no native code and improve the app on tablets at the same time. Step 4 is the only iPhone Duo-specific part, and it cannot be tested without the Xcode 27.1 simulator.

For what the native APIs do and why, read ../iphone-duo-adaptive-layout/SKILL.md and ../iphone-duo-vertical-bars/SKILL.md — the design reasoning transfers directly even though the code does not.

Domande frequenti

Cosa fa la skill IA Iphone Duo Capacitor?

Adapt a Capacitor or Ionic app to iPhone Duo, Apple's first foldable iPhone — why the standard Device Posture and Viewport Segments CSS does not reach a web view, what CSS gives you today, and how to get fold state, hinge angle and bar placement from the native side. Use when a Capacitor, Ionic, Angular, React or Vue app needs foldable iPhone support.

Perché usare Iphone Duo Capacitor su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Iphone Duo Capacitor è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Iphone Duo Capacitor in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-capacitor. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Iphone Duo Capacitor?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Iphone Duo Capacitor?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Iphone Duo Capacitor: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Iphone Duo Capacitor è gratuita?

È pubblicata su GitHub da mirzaaghazadeh. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇