import type { Page } from "../../lib/urlState"; import type { NavigationState } from "./navigationContext"; /** The page whose own keys the address bar carries: none while the channel page stands over it, so * every module store writes its keys (`useUrlMirror`) only while its page is what the screen shows. * A plain function beside the context, not a hook in it: the stores' tests mock that module. */ export function urlPage(nav: Pick): Page | null { return nav.channelView ? null : nav.page; }