Cotton code
26 lines · 1.4 KB · SwiftRaw
import CottonKitimport SwiftUI/// **Where a page opened on the phone goes** (lane trail, 15 Oct 2026, for/// records; lane inplace, 16 Oct 2026, for every page — the owner saw a/// thread's details, a settings page and a person's section still slide in/// from the right with a back button).////// The page above the fan is one surface. Anything opened from it — a note in/// Notes, a person from that note, a meeting from the person, a settings/// page, a tool's list — turns that surface to the page in place, on the/// shown surface's own stack (`Navigator.tileStacks`): no push over the whole/// screen, the fan and the record button never move. Back is one step: the/// left-edge swipe or the X; a long press on the X jumps several; a tap on the/// settled fan tile goes to the tool's own page. Depth is unbounded. A phone/// Home that draws no fan is one more such surface (`Navigator.rootTile`)./// The Mac's columns keep their own push.enum PageOpening {    /// A surface's stack after `route` opens on it: pushed on top — unless it    /// is already there, when the page goes back to it rather than stacking a    /// copy (a link back to the note a person was opened from is that note).    static func opening(_ route: Route, on stack: [Route]) -> [Route] {        if let at = stack.firstIndex(of: route) { return Array(stack.prefix(through: at)) }        return stack + [route]    }}