// What SHAPE a route is — one answer per screen, shared by both hosts. // // The phone pushes one stack and needs none of this. The Mac draws three // columns over that same `path` (spec `2026-09-13-three-column-mac-and-home-footer-design.md` // §3), and it can only do that if something says, for every route, whether it // is a list a person picks from or the thing they picked. The answer lives // HERE, beside `Route`, and not in the Mac host, because it is a fact about // the screen rather than about a window — and because the phone needs one of // its arms too: `.capture` is an INSTRUCTION, never a screen, and // `Navigator.open` turns it into capture mode on either host. // // The switch is TOTAL and carries no `default`, exactly as `Route.path` and // `Boot/RouteScreen.swift` do. A new route then fails to COMPILE until // somebody says which column it lands in, which is the only form of this map // that cannot rot. A `default` would quietly answer `.page` for a screen // nobody looked at, and a list drawn in the page column is a person losing the // list they were reading. // // **The rule.** `.list` is a screen whose body is a list a person picks from. // `.page` is one record, one editor, one form, one reading surface. A record // that CONTAINS a list is still a page — a person, a note, a story — // because column 2 is what you picked FROM. The spec's §3.1 enumeration is the // owner's own answer and is followed exactly, including the two records it // names as lists (an account is read as its statements, a project as its // sections). // // Where the spec names a FAMILY rather than a case, the plural is the list and // the singular is the page — `/accounts` against `/accounts/[id]`. // Three calls that shape does not make for itself: // // - **`/news` is the LIST.** It was a page while it was only today's edition // and there were two indexes beside it, `/news/editions` and // `/news/topics`; since 2026-09-21 the past editions are slips under // today's on this very page and both indexes are gone, so `/news` is the // one place News is picked from. `/news/edition/[id]` is the page — an // older edition, opened out of the list — and `/news/topic/[id]` and // `/news/topic/new` are one form with and without a seed, so both are // pages too. // - `/projects/[slug]/code` is a project's directory of ways in — the same // shape `/code` has — so it is `.list`. // - `/repos/[id]` is a repository's directory of ways in — its pull // requests, its issues, its commits and its files — so it is `.list` for // `/projects/[slug]/code`'s reason, and the singulars beside it (a pull // request, an issue, a file, a commit, a release) are the pages. // - `/repos/[id]/history` and `/repos/[id]/releases` are lists somebody // picks a row from, exactly as `/repos/[id]/commits` is. A commit page // CONTAINS a list — its files, and each file's hunks — and a record that // contains a list is still a page. // - `/repos/[id]/runs` is a list for `/repos/[id]/commits`' reason, and both // the singulars under it are pages: a RUN contains a list (its jobs, and // each job's steps) and a record that contains a list is still a page, and // a JOB is one log being read. // - `/repos/[id]/pulls/new`, `/issues/new` and `/releases/new` are FORMS, so // they are pages for `/news/topic/new`'s reason: one form, one thing being // made, and nothing on them is a row somebody picks. // - `.hostPage` is one of this device's host-drawn pages (a Mac's API keys, // its sources): one form about one machine, opened from that machine's // own record page, so it is a page beside the devices list. import Foundation /// Where a route belongs — the phone reads only `.action`, the Mac reads all four. public enum RouteTier { /// Home itself. Never in the path: it is the root of the phone's stack and /// the Mac's sidebar. case launcher /// An instruction, not a screen. `Navigator.open` turns it into capture /// mode and pushes nothing. case action /// A list a person picks from. The Mac's column 2. case list /// One record, one editor, one form, one reading surface. The Mac's column 3. case page } extension Route { /// This route's shape. Total, and no `default` — see the file's header. public var tier: RouteTier { switch self { case .raised(let page, _): return page.tier // ── launcher ────────────────────────────────────────────────────── case .root, .home: return .launcher // ── action ──────────────────────────────────────────────────────── // `/take` and `/keyboard-take` are the Android input method's far // side (the route table is one for both phones); on this phone the // take is the composer's own microphone, so either opens capture // mode listening. case .capture, .take, .keyboardTake: return .action // ── list ────────────────────────────────────────────────────────── case .money, .activity, .alarms, .bin, .tools, .calendar, .calendarMonth, .callsHistory, .code, .devices, .documents, .storage, .deviceStorage, .email, .search, .goals, .journal, .tableList, .toolBoard, .locations, .meetings, // Meetings asked to record: the meetings list with the recorder // as a sheet over it, as `?import=1` is the list with the picker up. .meetingsRecord, .memoryDropped, .messages, .messagesStarred, .mood, .news, .notes, .passwords, .people, // People asked to import: the People list with the contacts // import covering the screen over it, as `/meetings/record` is the // meetings list with the recorder up. .peopleImport, .peoplePersonSection, .photos, .photosAlbums, .photosDuplicates, .photosPeople, .projects, .projectsCode, .projectsFeedback, .projectsFeedbackReport, .projectsMemory, .projectsSlug, .projectsSlugSection, .projectsTodos, .reader, .rejected, .members, .voiceWords, .database, .device, .backup, .server, .bringIn, .export, .thoughts, .todos, .todosDone, .todosDropped, .videos: return .list // ── page ────────────────────────────────────────────────────────── case .moneyAccount, .moneyStatement, .moneyTransaction, .briefing, .calendarEvent, .calendarEventEdit, .callsCall, .codeNew, .membersAdmit, .codeDefaults, .devicesId, .hostPage, .membersId, .voiceWordsId, .tableRecord, .storageId, .documentsDocument, .documentsDocumentViewer, .documentsImport, .emailId, .goalsGoal, .journalDate, .about, .aboutWhatsNew, .aboutHelp, .legalPrivacy, .legalTerms, .locationsLocation, .meetingsMeeting, .memory, .messagesImport, .messagesNew, .messagesInfo, .messagesMedia, .messagesThread, .newsEdition, .newsSettings, .newsTopic, .newsTopicNew, .notesJournalToday, .notesNote, .passwordsSecret, .me, .peoplePerson, .photosAlbum, .photosAlbumAdd, .photosPhoto, .projectsBrand, .readerPage, .sessionsId, .sessionsTerminal, .settingsJoinRequest, .camera, .thoughtsThought, .todosTodo, .videosVideo: return .page } } }