Navigation and routes
The full route table of Seed Exact, how the four tab stacks work, and the actions that move between routes and tabs.

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

read

/

DocScreen with home=true

tab root

read

doc

/d/:ref

DocScreen

pushed

read

open-site

/open-site

OpenSiteScreen

modal

read

directory

/dir/:uid

DirectoryScreen

modal

read

author

/a/:uid

AuthorScreen

pushed

read

thread

/c/:uid/:comment

DiscussThreadScreen

pushed

read

comments

/comments/:ref

DiscussAllScreen

pushed

read

compose

/compose/:ref

DiscussComposeScreen

modal

activity

activity

/activity

ActivityScreen

tab root

activity

activity-email

/activity/email

ActivityEmailScreen

pushed

agents

agents

/agents

AgentsScreen

tab root

agents

new-agent

/agents/new

AgentCreateScreen

modal

agents

agent-server

/agents/server

AgentServerScreen

modal

agents

agent

/agents/:id

AgentDetailScreen

pushed

agents

session

/s/:id

AgentSessionScreen

pushed

agents

providers

/providers

AgentProvidersScreen

modal

agents

agents-test

/agents-test

inline fixture screen

pushed, unlinked

me

me

/me

MeScreen

tab root

me

identity

/me/id/:uid

MeIdentityScreen

pushed

me

create

/me/create

MeCreateScreen

modal

me

import

/me/import

MeImportScreen

modal

me

server

/me/server

MeServerScreen

pushed

me

profile-edit

/me/id/:uid/edit

ProfileScreen

modal

me

vault

/me/vault

VaultScreen

pushed

me

vault-connect

/me/vault/connect

VaultConnectScreen

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" --> th

Stacks 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

top(nav)

The visible entry. top(nav).name, .id and .params gate most derives and tasks

stack(nav)

Entries of the selected tab's stack

push(nav, location)

Adds a visit on the selected stack

go(nav, location)

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

back(nav)

Pops one entry

select(nav, tabName)

Shows another tab

replace(nav, location)

The top visit takes the location and keeps its id

path("route", param)

Builds a location from a route name, encoding the parameter

searchParam(entry, name)

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).

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

Unsubscribe anytime