1.2 KiB
1.2 KiB
0038 Back follows the page's declared parent, never the browser alone
Status: Superseded by 0057 · Area: architecture · Date: 2026-10-09 · Decided by: agent
Context
The new design's R14 rule: every page opened from another page has back on mobile and desktop, because an installed PWA has no browser bar. Roots (خانه, جستجو, the dashboards, a creator's own channel) have none. history.back() alone fails on a deep link or a notification tap.
Decision
- Back resolves in this order:
onBack→ a target a client part declared withuseBackTarget→ the page'shref→ in-app history (Navigation APIcanGoBack, elsehistory.length) →parentHref→ home. - Mobile bars take
backHref(fixed) andparentHref(used when no page of this site is behind it). Desktop non-root columns showDeskBack(«بازگشت») above the page title;DesktopPageTitlerenders it. - A page opened from a link or notice returns to its parent; the payment result returns to the channel, never the bank.
Alternatives
- Browser history only: a deep link's back leaves the site or does nothing in the PWA.
Consequences
Every new pushed page passes parentHref; roots pass nothing.