// WHO DRAWS A PASSING LINE (22 Nov 2026). Every toast in// a redesigned app is drawn in that app's own look, once. The shell says its// lines (an approval, a sync failure, a sealed key, Free up space, a report// sent) into the one `ToastCenter`; the window's receipt overlay asks this// seam whether the app draws its own toast and, when it does, hands it the// words, its Undo and its way to go. Words, Days, Story and Comms each draw// them as their own lines are drawn; Vault and Health keep theirs in their// look (`VaultToastView`); only the apps still on paper draw the paper strip.//// Seen on the owner's iPhone in Comms (22 Nov 2026): "Approved. … is signing// in." stood twice at once, as the paper strip and as Comms' rounded pill. The// window's overlay hung outside the app look (so it drew paper) while the// stack's, inside it, drew the look; both drew every shell line.importCottonKitimportSwiftUI/// An app that draws the shell's passing lines in a toast of its own.enumAppToast: String, CaseIterable, Sendable {case words, days, story, comms/// The app for a flavour (the registry's), or nil for an app that has no toast of its own.staticfunc of(flavour: String?) -> AppToast? {guardlet flavour else { returnnil }if flavour.hasPrefix("notes") { return .words }if flavour.hasPrefix("messages") { return .comms }switch flavour {case"days": return .dayscase"story": return .storydefault: returnnil } }/// This build's.staticvar standing: AppToast? { of(flavour: FlavourManifest.current?.flavour) }/// The toast's name to a test: `toast-words`, `toast-days`, `toast-story`, `toast-comms`.var identifier: String { "toast-\(rawValue)" }}extensionEnvironmentValues {/// The app that draws the shell's passing lines itself (`RootView` sets it beside `\.vaultLook`). @Entry var appToast: AppToast? = nil}#if os(iOS)/// The shell's line in the app's own toast.structAppToastView: View {let app: AppToastlet toast: CottonToastlet onUndo: () -> Voidlet onDismiss: () -> Voidvar body: someView { face .accessibilityElement(children: .contain) .accessibilityIdentifier(app.identifier) .accessibilityAddTraits(.updatesFrequently) .accessibilityAction(named: "Dismiss", onDismiss) } @ViewBuilder privatevar face: someView {switch app {case .words: NotesToast(toast: toast, onUndo: onUndo, onDismiss: onDismiss)case .days: DaysToast(toast: toast, onUndo: onUndo, onDismiss: onDismiss)case .story: InkToast(toast: toast, onUndo: onUndo, onDismiss: onDismiss)case .comms: ChatToast(toast: toast, onUndo: onUndo, onDismiss: onDismiss) } }/// How many lines a tone may take: a failure explains, a receipt stays terse (as the strip).staticfunc lineLimit(_ tone: CottonToast.Tone) -> Int { tone == .error || tone == .warning ? 6 : 3 }}#endif