# `Mutare.Phoenix.LiveView.Navigation`
[🔗](https://github.com/foxbenjaminfox/mutare_phoenix_live_view/blob/v0.2.1/lib/mutare/phoenix/live_view/navigation.ex#L1)

`:lv_nav` — swaps a LiveView's socket-navigation call between its two patch/navigate forms:

    push_navigate(socket, to: p)  <->  push_patch(socket, to: p)

`push_navigate` dismounts the current LiveView and mounts a new one (state discarded);
`push_patch` keeps the process and only re-invokes `handle_params/3`. `Phoenix.LiveViewTest`
separates them (`assert_patch` vs `assert_redirect`), so a test that asserts *how* navigation
happened kills the mutant.

One caveat on the `push_navigate → push_patch` direction: `push_patch` is only valid to the
*same* LiveView, so patching to a route backed by a *different* LiveView raises at runtime —
an uninformative kill (any test exercising the line fails). The swap tests navigation
behaviour in the common same-LiveView case, and the `push_patch → push_navigate` direction
is always valid.

Matches direct (`Phoenix.LiveView.push_navigate(...)`), aliased, and bare-imported
(`use`-injected) calls. Silence a site with `# mutare:ignore[lv_nav]`.

Also routes the LiveView compile-time DSL `:skip` — the `Phoenix.LiveView.Router`
route declarations (`live`/`live_session`), `on_mount` hook declarations, and
`Phoenix.Component`'s declarative assigns and template embedding (`attr`/`slot`/
`embed_templates`) — so each of those calls is an inert leaf: Mutare neither descends into
the declaration nor rewrites the call.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
