diff --git a/AGENTS.md b/AGENTS.md index 1b6141e..f637d8d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -58,8 +58,8 @@ Keep it stable. Prefer pointers to canonical sources over copied structure, file - hemx core stays small: effects, typed ids, registries, and wire schema only; keep features in core only when they fit typed resources plus EffectBatch ops. req: laws/001 - Routing, auth, sessions, transport, transitions, sync, and storage belong in integration/user crates. - Public examples and beginner APIs should use templates plus Rust, generated resources, and `IntoEffect`, not atoms, raw ids, selectors, wire formats, runtime opcodes, manual registries, or raw effect constructors; keep advanced layers out of starters. req: canonical_authoring/001 req: canonical_authoring/004 req: canonical_authoring/006 req: canonical_authoring/010 req: canonical_authoring/015 req: dx/001 req: dx/002 req: dx/010 req: progressive_disclosure/001 req: progressive_disclosure/002 req: progressive_disclosure/003 -- Typed partial swaps should stay expressed as generated target plus rendered partial plus swap kind, not selector-driven rerendering; HTTP, navigation, push, and island behavior adapt around that loop, and docs should layer new primitives progressively. req: canonical_authoring/002 req: canonical_authoring/014 req: modes/001 req: progressive_disclosure/004 -- `examples/html_examples` is the copy-paste HTML pattern gallery for htmx-style examples; keep exact htmx URL slugs visible while translating behavior to boring `.heml`, generated resources, and server-owned Rust state. req: htmx_equivalents/001 req: htmx_equivalents/005 req: examples/007 +- Typed partial swaps should stay expressed as generated target plus rendered partial plus swap kind, not selector-driven rerendering; HTTP, page navigation, push, and island behavior adapt around that loop, and docs should layer new primitives progressively. req: canonical_authoring/002 req: canonical_authoring/014 req: modes/001 req: progressive_disclosure/004 req: page_swap/001 req: page_swap/002 req: page_swap/003 +- `examples/html_examples` is the copy-paste HTML pattern gallery for htmx-style examples; keep exact htmx URL slugs visible while translating behavior to boring `.heml`, generated resources, and server-owned Rust state. Boost containers enhance same-origin descendants only and preserve native external/download/new-tab behavior. req: htmx_equivalents/001 req: htmx_equivalents/005 req: examples/007 req: page_swap/007 req: page_swap/008 - Use `cargo run -p hemx-xtask -- app new PATH` for the generic page/form/keyed-row/notice starter, and `cargo run -p hemx-xtask -- app new --mobile PATH` for the phone-first starter with host capabilities, recovery truth, and release-kit commands; do not treat it as a mobile framework or store-submission bot. req: ceremony/005 req: ceremony/006 req: ceremony/007 - The public component-reuse explanation lives in `docs/recipes/reusable-partials.md`; do not grow a client component framework to explain partial composition. - The stable public `.heml` authoring surface lives in `docs/hemplate-syntax.md`; Hemlate examples must use that real hemplate syntax, not Vue/Handlebars sketches. diff --git a/REQUIREMENTS.md b/REQUIREMENTS.md index 70bb909..f67ace3 100644 --- a/REQUIREMENTS.md +++ b/REQUIREMENTS.md @@ -202,25 +202,28 @@ client app state framework. ## page_swap ### req: page_swap/001 -001 Page swapping is a first-class specialization of partial swapping: render a page partial, place it into generated page targets, then apply history/title/scroll/shell behavior. Authors mark real anchors with `data-hemx-nav`; links keep valid `href` and work without JS. Missing or empty static `href` on a `data-hemx-nav` anchor is a build error. +0 001 Page swapping specializes partial swapping: render page partials into generated targets, then apply history/title/scroll/shell behavior. `data-hemx-nav` anchors keep valid `href` and work without JS; missing/empty static `href` fails build. [north_star] ### req: page_swap/002 -002 A `data-hemx-nav` click fetches the target URL as a hemx partial request. The response is conceptually `ui::content.replace(page)` plus optional generated nav/title targets and a `Navigate` effect; it must not introduce selector targeting or a second page-specific UI model. +0 002 A `data-hemx-nav` click fetches the target URL as a hemx partial request. The response is `ui::content.replace(page)` plus optional generated nav/title targets and `Navigate`; it must not add selector targeting or a second page UI model. [north_star] ### req: page_swap/003 -003 Page swapping uses generated targets, not CSS selectors. The default content target is the generated slot named `content`, not `#content`; explicit page helpers such as `ui::content.page(req, view)` or `request.page_html(ui::content.render(view), shell)` are adapters around the same partial-swap primitive. +0 003 Page swapping uses generated targets, not CSS selectors. Default content target is generated slot `content`, not `#content`; page helpers like `ui::content.page(...)` or `request.page_html(...)` adapt the same partial-swap primitive. [north_star] ### req: page_swap/004 -004 Ordinary page navigation must not require user-authored handlers. Explicit navigation handlers are available only when custom application logic is needed, and they still return generated target/page commands. +0 004 Ordinary page navigation must not require user-authored handlers. Explicit navigation handlers are available only when custom application logic is needed, and they still return generated target/page commands. [north_star] ### req: page_swap/005 -005 Browser back/forward is supported. On `popstate`, hemx fetches the URL as a partial request and applies the same page-swap update without pushing a new history entry. +0 005 Browser back/forward is supported. On `popstate`, hemx fetches the URL as a partial request and applies the same page-swap update without pushing a new history entry. [north_star] ### req: page_swap/006 -006 If a page lacks the expected `content` slot, hemx-axum falls back to normal browser navigation in production and emits a diagnostic in development. +0 006 If a page lacks the expected `content` slot, hemx-axum falls back to normal browser navigation in production and emits a diagnostic in development. [north_star] ### req: page_swap/007 -007 `data-hemx-boost` progressively enhances descendant same-origin anchors and forms. It is a container convention, not a replacement for `data-hemx-nav` on an anchor or `data-hemx-handle` on a form; placing it directly on static anchors or forms is a build error. Links behave like `data-hemx-nav`; forms behave like hemx form submissions. External links, downloads, new-tab links, and modified-clicks preserve native browser behavior. +0 007 `data-hemx-boost` progressively enhances descendant same-origin anchors and forms as a container convention, not a replacement for anchor `data-hemx-nav` or form `data-hemx-handle`; direct static-anchor/form use is a build error. [north_star] + +### req: page_swap/008 +0 008 Boosted links behave like `data-hemx-nav`; boosted forms behave like hemx form submissions. External links, downloads, new-tab links, and modified-clicks preserve native browser behavior. [north_star] ---