Repository navigation
Description
Summary
installPartialNavigationCoordinator() (@netscript/fresh/navigation, 0.0.9) treats a request as a region request only when its path is /partials or starts with /partials/ (isPartialPath). An app whose region routes sit under a page's own path (for example /items/[id]/partials/list), and any anchor click, are classified as page navigations. Each page navigation bumps the generation and drains every older in-flight partial response.
The result: tap a region link (<a f-partial>) while a DeferPage body is still loading, and the deferred body is drained ("Superseded Fresh partial response was drained"). Only the tapped region updates, and every other deferred region stays on its fallback until the next full navigation.
Where
src/runtime/navigation/coordinator.ts:
onClickstages{ kind: 'page', actualUrl }for every client-nav anchor, including anchors that carryf-partial.onSubmitstages a region intent only whenisNamedRegionholds, which requiresisPartialPath(partialUrl), i.e. a root/partials/path.interceptFetch: an un-stagedfresh-partialfetch is'region'only whenisPartialPath(url).invalidReason: a page lease is valid only whilelease.generation === this.requestedGeneration, so any newer page intent drains older responses.
function isPartialPath(url: URL): boolean {
return url.pathname === '/partials' || url.pathname.startsWith('/partials/');
}Reproducer
A page that defers its body to a region route under its own path, with region links inside the body:
// routes/items.tsx
export default function Items() {
return (
<body f-client-nav>
<DeferPage
name="items-body"
action="/items"
partial="/items/partials/body"
fallback={<p>loading…</p>}
/>
{/* a region link that exists before the body lands */}
<a href="/items?tab=done" f-partial="/items/partials/list?tab=done">Done</a>
<Partial name="items-list"><p>list</p></Partial>
</body>
);
}
// routes/items/partials/body.tsx answers `items-body` (slow, e.g. 800 ms);
// routes/items/partials/list.tsx answers `items-list` (fast).- Load
/items. The DeferComponent submits/items/partials/body(classified as a page navigation, generation 1). - Before it answers, click "Done". The anchor click stages a page intent, so generation 2 fetches
/items/partials/list. - The body's response arrives, is now superseded, and is drained.
- Result:
items-listshows the Done tab, butitems-bodystays on "loading…".
Verified in Chromium with the real coordinator bundled from 0.0.9. Four cases:
| Case | Result |
|---|---|
A script's in-page fetch(…?fresh-partial=true) during the deferred load |
the page's own deferred body is drained |
| A page navigation tap during the load | the body is drained and the new page applies (expected) |
| A region link tap during the load | the body is drained and the page keeps its fallbacks (the bug) |
| The same region tap after the body landed | applied, nothing drained |
Expected
A region request must not supersede the page's in-flight deferred regions. Either of these would do:
- Classify by intent, not path: an anchor or form with
f-partial(and the DeferComponent's form) stages{ kind: 'region' }, wherever the region route lives. Only navigations that replace the page boundary bump the page generation. - Or make the region route prefix configurable (or derive it from the app's partial routes), and document that region routes outside it count as page navigations.
A test in the coordinator suite: a deferred body in flight plus a region link tap leaves both applied.
Workaround in apps today
Make sure no deferred document offers a region-only control before its body lands (only page navigations), and never fetch partials from page scripts. That keeps users from hitting it, but it is an invariant the framework does not state.
Activity
rickylabs commentedon Nov 16, 2026
Clarification after reading the 0.0.9 docs:
pages/web-layer/partialsplaces partial routes at the root (routes/partials/…, URL/partials/…). That is exactly whatisPartialPathrecognises, so an app that keeps its region routes there gets region intents.Two points still hold:
/items/[id]/partials/list, natural for per-tenant routes) silently gets page-navigation semantics, so its deferred bodies can be drained.onClick). Even a root/partials/…link (<a f-partial>) bumps the page generation and drains an in-flightDeferPagebody. Only the GET-form path (onSubmitwithisNamedRegion) and un-staged fetches get the region classification.Suggested resolution, either:
/partials/, and anf-partialanchor still counts as a page navigation.f-partialon the clicked anchor or form, plus the DeferComponent's form, as a region intent, wherever the route lives.rickylabs commentedon Nov 17, 2026
Additional consumer reproducer for the deferred-region lifecycle case (NetScript0.0.9, Fresh2.3.3, Deno2.9.7), observed before the consumer switched to an eager selected-day fallback.
This is consistent with the nested-region classification limitation already described above; I have not proved a failure with root
/partials/…routes. The important extra case is that the eagerly useful body has already rendered, so hiding all controls until that body lands does not avoid it.Minimal sequence using public native APIs only:
days=weekGET response in a browser route interceptor.items-bodyand shell regions, deliberately no drawer boundary: it must not replace a current command form or key.item-drawer.Observed at375 px in all four light/dark × normal/reduced-motion cases, with no browser pageerror and no command/effect. Consumer evidence source
rickylabs/garage-booking@497f219ab8c0d0b69c65e9bb4f2ac104cc665011; the first served fallback is garage-booking#532.A useful qualification would cover this exact overlay-open/release/close order and verify either preserved deferred application or a documented native re-request policy. Latest-intent ordering must still protect the new drawer and its current command identity; applying an obsolete whole page is not an acceptable fix.
Current public
PartialNavigationCoordinatorexportsnavigate,subscribe,dispose; the0.0.9 reference does not document a deferred resumption hook. The app ships a selected-day eager list with ordinary typed day navigation, and will restore seven eager days using a backend range read. It adds no parallel fetch/cache/history/resumption layer.