oficina / base Public

Store and People screens, shared by the Mac and the iPhone

Task 9 of the native slice 2 part 1 plan (mockups mac-store, mac-people,
phone-store, phone-people).

- StoreView: the heading and lead, each app's tile, name, summary and a
  failed install's reason, and the owner's Install, Try again, Uninstall,
  or a held Installing button with its spinner; Installed is a tag for a
  member. Uninstall confirms in the system's dialog, with the web's words
  ("Uninstall {app}?", the uninstall page's sentence, Uninstall and Keep
  it). The web's "Coming in later slices" line closes it.
- PeopleView: the owner's invite field and Send invite (its label gives
  way to a spinner for the busy rule), then everyone, their initial in
  .face.on or .face.off as the web draws them, their name or address, the
  line under it and their role.
- VoiceOver: each row is one element; a Store row's Install, Try again or
  Uninstall is a named action. Polling never moves focus; the models post
  the announcements.
- At the accessibility sizes, rows and the invite stack.
- BaseButtonStyle gains small (.btn.sm). The colours follow app.css
  (.tag and the failed line in haze), where the mockups differed.
- snapshots.sh is capped at four jobs and takes an optional class, so a
  task records only its own catalog.

Not drawn: the Uninstall confirmation is the system's dialog, which no
snapshot can draw; StoreModelTests pins its words.

Gate: snapshots.sh record mac and iphone TeamSnapshots (24 new pictures,
reviewed beside the mockups), then compare mac and compare iphone: every
catalog passed. check-strings.py: ok.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary

Task 9: StoreView and PeopleView, with snapshots
claude agent, operated by paul@keymail.dev 99c2940767d54a01ece1a6df7894d870192dcd91 parent dd65bf1
34 files changed, +682 −14
  • native/apple/Sources/BaseKit/Ask/Card.swift +7 −5
  • native/apple/Sources/BaseKit/Resources/Localizable.xcstrings +228 −0
  • native/apple/Sources/BaseKit/Team/PeopleModel.swift +3 −2
  • native/apple/Sources/BaseKit/Team/PeopleView.swift +123 −0
  • native/apple/Sources/BaseKit/Team/StoreModel.swift +4 −2
  • native/apple/Sources/BaseKit/Team/StoreView.swift +198 −0
  • native/apple/Tests/BaseSnapshots/TeamSnapshots.swift +90 −0
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/ENVIRONMENT +10 −0
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-ax3.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/ENVIRONMENT +9 −0
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-light-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-dark-default.png binary
  • native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-light-default.png binary
  • native/scripts/snapshots.sh +10 −5
diff --git a/native/apple/Sources/BaseKit/Ask/Card.swift b/native/apple/Sources/BaseKit/Ask/Card.swift
index b8b1ac7..3ac25a2 100644
--- a/native/apple/Sources/BaseKit/Ask/Card.swift
+++ b/native/apple/Sources/BaseKit/Ask/Card.swift
@@ -7,19 +7,21 @@ public struct BaseButtonStyle: ButtonStyle {
public enum Kind: Sendable { case primary, ghost }
let kind: Kind
var expands = false
+ /// `.btn.sm`: a row's button, 32 pt (the Store's).
+ var small = false
@Environment(\.colorScheme) private var scheme
@Environment(\.isEnabled) private var enabled
- public init(_ kind: Kind, expands: Bool = false) { self.kind = kind; self.expands = expands }
+ public init(_ kind: Kind, expands: Bool = false, small: Bool = false) { self.kind = kind; self.expands = expands; self.small = small }
public func makeBody(configuration: Configuration) -> some View {
let p = Palette(scheme)
- let shape = RoundedRectangle(cornerRadius: 10, style: .continuous)
+ let shape = RoundedRectangle(cornerRadius: small ? 8 : 10, style: .continuous)
configuration.label
- .font(BaseFont.body(15, .semibold))
+ .font(BaseFont.body(small ? 13.5 : 15, .semibold))
.lineLimit(2)
.multilineTextAlignment(.center)
- .padding(.horizontal, 18)
- .frame(minHeight: 44)
+ .padding(.horizontal, small ? 12 : 18)
+ .frame(minHeight: small ? 32 : 44)
.frame(maxWidth: expands ? .infinity : nil)
.foregroundStyle(kind == .primary ? p[.btnInk] : p[.frost])
.background(kind == .primary ? p[.btn] : p[.ghost], in: shape)
diff --git a/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings b/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
index f13bc3c..f89af09 100644
--- a/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
+++ b/native/apple/Sources/BaseKit/Resources/Localizable.xcstrings
@@ -841,6 +841,54 @@
}
}
},
+ "native.people.email_label": {
+ "comment": "Base on the web's approved copy (people.html aria-label). The invite field's accessibility label.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Teammate's email address"
+ }
+ }
+ }
+ },
+ "native.people.invite": {
+ "comment": "Base on the web's approved copy (people.html). The invite's button.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Send invite"
+ }
+ }
+ }
+ },
+ "native.people.invited_line": {
+ "comment": "Base on the web's approved copy (people.html). The line under someone invited who hasn't signed in.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Invited. Hasn't signed in yet."
+ }
+ }
+ }
+ },
+ "native.people.lead": {
+ "comment": "Base on the web's approved copy (people.html). People's line under its heading. {base} is the Base's name.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Everyone here can sign in to every app on {base}'s Base. Each app decides what they can do in it."
+ }
+ }
+ }
+ },
"native.people.mail_failed": {
"comment": "Base on the web's approved copy (people.html). People's line when the invitation email wasn't delivered.",
"extractionState": "manual",
@@ -853,6 +901,66 @@
}
}
},
+ "native.people.placeholder": {
+ "comment": "Base on the web's approved copy (people.html). The invite field's placeholder, an example address.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "maria@acme.co"
+ }
+ }
+ }
+ },
+ "native.people.role.invited": {
+ "comment": "Base on the web's approved copy (people.html). A person's tag.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Invited"
+ }
+ }
+ }
+ },
+ "native.people.role.member": {
+ "comment": "Base on the web's approved copy (people.html). A person's tag.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Member"
+ }
+ }
+ }
+ },
+ "native.people.role.owner": {
+ "comment": "Base on the web's approved copy (people.html). A person's tag.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Owner"
+ }
+ }
+ }
+ },
+ "native.people.title": {
+ "comment": "Base on the web's approved copy (people.html). The People screen's heading.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "People"
+ }
+ }
+ }
+ },
"native.phone.account_a11y": {
"comment": "The round button top right, with the person's initials, that opens the account menu.",
"extractionState": "manual",
@@ -1513,6 +1621,114 @@
}
}
},
+ "native.store.install": {
+ "comment": "Base on the web's approved copy (store.html). An app's button in the Store, and its VoiceOver action.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Install"
+ }
+ }
+ }
+ },
+ "native.store.installed": {
+ "comment": "Base on the web's approved copy (store.html). An installed app's tag, for a member who isn't the owner.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Installed"
+ }
+ }
+ }
+ },
+ "native.store.installing": {
+ "comment": "Base on the web's approved copy (store.html). An installing app's disabled button.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Installing"
+ }
+ }
+ }
+ },
+ "native.store.keep": {
+ "comment": "Base on the web's approved copy (uninstall.html). The Uninstall confirmation's cancel button.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Keep it"
+ }
+ }
+ }
+ },
+ "native.store.lead": {
+ "comment": "Base on the web's approved copy (store.html). The Store's line under its heading. {base} is the Base's name.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Apps that run on {base}'s Base. Install one and it's on Home for everyone at {base}."
+ }
+ }
+ }
+ },
+ "native.store.soon": {
+ "comment": "Base on the web's approved copy (store.html). The Store's last line; the names are bold (Markdown).",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Coming in later slices: **Keymail**, **Sporran** and the **Oficina** apps."
+ }
+ }
+ }
+ },
+ "native.store.title": {
+ "comment": "Base on the web's approved copy (store.html). The Store screen's heading.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Store"
+ }
+ }
+ }
+ },
+ "native.store.try_again": {
+ "comment": "Base on the web's approved copy (store.html). A failed app's button in the Store, and its VoiceOver action.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Try again"
+ }
+ }
+ }
+ },
+ "native.store.uninstall": {
+ "comment": "Base on the web's approved copy (store.html, uninstall.html). An installed app's button, its VoiceOver action, and the confirmation's destructive button.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Uninstall"
+ }
+ }
+ }
+ },
"native.store.uninstall.confirm": {
"comment": "Base on the web's approved copy (uninstall.html). The Store's Uninstall confirmation. {app} is the app's name, {base} the Base's name.",
"extractionState": "manual",
@@ -1525,6 +1741,18 @@
}
}
},
+ "native.store.uninstall.title": {
+ "comment": "Base on the web's approved copy (uninstall.html). The Uninstall confirmation's title. {app} is the app's name.",
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Uninstall {app}?"
+ }
+ }
+ }
+ },
"native.team.unavailable": {
"comment": "DRAFT 2026-11-28 (slice 2 part 1, for Luna). Store and People: a read or write that Base didn't answer (offline, or Base couldn't read its own store).",
"extractionState": "manual",
diff --git a/native/apple/Sources/BaseKit/Team/PeopleModel.swift b/native/apple/Sources/BaseKit/Team/PeopleModel.swift
index c1259ab..1ee51fa 100644
--- a/native/apple/Sources/BaseKit/Team/PeopleModel.swift
+++ b/native/apple/Sources/BaseKit/Team/PeopleModel.swift
@@ -22,9 +22,10 @@ import SwiftUI
let announce: @MainActor (String) -> Void
let hold: @MainActor (Duration) async -> Void
- public init(client: BaseClient, announce: @escaping @MainActor (String) -> Void = AskModel.announce,
+ /// `people`: what to show before the first read answers.
+ public init(client: BaseClient, people: PeopleData? = nil, announce: @escaping @MainActor (String) -> Void = AskModel.announce,
hold: @escaping @MainActor (Duration) async -> Void = StoreModel.sleep) {
- self.client = client; self.announce = announce; self.hold = hold
+ self.client = client; self.people = people; self.announce = announce; self.hold = hold
}
/// How many people are here, once People has loaded (the apps sheet's
diff --git a/native/apple/Sources/BaseKit/Team/PeopleView.swift b/native/apple/Sources/BaseKit/Team/PeopleView.swift
new file mode 100644
index 0000000..e8fe40d
--- /dev/null
+++ b/native/apple/Sources/BaseKit/Team/PeopleView.swift
@@ -0,0 +1,123 @@
+import SwiftUI
+
+/// People (mockups `mac-people`, `phone-people`): everyone here, as the
+/// web's page lists them, and for the owner the invite field. Each person
+/// is one VoiceOver element; the invite's refusal is announced, as the
+/// web's `role="status"` is.
+public struct PeopleView: View {
+ @Bindable var model: PeopleModel
+ let baseName: String
+ let layout: TeamLayout
+ @FocusState private var fieldFocused: Bool
+ @Environment(\.colorScheme) private var scheme
+ @Environment(\.dynamicTypeSize) private var typeSize
+
+ public init(model: PeopleModel, baseName: String, layout: TeamLayout) {
+ self.model = model; self.baseName = baseName; self.layout = layout
+ }
+
+ public var body: some View {
+ let p = Palette(scheme)
+ TeamPage(layout: layout, title: BaseText.text("native.people.title"),
+ lead: BaseText.format("native.people.lead", ["base": baseName])) {
+ if let error = model.error {
+ Text(verbatim: error).font(BaseFont.body(14, relativeTo: .subheadline)).foregroundStyle(p[.frost])
+ }
+ if let people = model.people {
+ if people.owner { invite(p) }
+ TeamGroup {
+ ForEach(people.people) { person in PersonRow(person: person) }
+ }
+ } else if model.failed {
+ Text(BaseText.text("native.team.unavailable")).font(BaseFont.body(14, relativeTo: .subheadline)).foregroundStyle(p[.haze])
+ } else {
+ ProgressView().controlSize(.small).frame(maxWidth: .infinity, alignment: .leading)
+ }
+ }
+ .onAppear { model.appear() }
+ }
+
+ private func invite(_ p: Palette) -> some View {
+ let shape = RoundedRectangle(cornerRadius: 10, style: .continuous)
+ // At the accessibility sizes the button goes under the field.
+ let stack = typeSize.isAccessibilitySize ? AnyLayout(VStackLayout(alignment: .leading, spacing: 8)) : AnyLayout(HStackLayout(spacing: 8))
+ return stack {
+ TextField(text: $model.email, prompt: Text(BaseText.text("native.people.placeholder")).foregroundStyle(p[.placeholder])) {
+ Text(BaseText.text("native.people.email_label"))
+ }
+ .textFieldStyle(.plain)
+ .font(BaseFont.body(16))
+ .autocorrectionDisabled()
+ #if os(iOS)
+ .keyboardType(.emailAddress)
+ .textInputAutocapitalization(.never)
+ .textContentType(.emailAddress)
+ #endif
+ .focused($fieldFocused)
+ .onSubmit { model.invite() }
+ .padding(.horizontal, 14).frame(minHeight: 44)
+ .background(p[.field], in: shape)
+ .overlay { shape.strokeBorder(p[.fieldEdge], lineWidth: 1) }
+ .accessibilityLabel(Text(BaseText.text("native.people.email_label")))
+ Button { model.invite() } label: {
+ // The busy rule: the label gives way to a spinner.
+ ZStack {
+ Text(BaseText.text("native.people.invite")).opacity(model.inviting ? 0 : 1)
+ if model.inviting { ProgressView().controlSize(.small) }
+ }
+ }
+ .buttonStyle(BaseButtonStyle(.primary))
+ .disabled(model.inviting)
+ .accessibilityLabel(Text(BaseText.text("native.people.invite")))
+ }
+ }
+}
+
+/// One person: their initial (filled once they've signed in), name or
+/// address, the line under it, and their role.
+struct PersonRow: View {
+ let person: Person
+ @Environment(\.colorScheme) private var scheme
+ @Environment(\.dynamicTypeSize) private var typeSize
+
+ var body: some View {
+ let p = Palette(scheme)
+ let joined = person.role != .invited
+ HStack(spacing: 12) {
+ // `.face.on` (ember into rose, ink) once they've signed in;
+ // `.face.off`, a ring, until then.
+ Text(verbatim: person.initial)
+ .font(BaseFont.body(13, .semibold, relativeTo: .caption))
+ .foregroundStyle(joined ? p[.ink] : p[.haze])
+ .frame(width: 36, height: 36)
+ .background(joined ? AnyShapeStyle(LinearGradient(colors: [p[.ember], p[.rose]], startPoint: .topLeading, endPoint: .bottomTrailing)) : AnyShapeStyle(.clear), in: Circle())
+ .overlay { if !joined { Circle().strokeBorder(p[.ringSoft], lineWidth: 1.5) } }
+ .dynamicTypeSize(...DynamicTypeSize.large)
+ VStack(alignment: .leading, spacing: 1) {
+ Text(verbatim: person.label).font(BaseFont.body(15, .semibold))
+ if let line { Text(verbatim: line).font(BaseFont.body(13, relativeTo: .footnote)).foregroundStyle(p[.haze]) }
+ // At the accessibility sizes the role goes under the name.
+ if typeSize.isAccessibilitySize { TeamTag(text: role) }
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ if !typeSize.isAccessibilitySize { TeamTag(text: role) }
+ }
+ .padding(.vertical, 10)
+ .accessibilityElement(children: .ignore)
+ .accessibilityLabel(Text(verbatim: ([person.label, line, role] as [String?]).compactMap { $0 }.joined(separator: ", ")))
+ }
+
+ /// The address under a name, or the web's line for someone invited.
+ private var line: String? {
+ if person.role == .invited { return BaseText.text("native.people.invited_line") }
+ return person.name.isEmpty ? nil : person.email
+ }
+
+ private var role: String {
+ switch person.role {
+ case .owner: BaseText.text("native.people.role.owner")
+ case .member: BaseText.text("native.people.role.member")
+ case .invited: BaseText.text("native.people.role.invited")
+ }
+ }
+}
diff --git a/native/apple/Sources/BaseKit/Team/StoreModel.swift b/native/apple/Sources/BaseKit/Team/StoreModel.swift
index cd40e41..72c6b47 100644
--- a/native/apple/Sources/BaseKit/Team/StoreModel.swift
+++ b/native/apple/Sources/BaseKit/Team/StoreModel.swift
@@ -42,11 +42,13 @@ import SwiftUI
private var generation = 0
private var pollScheduled = false
- public init(client: BaseClient, baseName: String,
+ /// `store`: what to show before the first read answers (the last one
+ /// seen, or a fixture).
+ public init(client: BaseClient, baseName: String, store: StoreData? = nil,
schedule: @escaping @MainActor (Duration, @escaping @MainActor () -> Void) -> Void = AskModel.later,
announce: @escaping @MainActor (String) -> Void = AskModel.announce,
hold: @escaping @MainActor (Duration) async -> Void = StoreModel.sleep) {
- self.client = client; self.baseName = baseName; self.schedule = schedule; self.announce = announce; self.hold = hold
+ self.client = client; self.baseName = baseName; self.store = store; self.schedule = schedule; self.announce = announce; self.hold = hold
}
public static func sleep(_ d: Duration) async { try? await Task.sleep(for: d) }
diff --git a/native/apple/Sources/BaseKit/Team/StoreView.swift b/native/apple/Sources/BaseKit/Team/StoreView.swift
new file mode 100644
index 0000000..8e92406
--- /dev/null
+++ b/native/apple/Sources/BaseKit/Team/StoreView.swift
@@ -0,0 +1,198 @@
+import SwiftUI
+
+/// Where a Store or People screen is drawn: the Mac window's pane, or a
+/// screen pushed from the iPhone's apps sheet.
+public enum TeamLayout: Sendable { case window, phone }
+
+/// The Store (mockups `mac-store`, `phone-store`): what the web's Store
+/// page shows, natively. Each row is one VoiceOver element with its
+/// action named; polling never moves focus, and only an install that
+/// finishes or fails is announced (StoreModel).
+public struct StoreView: View {
+ @Bindable var model: StoreModel
+ let layout: TeamLayout
+ @Environment(\.colorScheme) private var scheme
+
+ public init(model: StoreModel, layout: TeamLayout) { self.model = model; self.layout = layout }
+
+ public var body: some View {
+ let p = Palette(scheme)
+ TeamPage(layout: layout, title: BaseText.text("native.store.title"),
+ lead: BaseText.format("native.store.lead", ["base": model.baseName])) {
+ if let notice = model.notice {
+ Text(verbatim: notice).font(BaseFont.body(14, relativeTo: .subheadline)).foregroundStyle(p[.frost])
+ }
+ if let store = model.store {
+ TeamGroup {
+ ForEach(store.rows) { row in StoreRowView(model: model, row: row, layout: layout) }
+ }
+ Text(soon).font(BaseFont.body(14, relativeTo: .subheadline)).foregroundStyle(p[.haze])
+ } else if model.failed {
+ Text(BaseText.text("native.team.unavailable")).font(BaseFont.body(14, relativeTo: .subheadline)).foregroundStyle(p[.haze])
+ } else {
+ ProgressView().controlSize(.small).frame(maxWidth: .infinity, alignment: .leading)
+ }
+ }
+ .confirmationDialog(Text(verbatim: model.pendingUninstall.map { BaseText.format("native.store.uninstall.title", ["app": $0.name]) } ?? ""),
+ isPresented: Binding(get: { model.pendingUninstall != nil }, set: { if !$0 { model.cancelUninstall() } }),
+ titleVisibility: layout == .window ? .visible : .hidden) {
+ Button(BaseText.text("native.store.uninstall"), role: .destructive) { model.confirmUninstall() }
+ Button(BaseText.text("native.store.keep"), role: .cancel) { model.cancelUninstall() }
+ } message: {
+ Text(verbatim: model.confirmation ?? "")
+ }
+ .onAppear { model.appear() }
+ .onDisappear { model.disappear() }
+ }
+
+ /// The web's "Coming in later slices" line, its names in bold.
+ private var soon: AttributedString {
+ (try? AttributedString(markdown: BaseText.text("native.store.soon"))) ?? AttributedString(BaseText.text("native.store.soon"))
+ }
+}
+
+/// One app: its tile, name and summary (and a failed install's reason),
+/// and what the member may do with it.
+struct StoreRowView: View {
+ let model: StoreModel
+ let row: StoreRow
+ let layout: TeamLayout
+ @Environment(\.colorScheme) private var scheme
+ @Environment(\.dynamicTypeSize) private var typeSize
+
+ var body: some View {
+ let p = Palette(scheme)
+ let action = model.action(row)
+ // At the accessibility sizes the button goes under the words.
+ let stack = typeSize.isAccessibilitySize ? AnyLayout(VStackLayout(alignment: .leading, spacing: 8)) : AnyLayout(HStackLayout(spacing: 12))
+ stack {
+ AppIcon(HomeData.App(id: row.id, kind: .installed, name: row.name, url: nil, tint: row.tint, iconSVG: row.iconSVG),
+ size: 40, transport: nil)
+ VStack(alignment: .leading, spacing: 1) {
+ Text(verbatim: row.name).font(BaseFont.body(15, .semibold))
+ if !row.summary.isEmpty {
+ Text(verbatim: row.summary).font(BaseFont.body(13, relativeTo: .footnote)).foregroundStyle(p[.haze])
+ }
+ if row.state == .failed {
+ Text(verbatim: model.reason(row)).font(BaseFont.body(13, relativeTo: .footnote)).foregroundStyle(p[.haze])
+ }
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ control(action, p)
+ }
+ .padding(.vertical, 10)
+ // One element: the app, its state, and its action by name.
+ .accessibilityElement(children: .ignore)
+ .accessibilityLabel(Text(verbatim: spoken(action)))
+ .modifier(StoreRowActions(model: model, row: row, action: action))
+ }
+
+ @ViewBuilder private func control(_ action: StoreModel.Action, _ p: Palette) -> some View {
+ switch action {
+ case .install:
+ Button(BaseText.text("native.store.install")) { model.install(row.id) }.buttonStyle(BaseButtonStyle(.primary, small: true))
+ case .tryAgain:
+ Button(BaseText.text("native.store.try_again")) { model.install(row.id) }.buttonStyle(BaseButtonStyle(.primary, small: true))
+ case .uninstall:
+ Button { model.requestUninstall(row.id) } label: {
+ if model.uninstalling == row.id { ProgressView().controlSize(.small) } else { Text(BaseText.text("native.store.uninstall")) }
+ }
+ .buttonStyle(BaseButtonStyle(.ghost, small: true))
+ .disabled(model.uninstalling != nil)
+ case .installing:
+ // `.btn.sm.installing`: the button, held, with a steady spinner.
+ Button {} label: {
+ HStack(spacing: 7) { ProgressView().controlSize(.mini).tint(Palette(scheme)[.btnInk]); Text(BaseText.text("native.store.installing")) }
+ }
+ .buttonStyle(BaseButtonStyle(.primary, small: true))
+ .disabled(true)
+ case .installedTag:
+ TeamTag(text: BaseText.text("native.store.installed"))
+ case .none:
+ EmptyView()
+ }
+ }
+
+ private func spoken(_ action: StoreModel.Action) -> String {
+ var parts = [row.name]
+ if !row.summary.isEmpty { parts.append(row.summary) }
+ switch row.state {
+ case .installing: parts.append(BaseText.text("native.store.installing"))
+ case .installed: parts.append(BaseText.text("native.store.installed"))
+ case .failed: parts.append(model.reason(row))
+ case .notInstalled: break
+ }
+ return parts.joined(separator: ", ")
+ }
+}
+
+/// A Store row's action, named for VoiceOver.
+struct StoreRowActions: ViewModifier {
+ let model: StoreModel
+ let row: StoreRow
+ let action: StoreModel.Action
+ func body(content: Content) -> some View {
+ switch action {
+ case .install: content.accessibilityAction(named: Text(BaseText.text("native.store.install"))) { model.install(row.id) }
+ case .tryAgain: content.accessibilityAction(named: Text(BaseText.text("native.store.try_again"))) { model.install(row.id) }
+ case .uninstall: content.accessibilityAction(named: Text(BaseText.text("native.store.uninstall"))) { model.requestUninstall(row.id) }
+ default: content
+ }
+ }
+}
+
+/// `.tag`: a row's quiet label on its end (Installed, Owner, Member).
+struct TeamTag: View {
+ let text: String
+ @Environment(\.colorScheme) private var scheme
+ var body: some View {
+ Text(verbatim: text).font(BaseFont.body(13, relativeTo: .footnote)).foregroundStyle(Palette(scheme)[.haze])
+ }
+}
+
+/// A Store or People page: the heading, its lead, then the content, in a
+/// scroll, as the web's `.sheet` lays them out.
+struct TeamPage<Content: View>: View {
+ let layout: TeamLayout
+ let title: String
+ let lead: String
+ @ViewBuilder let content: Content
+ @Environment(\.colorScheme) private var scheme
+
+ var body: some View {
+ let p = Palette(scheme)
+ ScrollView {
+ VStack(alignment: .leading, spacing: 16) {
+ Text(verbatim: title).font(BaseFont.heading(layout == .window ? 30 : 32, .semibold, relativeTo: .largeTitle))
+ .accessibilityAddTraits(.isHeader)
+ Text(verbatim: lead).font(BaseFont.body(16, relativeTo: .body)).foregroundStyle(p[.frost].opacity(0.86))
+ .fixedSize(horizontal: false, vertical: true)
+ content
+ }
+ .frame(maxWidth: layout == .window ? 664 : .infinity, alignment: .leading)
+ .padding(.horizontal, layout == .window ? 24 : 16)
+ .padding(.top, layout == .window ? 28 : 8)
+ .padding(.bottom, 24)
+ .frame(maxWidth: .infinity)
+ }
+ .foregroundStyle(p[.frost])
+ }
+}
+
+/// `.ngroup.glass`: rows on glass, ruled between them.
+struct TeamGroup<Content: View>: View {
+ @ViewBuilder let content: Content
+ @Environment(\.colorScheme) private var scheme
+ var body: some View {
+ VStack(spacing: 0) {
+ Group(subviews: content) { rows in
+ ForEach(Array(rows.enumerated()), id: \.offset) { index, row in
+ if index > 0 { Rectangle().fill(Palette(scheme)[.rule]).frame(height: 1) }
+ row
+ }
+ }
+ }
+ .padding(.horizontal, 14).padding(.vertical, 2)
+ .glass(cornerRadius: 14)
+ }
+}
diff --git a/native/apple/Tests/BaseSnapshots/TeamSnapshots.swift b/native/apple/Tests/BaseSnapshots/TeamSnapshots.swift
new file mode 100644
index 0000000..8807992
--- /dev/null
+++ b/native/apple/Tests/BaseSnapshots/TeamSnapshots.swift
@@ -0,0 +1,90 @@
+import BaseKit
+import Foundation
+import RastrilloApple
+import RastrilloSnapshots
+import RastrilloTestSupport
+import SwiftUI
+import XCTest
+
+/// Store and People, natively (slice 2 Task 9; mockups mac-store,
+/// mac-people, phone-store, phone-people): the owner's and a member's, light
+/// and dark, the iPhone also at AX3. The Uninstall confirmation is the
+/// system's dialog, which no snapshot can draw; its words are
+/// StoreModelTests'.
+final class TeamSnapshots: XCTestCase {
+ @MainActor func testTeam() async throws {
+ try XCTSkipUnless(ProcessInfo.processInfo.environment["RASTRILLO_SNAPSHOTS"] != nil, "Run with native/scripts/snapshots.sh")
+ BaseFonts.register()
+ await assertSnapshots(of: Self.catalog)
+ }
+
+ #if os(macOS)
+ static let layout = TeamLayout.window
+ #else
+ static let layout = TeamLayout.phone
+ #endif
+
+ @MainActor static var catalog: SnapshotCatalog {
+ SnapshotCatalog(app: "base-team", settings: SnapshotSettings(tint: LookSnapshots.tint), screens: [
+ SnapshotScreen("store-owner", mac: .fixed(width: 1000, height: 640), iphone: .fixed(width: 402, height: 874)) {
+ TeamFrame { StoreView(model: TeamFixtures.store(owner: true), layout: layout) }
+ },
+ SnapshotScreen("store-member", mac: .fixed(width: 1000, height: 640), iphone: .fixed(width: 402, height: 874)) {
+ TeamFrame { StoreView(model: TeamFixtures.store(owner: false), layout: layout) }
+ },
+ SnapshotScreen("people-owner", mac: .fixed(width: 1000, height: 640), iphone: .fixed(width: 402, height: 874)) {
+ TeamFrame { PeopleView(model: TeamFixtures.people(owner: true), baseName: "Fennel & Rye", layout: layout) }
+ },
+ SnapshotScreen("people-member", mac: .fixed(width: 1000, height: 640), iphone: .fixed(width: 402, height: 874)) {
+ TeamFrame { PeopleView(model: TeamFixtures.people(owner: false), baseName: "Fennel & Rye", layout: layout) }
+ },
+ ])
+ }
+}
+
+/// The screen on the sky, in the Mac's pane sheet or the iPhone's screen.
+struct TeamFrame<Content: View>: View {
+ @ViewBuilder let content: Content
+ var body: some View {
+ ZStack {
+ Sky()
+ #if os(macOS)
+ content.glassSheet(cornerRadius: 18).padding(10)
+ #else
+ content.padding(.top, 54)
+ #endif
+ }
+ .skyFrozen()
+ }
+}
+
+@MainActor enum TeamFixtures {
+ static func storeData(owner: Bool) -> StoreData {
+ let spark = #"<svg viewBox="0 0 24 24"><path d="M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8"/></svg>"#
+ let note = #"<svg viewBox="0 0 24 24"><path d="M6 3h9l4 4v13a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"/><path d="M15 3v4h4M8.5 12h7M8.5 15.5h5"/></svg>"#
+ let lock = #"<svg viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="14" rx="2"/><circle cx="12" cy="11" r="3.5"/><path d="M12 11V7.5M7.5 18v2M16.5 18v2"/></svg>"#
+ return StoreData(owner: owner, rows: [
+ StoreRow(id: "welcome", name: "Welcome", summary: "A short tour of your team's Base.", tint: "amber", iconSVG: spark, state: .installed),
+ StoreRow(id: "scratchpad", name: "Scratchpad", summary: "A shared page for quick notes.", tint: "rose", iconSVG: note, state: .failed,
+ error: "The app did not start answering"),
+ StoreRow(id: "contra", name: "Contra", summary: "Passwords only your own devices can open.", tint: "teal", iconSVG: lock, state: .installing),
+ ])
+ }
+
+ static func store(owner: Bool) -> StoreModel {
+ let data = storeData(owner: owner)
+ // Never answers: the fixture is what shows.
+ return StoreModel(client: BaseClient(transport: ScriptedTransport(responder: { _ in .hang })) {}, baseName: "Fennel & Rye",
+ store: data, schedule: { _, _ in }, announce: { _ in })
+ }
+
+ static func people(owner: Bool) -> PeopleModel {
+ let data = PeopleData(owner: owner, people: [
+ Person(id: "m1", initial: "A", name: "Ana Murphy", email: "ana@fennelandrye.ie", role: .member),
+ Person(id: "m2", initial: "P", name: "Paul Campbell", email: "paul@fennelandrye.ie", role: .owner),
+ Person(id: "m3", initial: "S", name: "Seán Doyle", email: "sean@fennelandrye.ie", role: .member),
+ Person(id: "m4", initial: "M", name: "", email: "maria@acme.co", role: .invited),
+ ])
+ return PeopleModel(client: BaseClient(transport: ScriptedTransport(responder: { _ in .hang })) {}, people: data, announce: { _ in })
+ }
+}
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/ENVIRONMENT b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/ENVIRONMENT
new file mode 100644
index 0000000..a26fa8a
--- /dev/null
+++ b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/ENVIRONMENT
@@ -0,0 +1,10 @@
+os: iOS 27.0.0
+device: iPhone19,2
+runtime: 27.0 (24A434)
+toolchain: Xcode 27.2 Build version 27B52
+language: en
+locale: en_IE
+time zone: Europe/Dublin
+increase contrast: off
+reduce transparency: off
+differentiate without colour: off
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-ax3.png
new file mode 100644
index 0000000..20ae297
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-default.png
new file mode 100644
index 0000000..582b88f
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-ax3.png
new file mode 100644
index 0000000..e64d05d
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-default.png
new file mode 100644
index 0000000..70ef6d5
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-member-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-ax3.png
new file mode 100644
index 0000000..0eb52e8
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-default.png
new file mode 100644
index 0000000..b3da662
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-ax3.png
new file mode 100644
index 0000000..035a99f
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-default.png
new file mode 100644
index 0000000..3df8e33
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/people-owner-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-ax3.png
new file mode 100644
index 0000000..e47f92a
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-default.png
new file mode 100644
index 0000000..91ecd4d
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-ax3.png
new file mode 100644
index 0000000..f234dd2
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-default.png
new file mode 100644
index 0000000..61b2779
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-member-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-ax3.png
new file mode 100644
index 0000000..287228b
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-default.png
new file mode 100644
index 0000000..61099c2
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-ax3.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-ax3.png
new file mode 100644
index 0000000..c3b171b
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-ax3.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-default.png
new file mode 100644
index 0000000..1b19abd
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/iphone/store-owner-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/ENVIRONMENT b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/ENVIRONMENT
new file mode 100644
index 0000000..2a04923
--- /dev/null
+++ b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/ENVIRONMENT
@@ -0,0 +1,9 @@
+os: macOS 27.0.0
+toolchain: Xcode 27.2 Build version 27B52
+language: en
+accent: #007AFF
+locale: en_IE
+time zone: Europe/Dublin
+increase contrast: off
+reduce transparency: off
+differentiate without colour: off
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-dark-default.png
new file mode 100644
index 0000000..da8fb98
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-light-default.png
new file mode 100644
index 0000000..80dd110
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-member-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-dark-default.png
new file mode 100644
index 0000000..00b8ed0
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-light-default.png
new file mode 100644
index 0000000..50ddd92
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/people-owner-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-dark-default.png
new file mode 100644
index 0000000..17507d8
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-light-default.png
new file mode 100644
index 0000000..f7ce03d
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-member-light-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-dark-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-dark-default.png
new file mode 100644
index 0000000..a8ad863
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-dark-default.png differ
diff --git a/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-light-default.png b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-light-default.png
new file mode 100644
index 0000000..72a5914
Binary files /dev/null and b/native/apple/Tests/BaseSnapshots/__Snapshots__/base-team/mac/store-owner-light-default.png differ
diff --git a/native/scripts/snapshots.sh b/native/scripts/snapshots.sh
index 7af0247..7c05cfa 100755
--- a/native/scripts/snapshots.sh
+++ b/native/scripts/snapshots.sh
@@ -4,7 +4,11 @@
# Ask (the mockups' thread, its states and cards), light and dark, and on
# iPhone at the default size and AX3.
#
-# native/scripts/snapshots.sh [compare|record] [mac|iphone|all]
+# native/scripts/snapshots.sh [compare|record] [mac|iphone|all] [Class]
+#
+# Class (e.g. TeamSnapshots) runs that one catalog, so a task records only
+# the pictures it means to change. Builds are capped at four jobs: the
+# machine is shared.
#
# compare (the default) fails on any changed, missing or stale picture;
# record redraws the baselines in apple/Tests/BaseSnapshots/__Snapshots__/.
@@ -22,6 +26,7 @@ set -eu
cd "$(dirname "$0")/.."
mode=${1:-compare}
platforms=${2:-all}
+only=${3:-}
case "$mode" in compare|record) ;; *) echo "usage: $0 [compare|record] [mac|iphone|all]" >&2; exit 2 ;; esac
case "$platforms" in mac|iphone|all) ;; *) echo "usage: $0 [compare|record] [mac|iphone|all]" >&2; exit 2 ;; esac
scripts/fonts-into-bundle.sh
@@ -32,13 +37,13 @@ tools="$shared/tools"
failed=0
case "$platforms" in mac|all)
- (cd apple && swift build --build-tests)
- if ! (cd apple && "$tools/snapshots-mac.sh" "$mode" BaseSnapshots); then failed=1; fi ;;
+ (cd apple && swift build -j 4 --build-tests)
+ if ! (cd apple && "$tools/snapshots-mac.sh" "$mode" "BaseSnapshots${only:+.$only}" -j 4); then failed=1; fi ;;
esac
case "$platforms" in iphone|all)
xcodegen generate --spec ios/project.yml
- if ! (cd apple && SNAPSHOT_DERIVED_DATA=.build/xcode "$tools/snapshots-iphone.sh" "$mode" BasePhoneSnapshots BasePhoneSnapshots \
- -project ../ios/BasePhone.xcodeproj -test-timeouts-enabled YES -default-test-execution-time-allowance 120); then
+ if ! (cd apple && SNAPSHOT_DERIVED_DATA=.build/xcode "$tools/snapshots-iphone.sh" "$mode" BasePhoneSnapshots "BasePhoneSnapshots${only:+/$only}" \
+ -project ../ios/BasePhone.xcodeproj -jobs 4 -test-timeouts-enabled YES -default-test-execution-time-allowance 120); then
failed=1
fi ;;
esac