main, the app shell
The single root element: how it turns the route table into navigation stacks, sheets and the tab bar, and where the app's tint is set.

main is the root of the whole interface. There is exactly one, in the view of the root App component (app.contract L743-L942). It holds every screen of every tab and the tab bar, and it is where iOS learns which screen is on top, how to go back, where links go, and what colour the app is.

What the shell contributes, none of it drawn by a screen: the Back button, the bar capsules, the tab bar with "Read" selected, and the teal tint. The capture is older: the title is now large and the bar has an "Open site" button.

The root line

main navigationKey=`${top(nav).id}` navigationBack="back" navigate=follow testId="app" width="100%" height="100%" accent-color="brand" display="flex" flex-direction="column"

Attribute

Meaning for the person using the app

navigationKey

Names the screen currently on top. When it changes, iOS animates a push, a pop or a sheet

navigationBack="back"

The control with id="back" on a screen is its way back. A swipe down on a sheet presses it, so Cancel and the swipe do the same thing

navigate=follow

Every link, the system Back, and deep links from outside the app arrive at one action, which goes to the location

accent-color="brand"

The app's tint: tab selection, plain button titles and symbols in buttons. One token, brand, defined in app.tamber (Color and tokens)

width, height, display, flex-direction

The shell fills the window: screens above, tab bar below

What is inside

graph TD M["main"] --> P["column: the panels"] M --> T["row role=tablist"] P --> TP["column role=tabpanel, one per tab"] TP --> S["one screen component per stack entry"] T --> B["4 button role=tab: Read, Activity, Agents, Me"]

    Panels. A column holds one column role="tabpanel" per tab. Inside each, one screen component is rendered for every entry of that tab's stack, chosen by route name (app.contract L746-L929). Covered screens stay alive, so going back restores scroll position and drafts.

    Tab bar. A row role="tablist" of four button role="tab", each an image "symbol:…" over a text: book "Read", notifications "Activity", sparkles "Agents", person "Me" (app.contract L930-L942). iOS draws it as the system tab bar. The app sets no height, colour or background on it.

What each screen adds

Every screen component's own root is a column that reports to the shell:

Attribute on the screen's root

Uses

Effect

navigationKey=eid

24

Identifies this screen in the stack

navigationScroll

22

Names the screen's scroller, so the bar's large title collapses with it

navigationPresentation="modal"

10

Presents the screen as a sheet

interactive-widget="resizes-content"

2

Thread and Agent session: the screen shrinks when the keyboard opens, so the composer stays above it

The ten sheets: Open site, Directory, Compose comment, New agent, Providers, Agent server, Create identity, Import identity, Edit profile and Connect vault. The other 13 screens are tab roots or pushes (Every screen).

What the platform contributes

With only those attributes written, iOS supplies: the tab bar and its selection state, a separate stack per tab that survives switching tabs, push and pop animations, the Back chevron and edge swipe, sheet presentation with rounded corners and swipe to dismiss, the navigation bar (bars), safe areas, and the tint everywhere. On a wide web window the same tab list becomes a sidebar; that is outside this documentation's scope.

Used by

main is written once and contains everything. All 23 screen components are rendered inside it, plus one inline test fixture route (agents-test) that is not product UI.

Where it is written

main

the root App component (app shell and the test fixture route)

1

Total

1

Rules for use

    A new screen is a new route rendered in the route switch, never a block swapped in by a condition. That is what gives it a Back button, a URL and its own scroll position.

    A form over a screen is a route with navigationPresentation="modal", with its dismiss control marked id="back" (Stacks, pushes and sheets).

    Do not set the tint anywhere else. Screens use brand for painted content only.

    Do not style the tab bar or add a fifth tab without a product reason: four top-level jobs are the app's structure (The four tabs).

    Do not hide the tab bar per screen. In the built app it stays visible on every pushed screen and is covered only by sheets.

Why

DESIGN.md: "Four tabs, each with its own stack ... Sheets are routes with navigationPresentation=\"modal\"", replacing the React Native app's single stack (What changed from the React Native app and why). Declaring structure and letting iOS draw it is the first principle in its purest form (Leave it unsaid).

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime