Make the module navigation capability an optional context member
CI / verify (pull_request) Successful in 1m11s
CI / infrastructure-smoke (pull_request) Successful in 42s
CI / package-release (pull_request) Successful in 48s
CI / migration-smoke (pull_request) Successful in 2m27s
CI / image-build (pull_request) Successful in 1m8s
CI / deploy-smoke (same-origin) (pull_request) Successful in 52s
CI / package-publication (pull_request) Successful in 57s
CI / deploy-smoke (split) (pull_request) Successful in 3m35s

ModuleUiHostContext.navigation is now `navigation?: ModuleUiNavigation |
undefined`, so the public context change is source-compatible: a context built
before navigation existed (without the member) still compiles unchanged, as
0.x patch releases require. The Dashboard supplies navigation; hosts without
addressable pages, including the display host, omit the member; modules
feature-detect it. Existing hosts' tests are restored to their pre-PR shape,
and a module-ui-sdk test proves a pre-navigation context still satisfies
ModuleUiHostContext (and fails if the member is ever made required).
Runtime behaviour, manifest v8/v9 compatibility, and security rules are
unchanged. ADR 0063 and the module development guide say so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ekklesia
2026-10-15 09:13:03 -05:00
co-authored by Claude Opus 5.5
parent ae360ef318
commit c78f1318b4
13 changed files with 60 additions and 37 deletions
+4 -3
View File
@@ -720,7 +720,8 @@ artifact is the role selection.
### What the host gives you
`mount` receives exactly eight members, and nothing else is available:
`mount` receives these members, and nothing else is available. `navigation` is optional: a host that
has no addressable pages leaves it out, so feature-detect it.
| Member | What it is |
| --- | --- |
@@ -731,7 +732,7 @@ artifact is the role selection.
| `realtime` | `subscribe(channel, handlers)` against **your own** module's live state — see [Realtime state](#realtime-state) |
| `contributions` | Renderers other modules contributed to capabilities **you** provide — see [Browser contributions](#browser-contributions) |
| `display` | Your display page's URL, or `undefined` when you publish none |
| `navigation` | Where your module is, and how it moves between its own pages and to its Settings page — see [Module navigation](#module-navigation). `undefined` on the display host |
| `navigation` | Where your module is, and how it moves between its own pages and to its Settings page — see [Module navigation](#module-navigation). Optional: absent on the display host |
Module configuration, organization context, and diagnostics reporting are **not** in the contract.
They need designs that do not exist, and a speculative field frozen into a public contract is harder
@@ -795,7 +796,7 @@ A refresh, a bookmark, and Back and Forward all land on the same route.
never build a Dashboard URL yourself:
```tsx
const { navigation } = context; // undefined on the display host
const { navigation } = context; // optional: absent on the display host
navigation?.location(); // { path: "media/sermons/123", page: "media" }
navigation?.subscribe(() => rerender()); // every move: yours, the sidebar's, Back and Forward
navigation?.navigate("timelines"); // or { replace: true } to respell the current entry