oficina / meet Public

Clone
git clone https://amadan.net/oficina/meet

Plain git — no account needed to clone.

Download

Download this file

1import AppKit
2import CallsKit
3import SwiftUI
4
5/// Offline visual fixtures of Calls → Settings…, beside the lobby's. The
6/// window is drawn with a throwaway defaults suite so a fixture never
7/// changes the preferences of the person running it.
8@MainActor enum SettingsSnapshots {
9 static func save(to folder: URL) async throws {
10 let suite = "CallsInterop.SettingsSnapshots"
11 guard let defaults = UserDefaults(suiteName: suite) else { return }
12 defaults.removePersistentDomain(forName: suite)
13 defer { defaults.removePersistentDomain(forName: suite) }
14 for scheme in [ColorScheme.light, .dark] {
15 try await LobbySnapshots.render(
16 CallsSettingsView(model: CallsModel(defaults: defaults)).defaultAppStorage(defaults),
17 scheme: scheme, size: nil,
18 to: folder.appendingPathComponent("settings-\(LobbySnapshots.name(scheme)).png"))
19 }
20 }
21}
22