// YOUR CLAUDE ASKS, IN THE APP'S OWN SHEET (owner, 23 Nov 2026, from his iPhone in Story; shared/DECISIONS.md "Your// Claude asks"): in Words, Days, Story and Comms the card "Let your Claude read your data" is the app's own sheet from// the foot (its ground, corner, scrim and faces, as the shake's "What looks wrong?"), never the old paper. Every line is// drawn whole: the title, who asks, the promise, What it can read (Everything by default, Let me choose opening the// groups as ticks), For how long (the durations on a timed card), and where to change it later. No table is named.// The waits line, Not now and Allow stand fixed at the foot; the words above scroll on their own. Allow is off while// Let me choose has nothing ticked. A tap outside or a pull down puts the card aside until the app is next opened (no// answer is sent); Not now answers it. Every word is the core's (`unlock.card`'s `card.ask`, `fields`, `acts`).#if os(iOS)importSwiftUIimport UIKitextensionVaultLook {/// The apps that raise the card in their own sheet. @MainActor staticvar raisesAsks: Bool { NotesRoot.applies || InkStoryRoot.applies || DaysRoot.applies || ChatRoot.applies }}/// The root's raise: while a card waits in an app with a look of its own, it stands in that look's panel.structUnlockAskRaise: View {let asks: UnlockAskslet look: VaultLook @Environment(\.colorScheme) privatevar schemevar body: someView {let panel = look.reportPanel(scheme)Color.clear .allowsHitTesting(false) .lookPanel(isPresented: Binding(get: { asks.raised && asks.ask != nil }, set: { if !$0 { asks.putAside() } }), style: panel.style, name: asks.title) {UnlockAskSheet(asks: asks, look: look, grabber: panel.grabber) } .onAppear { asks.sheet = true } }}/// The card's words, the choice, the lengths, and the foot.structUnlockAskSheet: View {let asks: UnlockAskslet look: VaultLookvar grabber = false @Environment(\.colorScheme) privatevar scheme/// The words' own height: the sheet is as tall as they are, and scrolls past a share of the screen. @State privatevar wordsHigh: CGFloat = 0privatevar room: CGFloat { UIScreen.main.bounds.height * 0.62 }var body: someView { VStack(spacing: 0) {if grabber {Capsule().fill(Pen.faint).frame(width: 36, height: 5) .padding(.top, 6).padding(.bottom, 5) .frame(maxWidth: .infinity) .accessibilityHidden(true) }ScrollView { words.onGeometryChange(for: CGFloat.self) { $0.size.height } action: { wordsHigh = $0 } } .frame(maxHeight: wordsHigh > 0 ? min(wordsHigh, room) : nil) .scrollBounceBehavior(.basedOnSize) .accessibilityIdentifier("unlock-scroll") foot } .environment(\.vault, look) .accessibilityElement(children: .contain) .accessibilityIdentifier("unlock-sheet") .onAppear { UnlockAsksLayer.landOnTheCard() } } @ViewBuilder privatevar words: someView { VStack(alignment: .leading, spacing: look.gap("m")) {iflet title = asks.title {Text(verbatim: title).vault(look, "title").whole() .accessibilityAddTraits(.isHeader) .accessibilityIdentifier("unlock-title") }iflet who = asks.ask?.who {Text(verbatim: who).vault(look, "row_detail", "secondary").whole().accessibilityIdentifier("unlock-who") }iflet reason = asks.reason {Text(verbatim: reason).vault(look, "body").whole().accessibilityIdentifier("unlock-reason") }iflet ask = asks.ask {iflet what = ask.what { heading(what, "unlock-what") } VStack(alignment: .leading, spacing: 0) {iflet everything = ask.everything {UnlockPick(choice: everything, on: !asks.choice.choosing, round: true, id: "unlock-everything") { asks.choosing(false) } }iflet choose = ask.choose {UnlockPick(choice: choose, on: asks.choice.choosing, round: true, id: "unlock-choose") { asks.choosing(true) } }if asks.choice.choosing { VStack(alignment: .leading, spacing: 0) {ForEach(ask.groups) { group inUnlockPick(choice: .init(label: group.label, line: group.line), on: !asks.choice.off.contains(group.id), round: false, id: "unlock-group-\(group.id)") { asks.tick(group.id) } } }// Under Let me choose, set in by half its mark: at 30 a group's line lost the width it needed and// Scripts' broke onto two lines on a 393-point phone while Photos' stood on one (24 Nov 2026). .padding(.leading, UnlockPick.inset) .accessibilityElement(children: .contain) .accessibilityIdentifier("unlock-groups") } } .disabled(asks.busy)iflet howLong = ask.howLong { heading(howLong, "unlock-how-long") }if !asks.durations.isEmpty {SettingsFlow(spacing: look.gap("s")) {ForEach(asks.durations, id: \.minutes) { duration inUnlockLength(label: duration.label, on: duration.minutes == asks.chosen, id: "unlock-duration-\(duration.minutes)") { asks.choose(duration) } } } .disabled(asks.busy) }iflet line = ask.howLongLine {Text(verbatim: line).vault(look, "body").whole().accessibilityIdentifier("unlock-how-long-line") }iflet settings = ask.settings {Text(verbatim: settings).vault(look, "row_detail", "secondary").whole().accessibilityIdentifier("unlock-settings") } } } .padding(.horizontal, look.gap("gutter")) .padding(.top, grabber ? look.gap("s") : look.gap("xl")) .padding(.bottom, look.gap("m")) .frame(maxWidth: .infinity, alignment: .leading) }privatefunc heading(_ words: String, _ id: String) -> someView {Text(verbatim: words).vault(look, "label", "secondary").whole() .padding(.top, look.gap("s")) .accessibilityAddTraits(.isHeader) .accessibilityIdentifier(id) }/// The waits line, where an Allow already given stands, then Not now and Allow: always in sight.privatevar foot: someView { VStack(alignment: .leading, spacing: look.gap("s")) {ForEach(asks.waits, id: \.self) { line inText(verbatim: line).vault(look, "row_detail", "tertiary").whole().accessibilityIdentifier("unlock-waits") }iflet status = asks.status {Text(verbatim: status).vault(look, "body").whole().accessibilityIdentifier("unlock-status") }// Allow all (f1d096c29d): who else waits, then its quiet act on its own row; not while choosing groups.iflet all = asks.allowAll, !asks.choice.choosing {iflet line = all.line {Text(verbatim: line).vault(look, "body").whole().accessibilityIdentifier("unlock-all-line") } HStack {Spacer(minLength: 0)VaultButton(label: all.label, fill: .plain) { Task { await asks.allowEvery() } } .disabled(asks.busy) .accessibilityIdentifier("unlock-allow-all") } }if !asks.acts.isEmpty { HStack(spacing: look.gap("m")) {Spacer(minLength: 0)iflet decline = asks.acts.first(where: { $0.id == "decline" }) {VaultButton(label: decline.label, fill: .plain) { Task { await asks.act(decline) } } .disabled(asks.busy) .accessibilityIdentifier("unlock-not-now") }iflet allow = asks.acts.first(where: { $0.id == "allow" }) {let can = asks.ask.map(asks.choice.allows) ?? trueVaultButton(label: allow.label, tone: .accent) { Task { await asks.act(allow) } } .disabled(asks.busy || !can) .opacity(can ? 1 : 0.4) .accessibilityIdentifier("unlock-allow") } } } } .padding(.horizontal, look.gap("gutter")) .padding(.top, look.gap("s")) .padding(.bottom, look.gap("l")) .frame(maxWidth: .infinity, alignment: .leading) .accessibilityElement(children: .contain) .accessibilityIdentifier("unlock-foot") }}/// One answer: a round mark for one of two ways, a square one for a group; its label in the look's text, its line quieter.privatestructUnlockPick: View {/// How far the groups stand in under Let me choose.staticlet inset: CGFloat = 14let choice: UnlockAskWords.Choicelet on: Boollet round: Boollet id: Stringlet tap: () -> Void @Environment(\.vault) privatevar look @Environment(\.colorScheme) privatevar schemevar body: someView {Button(action: tap) { HStack(alignment: .center, spacing: 12) { mark VStack(alignment: .leading, spacing: 2) {Text(verbatim: choice.label).vault(look, "row_title").whole()iflet line = choice.line {Text(verbatim: line).vault(look, "row_detail", "secondary").whole() } } .frame(maxWidth: .infinity, alignment: .leading) } .frame(minHeight: 44) .padding(.vertical, 4) .contentShape(Rectangle()) } .buttonStyle(.plain) .accessibilityElement(children: .combine) .accessibilityAddTraits(on ? [.isButton, .isSelected] : .isButton) .accessibilityIdentifier(id) } @ViewBuilder privatevar mark: someView {let accent = look.colour("accent", scheme)let faint = look.colour("text", scheme).opacity(0.35)if round {Circle().strokeBorder(on ? accent : faint, lineWidth: 1.5) .overlay(Circle().fill(on ? accent : .clear).padding(5)) .frame(width: 22, height: 22) .accessibilityHidden(true) } else {RoundedRectangle(cornerRadius: 5, style: .continuous) .strokeBorder(on ? accent : faint, lineWidth: 1.5) .background(RoundedRectangle(cornerRadius: 5, style: .continuous).fill(on ? accent : .clear)) .overlay { if on { Image(systemName: "checkmark").font(.system(size: 12, weight: .bold)).foregroundStyle(look.colour("on_accent", scheme)) } } .frame(width: 22, height: 22) .accessibilityHidden(true) } }}/// One length the person may choose, the chosen one filled.privatestructUnlockLength: View {let label: Stringlet on: Boollet id: Stringlet tap: () -> Void @Environment(\.vault) privatevar look @Environment(\.colorScheme) privatevar schemevar body: someView {let accent = look.colour("accent", scheme)Button(action: tap) {Text(verbatim: label) .vault(look, "label") .foregroundStyle(on ? look.colour("on_accent", scheme) : look.colour("text", scheme)) .padding(.horizontal, 14) .padding(.vertical, 8) .frame(minHeight: 36) .background(Capsule().fill(on ? accent : .clear)) .overlay(Capsule().strokeBorder(on ? accent : look.colour("text", scheme).opacity(0.3), lineWidth: 1)) } .buttonStyle(.plain) .accessibilityAddTraits(on ? [.isButton, .isSelected] : .isButton) .accessibilityIdentifier(id) }}privateextensionView {/// Drawn whole: wraps, never cut short.func whole() -> someView { fixedSize(horizontal: false, vertical: true) }}#endif#if COTTON_DEVimportFoundation/// DEVELOPER TOOL: `-unlock-card-seed account|timed` stands the core's own card for an invented request/// (`Fixtures/unlock-card-seed.json`, written by `rules/unlock_tests.rs` `write_unlock_card_seed`) as if one waited, so/// a UI check can see the sheet and what Allow would send; nothing is sent.@MainActor enumUnlockCardSeed {staticvar asked: String? {let arguments = ProcessInfo.processInfo.argumentsguardlet at = arguments.firstIndex(of: "-unlock-card-seed"), at + 1 < arguments.count else { returnnil }return arguments[at + 1] }private(set) staticvar answeredOnce = false/// What the last Allow would have sent, as words a check reads (`unlock-seed-sent`).private(set) staticvar sent: String?staticfunc answer() -> UnlockCardAnswer? {guardlet asked, let url = Bundle.module.url(forResource: "unlock-card-seed", withExtension: "json", subdirectory: "Fixtures"),let data = try? Data(contentsOf: url),let all = try? JSONDecoder().decode([String: RecordValue].self, from: data),let picked = all[asked], let again = try? JSONEncoder().encode(picked) else { returnnil }returntry? JSONDecoder().decode(UnlockCardAnswer.self, from: again) }/// Allow all, on the seed: the requests it would have allowed.staticfunc answeredAll(_ ids: [String]) { answeredOnce = true sent = "all: " + ids.joined(separator: ",")Log.write("unlock seed: Allow all would send \(sent ?? "")") }staticfunc answered(_ request: UnlockAllowRequest?) { answeredOnce = trueguardlet request else { return } sent = request.everything == true ? "everything" : "groups: " + (request.groups ?? []).joined(separator: ",")Log.write("unlock seed: Allow would send \(sent ?? "")") }}#endif