Navigation is one router value, nav, declared by routes nav in the root contract. It has four tabs, each with its own stack of entries. Every screen is a route. Sheets are routes whose screen root carries navigationPresentation="modal".
Route table
Tab | Route | Path | Screen component | Presentation |
|---|---|---|---|---|
read |
|
|
| tab root |
read |
|
|
| pushed |
read |
|
|
| modal |
read |
|
|
| modal |
read |
|
|
| pushed |
read |
|
|
| pushed |
read |
|
|
| pushed |
read |
|
|
| modal |
activity |
|
|
| tab root |
activity |
|
|
| pushed |
agents |
|
|
| tab root |
agents |
|
|
| modal |
agents |
|
|
| modal |
agents |
|
|
| pushed |
agents |
|
|
| pushed |
agents |
|
|
| modal |
agents |
|
| inline fixture screen | pushed, unlinked |
me |
|
|
| tab root |
me |
|
|
| pushed |
me |
|
|
| modal |
me |
|
|
| modal |
me |
|
|
| pushed |
me |
|
|
| modal |
me |
|
|
| pushed |
me |
|
|
| modal |
The presentation column was read from each screen's root node in the package contracts. Route order matters where patterns overlap: /agents/new and /agents/server are declared before /agents/:id. DESIGN.md has an older map with path patterns that no longer match the code (inferred from comparing the two); trust the table above.
flowchart LR
subgraph Read
r["read /"] --> d["doc"]
d --> th["thread"]
d --> cm["comments"]
d --> au["author"]
d -. sheet .-> co["compose"]
d -. sheet .-> di["directory"]
r -. sheet .-> os["open-site"]
end
subgraph Activity
a["activity"] --> ae["activity-email"]
end
subgraph Agents
g["agents"] --> ag["agent"]
ag --> s["session"]
g -. sheet .-> na["new-agent"]
g -. sheet .-> pr["providers"]
g -. sheet .-> asv["agent-server"]
end
subgraph Me
m["me"] --> id["identity"]
m --> sv["server"]
m --> v["vault"]
id -. sheet .-> pe["profile-edit"]
m -. sheet .-> cr["create"]
m -. sheet .-> im["import"]
v -. sheet .-> vc["vault-connect"]
end
a -- "open row" --> thStacks per tab
nav.tabs is the list of tabs, each with a name and a stack of entries. An entry has id (unique per visit), name (the route) and params. The view loops over every tab and every entry, so all stacked screens stay mounted and each tab keeps its place when the user switches away. Router functions used in the contract, as defined in Exact's contract-grammar.md:
Call | Effect |
|---|---|
| The visible entry. |
| Entries of the selected tab's stack |
| Adds a visit on the selected stack |
| Goes to the location wherever it is: the top, a pop on the selected stack, another tab whose top it is, or else a push |
| Pops one entry |
| Shows another tab |
| The top visit takes the location and keeps its id |
| Builds a location from a route name, encoding the parameter |
| Reads a query parameter of an entry |
The root node declares navigationKey=top(nav).id, navigationBack="back" and navigate=follow. Each screen root repeats navigationKey=eid so the native host knows which screen is which, and most add navigationScroll to name their scroller. The platform back button, edge swipe and sheet swipe down all arrive at the navigate handler with the location beneath.
The shared actions
pick, follow and back are the only lead-owned actions. pick(name) is bound to the tab bar buttons. follow(url) is nav = go(nav, readScopedHref(url, readContextServer)): it is the navigate handler, and it is passed to DocScreen so links inside documents stay on the server of the page being read. Deep links explains the rewrite.
Cross-tab navigation
Activity to Read: activityOpenRow marks the event read, selects the read tab, then goes to the row's href. A comment href gains ?from=activity. readContextRef treats such a thread as a new reader context on the configured server, and Back restores the covered one. Tested by open-site-activity.test.contract.
Agents to Read: agentsNavigate sends hm:// URLs to path("doc", url), opens http(s) URLs with openURL, and passes in-app paths such as /me or /s/<id> to go.
Discuss to Me: discussOpenCreate requests new words and goes to /me/create.
Activity to Me: activityMe selects the me tab.
Tests
app.test.contract has three tests: the four tabs open, the nav bar's discussion button opens all threads, and Me's agent server row opens the agent server sheet. See Contract UI tests.
User stories
The code described here exists to deliver these stories. Each story lists this page in its Trace (traceability).
US-READ-01 Open the app to my site's home: The tab read at "/", pick and the four tab stacks
US-READ-03 Follow links between documents: follow, go, back and the root navigate handler
US-READ-04 Open a Seed site by URL: The open-site route and the back-then-push on success
US-READ-05 Open an hm:// link from outside the app: The doc route, follow as the warm-link handler, go
US-READ-06 Keep reading another site in place: follow and readDirOpen rewrite hrefs onto the context server
US-READ-07 Browse and search a space's documents: The directory route and readDirOpen (back, then go)
US-READ-09 See who wrote a document and visit their profile: The author route "/a/:uid"
US-DISC-01 See the discussion on a document: The comments route
US-DISC-02 Read a thread: The thread route /c/:uid/:comment
US-DISC-03 Comment on a document: The compose route as a sheet; back then go to the new thread
US-DISC-05 Be guided to create an identity before commenting: go("/me/create") pushes the sheet on the current tab; meAfterAdd closes it
US-ACT-01 See replies and mentions for my identity: The activity tab and "Open Me"
US-ACT-02 Open what a notification is about: select(nav, "read") then go; the from=activity marker
US-ACT-04 Get notifications by email: The activity-email route
US-AGENT-01 See my agents: The agents tab route and its children
US-AGENT-02 Choose my agent server: The agent-server route, reachable from two tabs
US-AGENT-03 Set up a model provider: The providers route
US-AGENT-04 Create an agent: The new-agent route and the replace to the agent
US-AGENT-05 Chat with an agent: The session route
US-AGENT-08 Return to earlier conversations: agent and session routes and their ids from the stack
US-AGENT-10 Open documents and links an agent refers to: How go places a route from another tab
US-ID-01 Create an identity: The create route and its modal presentation
US-ID-02 Import an identity I already have: The import route and its modal presentation
US-ID-04 See and share my account ID, and name my key on this device: The identity route /me/id/:uid
US-ID-07 Edit my public profile: The profile-edit route and profileClose
US-ID-08 Choose which Seed server I read from: The server route
US-VAULT-01 Connect my vault to bring my identities to this phone: The vault and vault-connect routes
US-APP-01 The app feels like an iPhone app: Route table, per-tab stacks and the back action
US-APP-02 Move around the app without losing my place: Route table, stacks per tab, shared actions, cross-tab moves
US-TEAM-04 Understand how the app is built: The route table and the actions that move between routes
Related
Read: ids, refs and link targets: the helpers that build these paths in the data module
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime