Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

feat(meetings): rebrand FluidMeet and rebuild meeting home

altic-dev65d289eba5c4
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index 32d5a4ac..edd89dc3 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -1410,7 +1410,7 @@ struct ContentView: View {
self.sidebarNavigationLink(.fileTranscription, title: "File Transcription", systemImage: "doc.text.fill")
self.sidebarNavigationLink(
.meetingTranscription,
- title: "Meet Assist",
+ title: "FluidMeet",
systemImage: "person.2.fill"
)
} header: {
diff --git a/Sources/Fluid/Services/Meeting/Backend/MeetingNemotronModelLocator.swift b/Sources/Fluid/Services/Meeting/Backend/MeetingNemotronModelLocator.swift
index 4d837ebe..d14facac 100644
--- a/Sources/Fluid/Services/Meeting/Backend/MeetingNemotronModelLocator.swift
+++ b/Sources/Fluid/Services/Meeting/Backend/MeetingNemotronModelLocator.swift
@@ -36,7 +36,7 @@ nonisolated enum MeetingNemotronModelReadinessError: LocalizedError, Equatable {
switch self {
case let .modelNotInstalled(path):
return "The Nemotron diarization model is not installed at \(path). "
- + "Open Meet Assist settings and load the supplied speaker separation model before recording."
+ + "Open FluidMeet settings and load the supplied speaker separation model before recording."
case let .invalidModelPackage(reason):
return "The Nemotron diarization model package is invalid (\(reason))."
case let .artifactChanged(path):
diff --git a/Sources/Fluid/Services/MenuBarManager.swift b/Sources/Fluid/Services/MenuBarManager.swift
index 262869f7..1dfc8a86 100644
--- a/Sources/Fluid/Services/MenuBarManager.swift
+++ b/Sources/Fluid/Services/MenuBarManager.swift
@@ -925,7 +925,7 @@ final class MenuBarManager: NSObject, ObservableObject, NSMenuDelegate {
self.meetingStatusMenuItem = meetingStatusItem
let openMeetingItem = NSMenuItem(
- title: "Open Meet Assist",
+ title: "Open FluidMeet",
action: #selector(openMeetingTranscription),
keyEquivalent: ""
)
@@ -1077,24 +1077,24 @@ final class MenuBarManager: NSObject, ObservableObject, NSMenuDelegate {
break
case .preparing:
self.meetingStatusMenuItem?.title = "Starting meeting recording…"
- self.openMeetingTranscriptionMenuItem?.title = "Open Meet Assist"
+ self.openMeetingTranscriptionMenuItem?.title = "Open FluidMeet"
case .recording:
let source = self.meetingMenuPresentation.sourceName ?? "Meeting"
let elapsed = self.meetingMenuPresentation.startedAt.map { Self.elapsedText(now.timeIntervalSince($0)) } ?? "0:00"
self.meetingStatusMenuItem?.title = "Recording \(source) · \(elapsed)"
- self.openMeetingTranscriptionMenuItem?.title = "Open Meet Assist"
+ self.openMeetingTranscriptionMenuItem?.title = "Open FluidMeet"
case .stopping:
self.meetingStatusMenuItem?.title = "Finalizing meeting audio…"
- self.openMeetingTranscriptionMenuItem?.title = "Open Meet Assist"
+ self.openMeetingTranscriptionMenuItem?.title = "Open FluidMeet"
case .processing:
self.meetingStatusMenuItem?.title = "Transcribing meeting…"
- self.openMeetingTranscriptionMenuItem?.title = "Open Meet Assist"
+ self.openMeetingTranscriptionMenuItem?.title = "Open FluidMeet"
case .interrupted:
self.meetingStatusMenuItem?.title = self.meetingMenuPresentation.attentionStatus ?? "Recording interrupted"
- self.openMeetingTranscriptionMenuItem?.title = "Open Meet Assist"
+ self.openMeetingTranscriptionMenuItem?.title = "Open FluidMeet"
case .failed:
self.meetingStatusMenuItem?.title = self.meetingMenuPresentation.attentionStatus ?? "Meeting setup failed"
- self.openMeetingTranscriptionMenuItem?.title = "Open Meet Assist"
+ self.openMeetingTranscriptionMenuItem?.title = "Open FluidMeet"
case .completed:
self.openMeetingTranscriptionMenuItem?.title = "Open Latest Meeting Transcript"
}
diff --git a/Sources/Fluid/UI/MeetingAssignSpeakersSheet.swift b/Sources/Fluid/UI/MeetingAssignSpeakersSheet.swift
index ab6dc9b4..72c6e7e3 100644
--- a/Sources/Fluid/UI/MeetingAssignSpeakersSheet.swift
+++ b/Sources/Fluid/UI/MeetingAssignSpeakersSheet.swift
@@ -18,7 +18,7 @@ nonisolated enum MeetingAssignSpeakersQuoteSource {
}
private static func truncated(_ text: String) -> String {
- guard text.count > Self.maxQuoteLength else { return text }
+ guard text.count > self.maxQuoteLength else { return text }
let cutoff = text.index(text.startIndex, offsetBy: Self.maxQuoteLength)
let prefix = text[text.startIndex..<cutoff]
if let lastSpace = prefix.lastIndex(of: " ") {
@@ -43,7 +43,8 @@ nonisolated enum MeetingAssignSpeakersValidation {
}
for index in resulting.indices {
for other in resulting[(index + 1)...]
- where other.name.caseInsensitiveCompare(resulting[index].name) == .orderedSame {
+ where other.name.caseInsensitiveCompare(resulting[index].name) == .orderedSame
+ {
guard resulting[index].changed || other.changed else { continue }
return other.name
}
@@ -120,16 +121,18 @@ struct MeetingAssignSpeakersSheet: View {
Divider()
- HStack(spacing: self.theme.metrics.spacing.md) {
- Spacer()
- Button("Cancel", action: self.onCancel)
- .fluidButton(.compact, size: .medium)
- .keyboardShortcut(.cancelAction)
- .disabled(self.isSaving)
- Button("Save names") { Task { await self.save() } }
- .fluidButton(.accent, size: .medium)
- .keyboardShortcut(.defaultAction)
- .disabled(self.isSaving)
+ FluidGlassControlGroup {
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Button("Cancel", action: self.onCancel)
+ .meetingGlassAction()
+ .keyboardShortcut(.cancelAction)
+ .disabled(self.isSaving)
+ Spacer()
+ Button(self.isSaving ? "Saving…" : "Save names") { Task { await self.save() } }
+ .meetingGlassAction(prominent: true)
+ .keyboardShortcut(.defaultAction)
+ .disabled(self.isSaving)
+ }
}
.padding(self.theme.metrics.spacing.lg)
}
@@ -150,7 +153,8 @@ struct MeetingAssignSpeakersSheet: View {
Spacer()
Button("Close", systemImage: "xmark") { self.onCancel() }
.labelStyle(.iconOnly)
- .buttonStyle(.borderless)
+ .meetingGlassAction(circular: true)
+ .disabled(self.isSaving)
.accessibilityLabel("Close")
}
.padding(.horizontal, self.theme.metrics.spacing.xl)
@@ -174,7 +178,7 @@ struct MeetingAssignSpeakersSheet: View {
let quotes = self.quotesBySpeaker[speaker.id] ?? []
if quotes.isEmpty {
- Text("No sample audio")
+ Text("No transcript sample")
.font(self.theme.typography.bodySmall)
.foregroundStyle(self.theme.palette.tertiaryText)
.padding(.leading, self.theme.metrics.spacing.md)
@@ -204,6 +208,8 @@ struct MeetingAssignSpeakersSheet: View {
prompt: Text(speaker.displayName)
)
.textFieldStyle(.roundedBorder)
+ .controlSize(.large)
+ .accessibilityLabel("Name for \(speaker.displayName)")
.focused(self.$focusedField, equals: speaker.id)
.disabled(self.isSaving)
}
diff --git a/Sources/Fluid/UI/MeetingModelSettingsSection.swift b/Sources/Fluid/UI/MeetingModelSettingsSection.swift
index 663c5f5b..24e90420 100644
--- a/Sources/Fluid/UI/MeetingModelSettingsSection.swift
+++ b/Sources/Fluid/UI/MeetingModelSettingsSection.swift
@@ -6,34 +6,58 @@ struct MeetingModelSettingsSection: View {
@State private var installed: MeetingNemotronModelArtifact?
@State private var isBusy = true
@State private var message: String?
+ @State private var showingDetails = false
var body: some View {
- FluidManagementGroup(title: "Speaker separation model") {
+ FluidManagementGroup(title: "Speaker labels") {
VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) {
HStack(spacing: self.theme.metrics.spacing.lg) {
VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text("Identify each speaker")
+ .font(self.theme.typography.bodyStrong)
+ .foregroundStyle(self.theme.palette.primaryText)
if self.isBusy {
- HStack { ProgressView().controlSize(.small); Text("Validating model…") }
- } else if let installed {
- Label("Ready", systemImage: "checkmark.circle.fill")
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ ProgressView().controlSize(.small)
+ Text("Checking model…")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ } else if self.installed != nil {
+ Label("Ready · runs after recording", systemImage: "checkmark.circle.fill")
+ .font(self.theme.typography.caption)
.foregroundStyle(self.theme.palette.success)
- Text("Nemotron FP16 · \(ByteCountFormatter.string(fromByteCount: installed.totalByteCount, countStyle: .file))")
+ } else {
+ Text(CPUArchitecture.isAppleSilicon ? "Import a model to get started." : "Apple silicon required.")
.font(self.theme.typography.caption)
.foregroundStyle(self.theme.palette.secondaryText)
- } else {
- Text("Not installed").font(self.theme.typography.bodyStrong)
}
}
Spacer(minLength: self.theme.metrics.spacing.md)
- Button(self.installed == nil ? "Load model…" : "Replace model…", action: self.choosePackage)
- .fluidGlassAction()
+ Button(self.installed == nil ? "Import model…" : "Replace…", action: self.choosePackage)
+ .meetingGlassAction()
.disabled(self.isBusy || !CPUArchitecture.isAppleSilicon)
}
- Text(CPUArchitecture.isAppleSilicon
- ? "Beta: choose the supplied .mlpackage. A copy is saved in FluidVoice and stays ready after restarting. No recording starts."
- : "Speaker separation requires an Apple silicon Mac.")
+ DisclosureGroup(isExpanded: self.$showingDetails) {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ if let installed {
+ Text("Nemotron FP16 · \(ByteCountFormatter.string(fromByteCount: installed.totalByteCount, countStyle: .file))")
+ }
+ Text(CPUArchitecture.isAppleSilicon
+ ? "Choose the supplied .mlpackage. A copy stays on this Mac and is ready after restarting."
+ : "FluidMeet recording currently requires an Apple silicon Mac.")
+ Text("Model changes are applied immediately, even if you cancel these settings. Importing a model does not start recording.")
+ }
.font(self.theme.typography.caption)
.foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ .padding(.top, self.theme.metrics.spacing.sm)
+ } label: {
+ Text("Model details")
+ .meetingHoverFeedback(cornerRadius: self.theme.metrics.corners.sm)
+ }
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.theme.palette.secondaryText)
if let message {
Text(message).font(self.theme.typography.caption).foregroundStyle(self.theme.palette.warning)
}
diff --git a/Sources/Fluid/UI/MeetingRecordingSettingsSheet.swift b/Sources/Fluid/UI/MeetingRecordingSettingsSheet.swift
new file mode 100644
index 00000000..74740978
--- /dev/null
+++ b/Sources/Fluid/UI/MeetingRecordingSettingsSheet.swift
@@ -0,0 +1,577 @@
+import AppKit
+import SwiftUI
+
+enum MeetingSettingsSection: String, CaseIterable, Identifiable {
+ case recording = "Recording"
+ case automation = "Automation & storage"
+ case integrations = "Integrations"
+
+ var id: String { self.rawValue }
+
+ var symbol: String {
+ switch self {
+ case .recording: "waveform"
+ case .automation: "slider.horizontal.3"
+ case .integrations: "link"
+ }
+ }
+
+ var guidance: String {
+ switch self {
+ case .recording: "Choose your audio sources. Transcripts are currently in English."
+ case .automation: "Choose when to see a recording prompt and how long to keep audio."
+ case .integrations: "Connect your meeting notes to the AI assistants you already use."
+ }
+ }
+}
+
+struct MeetingRecordingSettingsSheet: View {
+ @Binding var draft: MeetingTranscriptionSetupDraft
+ @Binding var retentionPolicy: MeetingAudioRetentionPolicy
+ @ObservedObject private var dismissalAdvisor = MeetingAutoDetectDismissalAdvisor.shared
+ @ObservedObject private var appServices = AppServices.shared
+
+ let applications: [MeetingApplicationOption]
+ let microphones: [MeetingMicrophoneOption]
+ let readiness: MeetingSetupReadiness
+ let isFirstSetup: Bool
+ let onRefreshSources: () -> Void
+ let onOpenMicrophoneSettings: @MainActor @Sendable () -> Void
+ let onOpenScreenRecordingSettings: @MainActor @Sendable () -> Void
+ let onOpenVoiceEngine: () -> Void
+ let onCancel: () -> Void
+ let onSave: () -> Void
+
+ @Environment(\.theme) private var theme
+
+ @State private var selectedSection: MeetingSettingsSection
+
+ // Keeps the existing sheet's bindings and callbacks together at its presentation boundary.
+ init(
+ draft: Binding<MeetingTranscriptionSetupDraft>,
+ retentionPolicy: Binding<MeetingAudioRetentionPolicy>,
+ applications: [MeetingApplicationOption],
+ microphones: [MeetingMicrophoneOption],
+ readiness: MeetingSetupReadiness,
+ isFirstSetup: Bool,
+ onRefreshSources: @escaping () -> Void,
+ onOpenMicrophoneSettings: @escaping @MainActor @Sendable () -> Void,
+ onOpenScreenRecordingSettings: @escaping @MainActor @Sendable () -> Void,
+ onOpenVoiceEngine: @escaping () -> Void,
+ onCancel: @escaping () -> Void,
+ onSave: @escaping () -> Void,
+ initialSection: MeetingSettingsSection = .recording
+ ) {
+ self._draft = draft
+ self._retentionPolicy = retentionPolicy
+ self.applications = applications
+ self.microphones = microphones
+ self.readiness = readiness
+ self.isFirstSetup = isFirstSetup
+ self.onRefreshSources = onRefreshSources
+ self.onOpenMicrophoneSettings = onOpenMicrophoneSettings
+ self.onOpenScreenRecordingSettings = onOpenScreenRecordingSettings
+ self.onOpenVoiceEngine = onOpenVoiceEngine
+ self.onCancel = onCancel
+ self.onSave = onSave
+ self._selectedSection = State(initialValue: initialSection)
+ }
+
+ private var canSave: Bool {
+ guard self.draft.selectedMicrophoneID != nil else { return false }
+ return self.draft.mode == .inRoom
+ || self.draft.usesAutomaticApplication
+ || self.applications.contains { $0.id == self.draft.selectedApplicationID }
+ }
+
+ private var saveHelp: String? {
+ guard !self.canSave else { return nil }
+ if let blockingMessage = readiness.blockingMessage {
+ return blockingMessage
+ }
+ if self.draft.selectedMicrophoneID == nil {
+ return "Choose an available microphone to save this setup."
+ }
+ return "Choose an available meeting application to save this setup."
+ }
+
+ var body: some View {
+ VStack(spacing: 0) {
+ self.header
+ Divider()
+
+ HStack(spacing: 0) {
+ self.sectionRail
+ Divider()
+ ScrollView {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ self.sectionHeading
+ switch self.selectedSection {
+ case .recording:
+ self.recordingSettings
+ case .automation:
+ self.automationSettings
+ case .integrations:
+ self.integrationSettings
+ }
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(self.theme.metrics.spacing.xl)
+ }
+ }
+
+ Divider()
+ self.footer
+ }
+ .frame(width: 820)
+ .frame(minHeight: 540, idealHeight: 640)
+ .background(self.theme.palette.windowBackground)
+ }
+
+ private var header: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text("FluidMeet settings")
+ .font(self.theme.typography.sectionTitle)
+ .foregroundStyle(self.theme.palette.primaryText)
+ Text("Audio and transcripts stay on this Mac.")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(.horizontal, self.theme.metrics.spacing.xxl)
+ .padding(.vertical, self.theme.metrics.spacing.lg)
+ }
+
+ private var sectionRail: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ ForEach(MeetingSettingsSection.allCases) { section in
+ Button {
+ self.selectedSection = section
+ } label: {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Image(systemName: section.symbol)
+ .frame(width: self.theme.metrics.spacing.lg)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ Text(section.rawValue)
+ .font(self.selectedSection == section ? self.theme.typography.bodySmallStrong : self.theme.typography.bodySmall)
+ .foregroundStyle(self.theme.palette.primaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ Spacer(minLength: 0)
+ }
+ .padding(.horizontal, self.theme.metrics.spacing.md)
+ .frame(maxWidth: .infinity, minHeight: 42, alignment: .leading)
+ .padding(.vertical, self.theme.metrics.spacing.xs)
+ .background(
+ self.selectedSection == section ? self.theme.palette.cardBackground : Color.clear,
+ in: RoundedRectangle(cornerRadius: self.theme.metrics.corners.sm)
+ )
+ .contentShape(RoundedRectangle(cornerRadius: self.theme.metrics.corners.sm))
+ }
+ .buttonStyle(.plain)
+ .meetingHoverFeedback(cornerRadius: self.theme.metrics.corners.sm)
+ .accessibilityAddTraits(self.selectedSection == section ? .isSelected : [])
+ }
+ Spacer(minLength: 0)
+ }
+ .padding(self.theme.metrics.spacing.sm)
+ .padding(.top, self.theme.metrics.spacing.sm)
+ .frame(width: 164)
+ .frame(maxHeight: .infinity)
+ .background(self.theme.palette.sidebarBackground)
+ }
+
+ private var sectionHeading: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text(self.selectedSection.rawValue)
+ .font(self.theme.typography.sectionTitle)
+ .foregroundStyle(self.theme.palette.primaryText)
+ Text(self.selectedSection.guidance)
+ .font(self.theme.typography.bodySmall)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ }
+
+ private var recordingSettings: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ FluidManagementGroup(title: "Audio sources") {
+ VStack(spacing: 0) {
+ MeetingAdaptiveSetupRow(
+ title: "Meeting type",
+ detail: self.draft.mode == .onlineCall ? "Meeting app and microphone." : "Microphone only."
+ ) {
+ Menu {
+ Picker("Meeting type", selection: self.$draft.mode) {
+ Text("Online call").tag(MeetingCaptureMode.onlineCall)
+ Text("In-room").tag(MeetingCaptureMode.inRoom)
+ }
+ .pickerStyle(.inline)
+ } label: {
+ Text(self.draft.mode == .onlineCall ? "Online call" : "In-room")
+ }
+ .fluidDropdownStyle(fillsWidth: true)
+ .accessibilityLabel("Default meeting type")
+ }
+
+ if self.draft.mode == .onlineCall {
+ Divider()
+ MeetingAdaptiveSetupRow(
+ title: "Meeting audio",
+ detail: "Automatic follows the detected call."
+ ) {
+ Menu {
+ self.applicationMenuEntry(title: "Automatic", id: nil)
+ ForEach(self.meetingApplications) { option in
+ self.applicationMenuEntry(title: self.applicationDisplayName(option), id: option.id)
+ }
+ if !self.otherApplications.isEmpty {
+ Divider()
+ Menu("Other audio sources") {
+ ForEach(self.otherApplications) { option in
+ self.applicationMenuEntry(title: self.applicationDisplayName(option), id: option.id)
+ }
+ }
+ }
+ } label: {
+ Text(self.selectedApplicationName)
+ }
+ .fluidDropdownStyle(fillsWidth: true)
+ .accessibilityLabel("Meeting audio source")
+ }
+ }
+
+ Divider()
+ MeetingAdaptiveSetupRow(
+ title: "Microphone",
+ detail: "Capture your side of the conversation."
+ ) {
+ Menu {
+ Picker("Microphone", selection: self.$draft.selectedMicrophoneID) {
+ Text("Choose microphone…").tag(String?.none)
+ ForEach(self.microphones) { option in
+ Text(option.identity.displayName).tag(Optional(option.id))
+ }
+ }
+ .pickerStyle(.inline)
+ } label: {
+ Text(self.microphones.first(where: { $0.id == self.draft.selectedMicrophoneID })?.identity.displayName ?? "Choose microphone…")
+ }
+ .fluidDropdownStyle(fillsWidth: true)
+ .accessibilityLabel("Default meeting microphone")
+ }
+ }
+ }
+ .overlay(alignment: .topTrailing) {
+ Button(self.readiness.isCheckingSources ? "Refreshing…" : "Refresh", systemImage: "arrow.clockwise", action: self.onRefreshSources)
+ .buttonStyle(.plain)
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.theme.palette.accent)
+ .disabled(self.readiness.isCheckingSources)
+ .help("Rescan meeting apps and microphones.")
+ .accessibilityLabel("Refresh audio sources")
+ }
+
+ MeetingModelSettingsSection()
+
+ if self.readiness.showMicrophoneSettingsAction || self.readiness.showScreenRecordingSettingsAction {
+ FluidManagementGroup(title: "Permissions need attention") {
+ Text("Allow the requested access in macOS Settings, then refresh your sources.")
+ .font(self.theme.typography.bodySmall)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ FluidGlassControlGroup {
+ ViewThatFits(in: .horizontal) {
+ HStack(spacing: self.theme.metrics.spacing.sm) { self.repairActions }
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) { self.repairActions }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private var applicationSelection: Binding<String?> {
+ Binding(
+ get: { self.draft.usesAutomaticApplication ? nil : self.draft.selectedApplicationID },
+ set: {
+ self.draft.usesAutomaticApplication = $0 == nil
+ self.draft.selectedApplicationID = $0
+ }
+ )
+ }
+
+ private func applicationMenuEntry(title: String, id: String?) -> some View {
+ Button {
+ self.applicationSelection.wrappedValue = id
+ } label: {
+ if self.applicationSelection.wrappedValue == id {
+ Label(title, systemImage: "checkmark")
+ } else {
+ Text(title)
+ }
+ }
+ }
+
+ private var meetingApplications: [MeetingApplicationOption] {
+ self.applications.filter { MeetingAppRegistry.tier(forBundleIdentifier: $0.identity.bundleIdentifier) != nil }
+ }
+
+ private var otherApplications: [MeetingApplicationOption] {
+ self.applications.filter { MeetingAppRegistry.tier(forBundleIdentifier: $0.identity.bundleIdentifier) == nil }
+ }
+
+ private var selectedApplicationName: String {
+ guard !self.draft.usesAutomaticApplication else { return "Automatic" }
+ guard let selected = self.applications.first(where: { $0.id == self.draft.selectedApplicationID }) else {
+ return "Source unavailable"
+ }
+ return self.applicationDisplayName(selected)
+ }
+
+ private func applicationDisplayName(_ option: MeetingApplicationOption) -> String {
+ let name = option.identity.displayName.trimmingCharacters(in: .whitespacesAndNewlines)
+ if !name.isEmpty { return name }
+ let bundleIdentifier = option.identity.bundleIdentifier.trimmingCharacters(in: .whitespacesAndNewlines)
+ if !bundleIdentifier.isEmpty { return bundleIdentifier }
+ if let processID = option.identity.processID { return "Audio source (\(processID))" }
+ return "Audio source"
+ }
+
+ private var automationSettings: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ FluidManagementGroup(title: "Your preferences") {
+ VStack(spacing: 0) {
+ MeetingAdaptiveSetupRow(
+ title: "Keep recordings",
+ detail: "Includes past meetings. Transcripts are always kept."
+ ) {
+ Menu {
+ Picker("Keep audio", selection: self.$retentionPolicy) {
+ ForEach(MeetingAudioRetentionPolicy.allCases, id: \.self) { policy in
+ Text(policy.displayName).tag(policy)
+ }
+ }
+ .pickerStyle(.inline)
+ } label: {
+ Text(self.retentionPolicy.displayName)
+ }
+ .fluidDropdownStyle(fillsWidth: true)
+ .accessibilityLabel("Audio retention")
+ }
+
+ Divider()
+ MeetingAdaptiveSetupRow(
+ title: "Detect meetings automatically",
+ detail: "Offer to record Zoom, Teams, and Webex meetings. Recording always starts with you.",
+ trailingSwitch: true
+ ) {
+ Toggle("Detect meetings automatically", isOn: self.$draft.autoDetectEnabled)
+ .labelsHidden()
+ .toggleStyle(.switch)
+ .meetingHoverFeedback()
+ .accessibilityLabel("Detect meetings automatically")
+ }
+
+ if self.draft.autoDetectEnabled {
+ Divider()
+ MeetingAdaptiveSetupRow(
+ title: "Include browser meetings",
+ detail: "Check the frontmost tab for supported meeting sites. Tab addresses are never stored or sent.",
+ trailingSwitch: true
+ ) {
+ Toggle("Include browser meetings", isOn: self.$draft.browserDetectionEnabled)
+ .labelsHidden()
+ .toggleStyle(.switch)
+ .meetingHoverFeedback()
+ .accessibilityLabel("Also check browser tabs")
+ }
+ }
+ }
+ }
+
+ if self.draft.autoDetectEnabled,
+ self.appServices.meetingAutoDetectHealth == .zoomWindowTitleUnreadable
+ {
+ MeetingAdaptiveSetupRow(
+ title: "Zoom window access needs repair",
+ detail: "Screen Recording or Accessibility access is preventing FluidVoice from reading Zoom meeting windows. Recording has not started."
+ ) {
+ Button("Open Screen Recording Settings") {
+ self.onOpenScreenRecordingSettings()
+ }
+ .meetingGlassAction()
+ }
+ }
+
+ if self.dismissalAdvisor.shouldSuggest {
+ FluidManagementGroup(title: "Fewer interruptions") {
+ Text("You’ve dismissed several meeting prompts recently. You can turn off detection and still record manually.")
+ .font(self.theme.typography.bodySmall)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ FluidGlassControlGroup {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Button("Turn off detection") {
+ self.draft.autoDetectEnabled = false
+ self.draft.browserDetectionEnabled = false
+ self.dismissalAdvisor.shouldSuggest = false
+ }
+ .meetingGlassAction()
+ Button("Keep it on") {
+ self.dismissalAdvisor.shouldSuggest = false
+ }
+ .meetingGlassAction()
+ }
+ }
+ }
+ }
+
+ Text("Expired audio is removed while FluidVoice is running.")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ }
+
+ private var integrationSettings: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ FluidManagementGroup(title: "Claude & ChatGPT MCP links") {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ self.integrationRow(name: "Claude", provider: "by Anthropic", assetName: "Provider_Anthropic")
+ Divider()
+ self.integrationRow(name: "ChatGPT", provider: "by OpenAI", assetName: "Provider_OpenAI")
+ }
+ }
+
+ Label("MCP connections are coming in a future update. No meeting notes are shared with Claude or ChatGPT.", systemImage: "lock.fill")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ }
+
+ private func integrationRow(name: String, provider: String, assetName: String) -> some View {
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Image(assetName)
+ .resizable()
+ .scaledToFit()
+ .frame(width: 26, height: 26)
+ .frame(width: 44, height: 44)
+ .background(Color(nsColor: .white), in: RoundedRectangle(cornerRadius: self.theme.metrics.corners.md))
+ .accessibilityHidden(true)
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text(name)
+ .font(self.theme.typography.bodyStrong)
+ .foregroundStyle(self.theme.palette.primaryText)
+ Text(provider)
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ Spacer(minLength: self.theme.metrics.spacing.md)
+ Text("Coming soon")
+ .font(self.theme.typography.badge)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ Toggle("Enable \(name) MCP link — coming soon", isOn: .constant(false))
+ .labelsHidden()
+ .toggleStyle(.switch)
+ .disabled(true)
+ .help("\(name) MCP links are coming soon.")
+ }
+ .padding(.vertical, self.theme.metrics.spacing.sm)
+ }
+
+ private var footer: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) {
+ if let saveHelp {
+ Label(saveHelp, systemImage: "exclamationmark.circle")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.warning)
+ }
+ FluidGlassControlGroup {
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Spacer(minLength: self.theme.metrics.spacing.md)
+ Button(action: self.onCancel) {
+ Text(self.isFirstSetup ? "Not now" : "Cancel").frame(minWidth: 72)
+ }
+ .meetingGlassAction()
+ .keyboardShortcut(.cancelAction)
+ Button(action: self.onSave) {
+ Text(self.isFirstSetup ? "Save setup" : "Save").frame(minWidth: 72)
+ }
+ .meetingGlassAction(prominent: true)
+ .disabled(!self.canSave)
+ .keyboardShortcut(.defaultAction)
+ }
+ }
+ }
+ .padding(.horizontal, self.theme.metrics.spacing.xxl)
+ .padding(.vertical, self.theme.metrics.spacing.lg)
+ }
+
+ @ViewBuilder
+ private var repairActions: some View {
+ if self.readiness.showMicrophoneSettingsAction {
+ Button("Microphone Settings", systemImage: "mic.fill", action: self.onOpenMicrophoneSettings)
+ .meetingGlassAction()
+ }
+ if self.readiness.showScreenRecordingSettingsAction {
+ Button(
+ "Screen Recording Settings",
+ systemImage: "rectangle.inset.filled.and.person.filled",
+ action: self.onOpenScreenRecordingSettings
+ )
+ .meetingGlassAction()
+ }
+ }
+}
+
+private struct MeetingAdaptiveSetupRow<Content: View>: View {
+ let title: String
+ var detail: String?
+ let trailingSwitch: Bool
+ @ViewBuilder let content: Content
+
+ @Environment(\.theme) private var theme
+
+ init(
+ title: String,
+ detail: String? = nil,
+ trailingSwitch: Bool = false,
+ @ViewBuilder content: () -> Content
+ ) {
+ self.title = title
+ self.detail = detail
+ self.trailingSwitch = trailingSwitch
+ self.content = content()
+ }
+
+ var body: some View {
+ Group {
+ if self.trailingSwitch {
+ HStack(alignment: .center, spacing: self.theme.metrics.spacing.lg) {
+ self.label.frame(maxWidth: .infinity, alignment: .leading)
+ self.content.fixedSize()
+ }
+ } else {
+ HStack(alignment: .center, spacing: self.theme.metrics.spacing.xl) {
+ self.label.frame(maxWidth: .infinity, alignment: .leading)
+ self.content
+ .frame(width: 240, alignment: .trailing)
+ }
+ }
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(.vertical, self.theme.metrics.spacing.sm)
+ }
+
+ private var label: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text(self.title)
+ .font(self.theme.typography.bodyStrong)
+ .foregroundStyle(self.theme.palette.primaryText)
+ if let detail {
+ Text(detail)
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ }
+ }
+}
diff --git a/Sources/Fluid/UI/MeetingSessionCanvases.swift b/Sources/Fluid/UI/MeetingSessionCanvases.swift
new file mode 100644
index 00000000..0a0a46c1
--- /dev/null
+++ b/Sources/Fluid/UI/MeetingSessionCanvases.swift
@@ -0,0 +1,1072 @@
+import AppKit
+import SwiftUI
+
+struct MeetingRecordingCanvas: View {
+ let session: MeetingSession
+ let trackHealth: [MeetingAudioTrackKind: MeetingTrackHealth]
+ let liveTranscript: MeetingLiveTranscriptSnapshot
+ let isStopping: Bool
+ let onStop: () -> Void
+
+ @Environment(\.theme) private var theme
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ TimelineView(.periodic(from: .now, by: 1)) { context in
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Label(
+ self.isStopping ? "Saving recording" : "Recording",
+ systemImage: self.isStopping ? "stop.circle.fill" : "record.circle.fill"
+ )
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.isStopping ? self.theme.palette.warning : Color(nsColor: .systemRed))
+ Spacer(minLength: 0)
+ Text(Self.durationText(context.date.timeIntervalSince(self.session.startedAt)))
+ .font(self.theme.typography.codeCaption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel(
+ "\(self.isStopping ? "Meeting recording is stopping" : "Meeting recording in progress"), " +
+ "\(Self.durationText(context.date.timeIntervalSince(self.session.startedAt))) elapsed"
+ )
+ }
+
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ MeetingDocumentTitle(title: self.session.title)
+ .lineLimit(2)
+ .help(self.session.title)
+ Text(self.sourceSummary)
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .lineLimit(1)
+ .help(self.sourceSummary)
+ }
+
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) {
+ ViewThatFits(in: .horizontal) {
+ HStack(spacing: self.theme.metrics.spacing.xl) { self.sourceHealth }
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) { self.sourceHealth }
+ }
+ Divider()
+ }
+
+ MeetingLiveTranscriptCard(snapshot: self.liveTranscript)
+
+ Divider()
+ FluidGlassControlGroup {
+ ViewThatFits(in: .horizontal) {
+ HStack(spacing: self.theme.metrics.spacing.lg) {
+ self.recordingFooter
+ Spacer(minLength: 0)
+ self.stopButton
+ }
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) {
+ self.recordingFooter
+ HStack {
+ Spacer(minLength: 0)
+ self.stopButton
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private var recordingFooter: some View {
+ Text(self.isStopping
+ ? "Saving your recording before transcription begins."
+ : "Speaker labels are added after recording.")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+
+ private var stopButton: some View {
+ Button(action: self.onStop) {
+ if self.isStopping {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ ProgressView().controlSize(.small)
+ Text("Saving recording…")
+ }
+ } else {
+ Label("Stop & Transcribe", systemImage: "stop.fill")
+ }
+ }
+ .meetingGlassAction(prominent: true, tone: Color(nsColor: .systemRed))
+ .disabled(self.isStopping)
+ }
+
+ @ViewBuilder
+ private var sourceHealth: some View {
+ if self.session.mode == .onlineCall {
+ MeetingTrackHealthRow(title: "Meeting audio", systemImage: "macwindow", health: self.trackHealth[.applicationAudio] ?? .waiting)
+ }
+ MeetingTrackHealthRow(title: "Microphone", systemImage: "mic", health: self.trackHealth[.microphone] ?? .waiting)
+ }
+
+ private var sourceSummary: String {
+ let microphoneName = self.session.selectedMicrophone.displayName
+ guard self.session.mode == .onlineCall else { return microphoneName }
+ let applicationName = self.session.capturedApplication?.displayName ?? "Meeting audio"
+ return "\(applicationName) · \(microphoneName)"
+ }
+
+ private static func durationText(_ duration: TimeInterval) -> String {
+ let total = max(0, Int(duration.rounded(.down)))
+ let hours = total / 3600
+ let minutes = (total % 3600) / 60
+ let seconds = total % 60
+ if hours > 0 {
+ return String(format: "%d:%02d:%02d", hours, minutes, seconds)
+ }
+ return String(format: "%d:%02d", minutes, seconds)
+ }
+}
+
+/// Live captions during recording only — rows identify capture source, not a person; the offline
+/// diarization pipeline replaces this view's content entirely on completion.
+private struct MeetingLiveTranscriptCard: View {
+ let snapshot: MeetingLiveTranscriptSnapshot
+
+ @Environment(\.theme) private var theme
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.lg) {
+ HStack {
+ Text("Live transcript")
+ .font(self.theme.typography.sectionTitle)
+ .foregroundStyle(self.theme.palette.primaryText)
+ Spacer()
+ FluidGlassControlGroup {
+ Button {
+ MeetingFloatingCaptionsController.shared.show()
+ } label: {
+ Image(systemName: "rectangle.portrait.and.arrow.right")
+ }
+ .meetingGlassAction(circular: true)
+ .help("Open floating captions")
+ .accessibilityLabel("Open floating captions")
+ }
+ }
+
+ if let indicator = self.availabilityIndicator {
+ Label(indicator, systemImage: "exclamationmark.circle")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.warning)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ if self.rows.isEmpty {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ Text(self.availabilityIndicator == nil ? "Listening for conversation" : "Waiting for captions")
+ .font(self.theme.typography.body)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ Text("Your conversation will appear here as people speak.")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.tertiaryText)
+ }
+ .padding(.top, self.theme.metrics.spacing.sm)
+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
+ } else {
+ self.scrollingBubbleList
+ }
+ }
+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
+ }
+
+ private var rows: [MeetingLiveBubbleComposer.Row] {
+ MeetingLiveBubbleComposer.rows(for: self.snapshot)
+ }
+
+ private var availabilityIndicator: String? {
+ switch self.snapshot.availability {
+ case .available:
+ return nil
+ case let .unavailable(reason), let .degraded(reason):
+ return reason
+ }
+ }
+
+ private var scrollingBubbleList: some View {
+ MeetingLiveBubbleScrollList(rows: self.rows, documentStyle: true)
+ .frame(minHeight: 120, maxHeight: .infinity)
+ }
+}
+
+struct MeetingProcessingCanvas: View {
+ let session: MeetingSession
+ let stage: MeetingProcessingStage
+
+ @Environment(\.theme) private var theme
+
+ private let stages: [MeetingProcessingStage] = [
+ .saving,
+ .identifyingSpeakers,
+ .transcribing,
+ .finalizing,
+ ]
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ ProgressView()
+ .controlSize(.small)
+ .fixedSize()
+ Text("Preparing your transcript")
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ MeetingDocumentTitle(title: self.session.title)
+ Text("You can close this window. Processing continues on this Mac.")
+ .font(self.theme.typography.bodySmall)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+
+ Divider()
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xxl) {
+ ForEach(Array(self.stages.enumerated()), id: \.element) { index, stage in
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Image(systemName: self.icon(for: stage, index: index))
+ .foregroundStyle(self.color(for: stage, index: index))
+ .font(self.theme.typography.sectionTitle)
+ .frame(width: 24)
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text(Self.title(for: stage))
+ .font(self.theme.typography.bodyStrong)
+ .foregroundStyle(self.stage != .completed && index > self.activeIndex
+ ? self.theme.palette.secondaryText : self.theme.palette.primaryText)
+ if stage == self.stage {
+ Text(Self.detail(for: stage))
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ }
+ Spacer()
+ }
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel("\(Self.title(for: stage)), \(self.accessibilityStatus(for: stage, index: index))")
+ }
+ }
+ .padding(.vertical, self.theme.metrics.spacing.sm)
+ }
+ }
+
+ private var activeIndex: Int {
+ self.stages.firstIndex(of: self.stage) ?? 0
+ }
+
+ private func icon(for stage: MeetingProcessingStage, index: Int) -> String {
+ if self.stage == .completed || index < self.activeIndex { return "checkmark.circle.fill" }
+ if stage == self.stage { return "circle.dotted" }
+ return "circle"
+ }
+
+ private func color(for stage: MeetingProcessingStage, index: Int) -> Color {
+ if self.stage == .completed || index < self.activeIndex { return self.theme.palette.success }
+ if stage == self.stage { return self.theme.palette.accent }
+ return self.theme.palette.tertiaryText
+ }
+
+ private func accessibilityStatus(for stage: MeetingProcessingStage, index: Int) -> String {
+ if self.stage == .completed || index < self.activeIndex { return "complete" }
+ if stage == self.stage { return "in progress" }
+ return "waiting"
+ }
+
+ private static func title(for stage: MeetingProcessingStage) -> String {
+ switch stage {
+ case .pending: return "Waiting"
+ case .saving: return "Saving"
+ case .identifyingSpeakers: return "Identifying speakers"
+ case .transcribing: return "Transcribing"
+ case .finalizing: return "Finalizing"
+ case .completed: return "Complete"
+ }
+ }
+
+ private static func detail(for stage: MeetingProcessingStage) -> String {
+ switch stage {
+ case .pending: "Your recording is waiting to be processed."
+ case .saving: "Finishing and saving the captured audio."
+ case .identifyingSpeakers: "Finding the different voices in your meeting."
+ case .transcribing: "Turning your conversation into text."
+ case .finalizing: "Putting the transcript and speaker labels together."
+ case .completed: "Your transcript is ready."
+ }
+ }
+}
+
+/// Escape also dismisses: viewing a past meeting is a detail view, not a mode.
+private struct MeetingCloseTranscriptButton: View {
+ let action: () -> Void
+
+ var body: some View {
+ Button(action: self.action) {
+ MeetingDocumentActionLabel(title: "Close", symbol: "xmark")
+ }
+ .meetingGlassAction()
+ .keyboardShortcut(.cancelAction)
+ .help("Close this transcript")
+ .accessibilityLabel("Close transcript")
+ }
+}
+
+/// The same label box gives Button and Menu identical native control geometry.
+private struct MeetingDocumentActionLabel: View {
+ let title: String
+ let symbol: String
+ var disclosure = false
+ @Environment(\.theme) private var theme
+
+ var body: some View {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Image(systemName: self.symbol).frame(width: 14, height: 14)
+ Text(self.title)
+ if self.disclosure {
+ Image(systemName: "chevron.down")
+ .font(self.theme.typography.captionSmall)
+ .frame(width: 10, height: 14)
+ }
+ }
+ .font(self.theme.typography.bodySmallStrong)
+ .frame(height: 20)
+ .contentShape(Rectangle())
+ }
+}
+
+struct MeetingResultCanvas: View {
+ let session: MeetingSession
+ let isQuiescent: Bool
+ let canUndo: Bool
+ @State private var showsProbableEchoes = false
+ let onCopyTranscript: (MeetingSession, Bool) -> Void
+ let onExportTranscript: (MeetingSession, MeetingTranscriptExportFormat, Bool) -> Void
+ let onReassignSegment: (MeetingTranscriptSegmentID, SessionSpeakerID) -> Void
+ let onNameUnknownSegment: (MeetingTranscriptSegmentID, String) -> Void
+ let onRenameSpeaker: (SessionSpeakerID, String) -> Void
+ let onMergeSpeakers: (SessionSpeakerID, SessionSpeakerID) -> Void
+ let onUndo: () -> Void
+ let onRenameSession: (String) -> Void
+ let onAssignSpeakers: ([SessionSpeakerID: String]) async -> String?
+ let onClose: (() -> Void)?
+
+ @Environment(\.theme) private var theme
+ @State private var pendingRenameSpeaker: MeetingSessionSpeaker?
+ @State private var pendingRenameText = ""
+ @State private var pendingNameUnknownSegmentID: MeetingTranscriptSegmentID?
+ @State private var pendingUnknownSpeakerName = ""
+ @State private var isRenamingSession = false
+ @State private var pendingRenameSessionText = ""
+ @State private var isShowingAssignSpeakers = false
+ @State private var assignSpeakersFocus: SessionSpeakerID?
+ @State private var copied = false
+ @State private var copyRevision = 0
+ @State private var documentSection: MeetingDocumentSection = .transcript
+
+ /// Naming is reached by clicking a speaker's name, so the sheet opens on the one clicked.
+ private func presentAssignSpeakers(focusing speakerID: SessionSpeakerID?) {
+ guard self.isQuiescent, !self.session.activeSpeakers.isEmpty else { return }
+ self.assignSpeakersFocus = speakerID
+ self.isShowingAssignSpeakers = true
+ }
+
+ private var speakerNames: [SessionSpeakerID: String] {
+ Dictionary(uniqueKeysWithValues: self.session.activeSpeakers.map { ($0.id, $0.displayName) })
+ }
+
+ private func chipTint(for speaker: MeetingSessionSpeaker) -> Color? {
+ speaker.isLocalUser ? self.theme.palette.accent : self.speakerTints[speaker.id]
+ }
+
+ private var speakerTints: [SessionSpeakerID: Color] {
+ MeetingSpeakerPalette.tints(for: self.session.activeSpeakers)
+ }
+
+ private var hasEchoSegments: Bool {
+ self.session.transcriptSegments.contains(where: \.isEcho)
+ }
+
+ /// Single projection so shown and copied never disagree.
+ private func visibleSegments(sorted: [MeetingTranscriptSegment]) -> [MeetingTranscriptSegment] {
+ self.showsProbableEchoes ? sorted : sorted.filter { !$0.isEcho }
+ }
+
+ /// Sorted once with per-row display state — no per-row re-sorting. Compares the resolved
+ /// displayed label (not the raw speaker id) so consecutive nil-speaker rows in different
+ /// attribution states — e.g. `unassigned` then `timingUncertain` — each still show a label.
+ private func rows(
+ for visibleSegments: [MeetingTranscriptSegment]
+ ) -> [(segment: MeetingTranscriptSegment, showsLabel: Bool, isLocal: Bool)] {
+ let speakerNames = self.speakerNames
+ var previousLabelIdentity: String?
+ return visibleSegments.map { segment in
+ let labelIdentity = MeetingTranscriptExporter.speakerLabelIdentity(
+ for: segment,
+ in: self.session,
+ speakerNames: speakerNames
+ )
+ let showsLabel = labelIdentity != previousLabelIdentity
+ previousLabelIdentity = labelIdentity
+ return (segment, showsLabel, self.isLocalSegment(segment))
+ }
+ }
+
+ var body: some View {
+ let speakerNames = self.speakerNames
+ let sorted = self.session.transcriptSegments.sorted { $0.start.seconds < $1.start.seconds }
+ let visibleSegments = self.visibleSegments(sorted: sorted)
+ let visibleSpeakerIDs = Set(visibleSegments.compactMap(\.speakerID))
+ let activeSpeakers = self.session.activeSpeakers.filter { visibleSpeakerIDs.contains($0.id) }
+ let rows = self.rows(for: visibleSegments)
+ // One scroller preserves a readable document at short window heights.
+ ScrollView {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xxl) {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) {
+ MeetingDocumentTitle(title: self.session.title)
+ .contextMenu { self.renameMeetingAction }
+ self.meetingMetadata
+ if self.session.state != .completed { self.documentStatus }
+ }
+
+ self.documentToolbar(hasText: !visibleSegments.isEmpty)
+
+ if self.documentSection == .summary {
+ MeetingSummaryComingSoon()
+ } else {
+ if !activeSpeakers.isEmpty {
+ self.speakerStrip(activeSpeakers)
+ }
+
+ if visibleSegments.isEmpty {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ Text("No transcript text")
+ .font(self.theme.typography.bodyStrong)
+ .foregroundStyle(self.theme.palette.primaryText)
+ Text(self.emptyTranscriptDescription)
+ .font(self.theme.typography.body)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ .padding(.vertical, self.theme.metrics.spacing.sm)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ } else {
+ LazyVStack(alignment: .leading, spacing: self.theme.metrics.spacing.xxl) {
+ ForEach(rows, id: \.segment.id) { row in
+ MeetingTranscriptSegmentRow(
+ segment: row.segment,
+ speakerName: MeetingTranscriptExporter.speakerLabel(
+ for: row.segment,
+ in: self.session,
+ speakerNames: speakerNames
+ ),
+ speakerTint: row.segment.speakerID.flatMap { self.speakerTints[$0] },
+ onRenameSpeakerTapped: {
+ if let speakerID = row.segment.speakerID {
+ self.presentAssignSpeakers(focusing: speakerID)
+ } else {
+ self.pendingNameUnknownSegmentID = row.segment.id
+ self.pendingUnknownSpeakerName = ""
+ }
+ },
+ isLocalUser: row.isLocal,
+ showsSpeakerLabel: row.showsLabel,
+ reassignTargets: activeSpeakers.filter { $0.id != row.segment.speakerID },
+ isQuiescent: self.isQuiescent,
+ onReassign: { speakerID in self.onReassignSegment(row.segment.id, speakerID) }
+ )
+ }
+ }
+ .padding(.bottom, self.theme.metrics.spacing.xxl)
+ }
+ }
+ }
+ .frame(maxWidth: 760, alignment: .leading)
+ .frame(maxWidth: .infinity, alignment: .center)
+ }
+ .id(self.session.id)
+ .task(id: self.copyRevision) {
+ guard self.copied else { return }
+ do { try await Task.sleep(for: .seconds(2)) } catch { return }
+ self.copied = false
+ }
+ .alert(
+ "Rename Speaker",
+ isPresented: Binding(
+ get: { self.pendingRenameSpeaker != nil },
+ set: { if !$0 { self.pendingRenameSpeaker = nil } }
+ )
+ ) {
+ TextField("Speaker name", text: self.$pendingRenameText)
+ Button("Cancel", role: .cancel) { self.pendingRenameSpeaker = nil }
+ Button("Rename") {
+ if let speaker = self.pendingRenameSpeaker {
+ self.onRenameSpeaker(speaker.id, self.pendingRenameText)
+ }
+ self.pendingRenameSpeaker = nil
+ }
+ } message: {
+ Text("Enter a new name for this speaker.")
+ }
+ .alert(
+ "Name Unknown Speaker",
+ isPresented: Binding(
+ get: { self.pendingNameUnknownSegmentID != nil },
+ set: { if !$0 { self.pendingNameUnknownSegmentID = nil } }
+ )
+ ) {
+ TextField("Speaker name", text: self.$pendingUnknownSpeakerName)
+ Button("Cancel", role: .cancel) { self.pendingNameUnknownSegmentID = nil }
+ Button("Save") {
+ if let segmentID = self.pendingNameUnknownSegmentID {
+ self.onNameUnknownSegment(segmentID, self.pendingUnknownSpeakerName)
+ }
+ self.pendingNameUnknownSegmentID = nil
+ }
+ } message: {
+ Text("This name applies only to this transcript turn.")
+ }
+ .alert("Rename Meeting", isPresented: self.$isRenamingSession) {
+ TextField("Meeting title", text: self.$pendingRenameSessionText)
+ Button("Cancel", role: .cancel) {}
+ Button("Rename") { self.onRenameSession(self.pendingRenameSessionText) }
+ } message: {
+ Text("Enter a new title for this meeting.")
+ }
+ // Prevents an echo toggle left on for one meeting from leaking into the next.
+ .onChange(of: self.session.id) { _, _ in
+ self.documentSection = .transcript
+ self.copied = false
+ self.showsProbableEchoes = false
+ self.isShowingAssignSpeakers = false
+ self.pendingNameUnknownSegmentID = nil
+ }
+ .sheet(isPresented: self.$isShowingAssignSpeakers) {
+ MeetingAssignSpeakersSheet(
+ speakers: self.session.activeSpeakers,
+ quotesBySpeaker: Dictionary(uniqueKeysWithValues: self.session.activeSpeakers.map {
+ ($0.id, MeetingAssignSpeakersQuoteSource.sampleQuotes(for: $0.id, in: self.session.transcriptSegments))
+ }),
+ tints: self.speakerTints,
+ accentColor: self.theme.palette.accent,
+ focusedSpeakerID: self.assignSpeakersFocus,
+ onSave: self.onAssignSpeakers,
+ onCancel: { self.isShowingAssignSpeakers = false }
+ )
+ }
+ }
+
+ private func documentToolbar(hasText: Bool) -> some View {
+ ViewThatFits(in: .horizontal) {
+ HStack(alignment: .center, spacing: self.theme.metrics.spacing.lg) {
+ MeetingDocumentTabs(selection: self.$documentSection)
+ .fixedSize(horizontal: true, vertical: false)
+ Spacer(minLength: 0)
+ FluidGlassControlGroup {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ self.transcriptActions(hasText: hasText)
+ }
+ }
+ }
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) {
+ FluidGlassControlGroup {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Spacer(minLength: 0)
+ self.transcriptActions(hasText: hasText)
+ }
+ }
+ MeetingDocumentTabs(selection: self.$documentSection)
+ }
+ }
+ }
+
+ private var documentStatus: some View {
+ Label(self.statusText, systemImage: self.statusIcon)
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.statusColor)
+ .fixedSize()
+ }
+
+ private func speakerStrip(_ speakers: [MeetingSessionSpeaker]) -> some View {
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Text("Speakers")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.tertiaryText)
+ ScrollView(.horizontal, showsIndicators: false) {
+ HStack(spacing: self.theme.metrics.spacing.lg) {
+ ForEach(speakers) { speaker in
+ MeetingSpeakerChip(
+ title: self.displayName(for: speaker),
+ systemImage: speaker.isLocalUser
+ ? "person.crop.circle.badge.checkmark" : "person.crop.circle",
+ tint: self.chipTint(for: speaker) ?? self.theme.palette.primaryText,
+ action: { self.presentAssignSpeakers(focusing: speaker.id) }
+ )
+ .disabled(!self.isQuiescent)
+ .contextMenu { self.speakerChipMenu(for: speaker) }
+ }
+ }
+ .padding(.vertical, self.theme.metrics.spacing.xs)
+ }
+ }
+ }
+
+ @ViewBuilder private func transcriptActions(hasText: Bool) -> some View {
+ Button {
+ self.onCopyTranscript(self.session, self.showsProbableEchoes)
+ self.copied = true
+ self.copyRevision += 1
+ } label: {
+ MeetingDocumentActionLabel(title: self.copied ? "Copied" : "Copy", symbol: self.copied ? "checkmark" : "doc.on.doc")
+ }
+ .meetingGlassAction()
+ .disabled(!hasText || self.documentSection != .transcript)
+ .help("Copy transcript")
+ .accessibilityLabel(self.copied ? "Transcript copied" : "Copy transcript")
+ Menu {
+ Button("Text…") { self.onExportTranscript(self.session, .text, self.showsProbableEchoes) }
+ Button("JSON…") { self.onExportTranscript(self.session, .json, self.showsProbableEchoes) }
+ } label: {
+ MeetingDocumentActionLabel(title: "Export", symbol: "square.and.arrow.up", disclosure: true)
+ }
+ .menuStyle(.button)
+ .menuIndicator(.hidden)
+ .meetingGlassAction()
+ .disabled(!hasText || self.documentSection != .transcript)
+ Menu {
+ self.renameMeetingAction
+ Button("Undo correction", systemImage: "arrow.uturn.backward", action: self.onUndo)
+ .disabled(!self.canUndo || !self.isQuiescent)
+ if self.hasEchoSegments {
+ Divider()
+ Toggle("Show probable echo", isOn: self.$showsProbableEchoes)
+ }
+ } label: {
+ MeetingDocumentActionLabel(title: "More", symbol: "ellipsis", disclosure: true)
+ }
+ .menuStyle(.button)
+ .menuIndicator(.hidden)
+ .meetingGlassAction()
+ .help("More transcript actions")
+ .accessibilityLabel("More transcript actions")
+ if let onClose {
+ MeetingCloseTranscriptButton(action: onClose)
+ }
+ }
+
+ private var renameMeetingAction: some View {
+ Button("Rename meeting…", systemImage: "pencil") {
+ self.pendingRenameSessionText = self.session.title
+ self.isRenamingSession = true
+ }
+ .disabled(!self.isQuiescent)
+ }
+
+ @ViewBuilder
+ private func speakerChipMenu(for speaker: MeetingSessionSpeaker) -> some View {
+ Button("Rename…", systemImage: "pencil") {
+ self.pendingRenameSpeaker = speaker
+ self.pendingRenameText = speaker.displayName
+ }
+ .disabled(!self.isQuiescent)
+ if !speaker.isLocalUser {
+ let eligibleTargets = self.session.activeSpeakers.filter {
+ $0.id != speaker.id && !$0.isLocalUser && $0.trackKind == speaker.trackKind
+ }
+ if !eligibleTargets.isEmpty {
+ Menu("Merge into") {
+ ForEach(eligibleTargets) { target in
+ Button(target.displayName) {
+ self.onMergeSpeakers(speaker.id, target.id)
+ }
+ }
+ }
+ .disabled(!self.isQuiescent)
+ }
+ }
+ }
+
+ private func displayName(for speaker: MeetingSessionSpeaker) -> String {
+ guard speaker.isLocalUser,
+ speaker.displayName.caseInsensitiveCompare("You") != .orderedSame
+ else {
+ return speaker.displayName
+ }
+ return "\(speaker.displayName) (You)"
+ }
+
+ // Only explicitly persisted legacy ownership metadata receives the local-user treatment.
+ private func isLocalSegment(_ segment: MeetingTranscriptSegment) -> Bool {
+ guard let speakerID = segment.speakerID,
+ let speaker = self.session.speakers.first(where: { $0.id == speakerID })
+ else { return false }
+ return speaker.isLocalUser
+ }
+
+ private var meetingMetadata: some View {
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Text(self.session.startedAt.formatted(date: .abbreviated, time: .omitted))
+ .fixedSize()
+ .help(self.session.startedAt.formatted(date: .complete, time: .shortened))
+ Text("·").accessibilityHidden(true)
+ Label(Self.durationText(self.session.duration), systemImage: "clock")
+ .fixedSize()
+ Text("·").accessibilityHidden(true)
+ Label(self.sourceName, systemImage: self.session.mode == .onlineCall ? "macwindow" : "person.2")
+ .lineLimit(1)
+ .help("\(self.sourceName)\nMicrophone: \(self.session.selectedMicrophone.displayName)")
+ }
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel(
+ "\(self.session.startedAt.formatted(date: .abbreviated, time: .shortened)), " +
+ "\(Self.durationText(self.session.duration)), \(self.sourceName), " +
+ "microphone: \(self.session.selectedMicrophone.displayName)"
+ )
+ }
+
+ private var sourceName: String {
+ self.session.capturedApplication?.displayName ?? "In-room meeting"
+ }
+
+ private var emptyTranscriptDescription: String {
+ if self.hasEchoSegments, !self.showsProbableEchoes {
+ return "All transcript turns are marked as probable echo. Choose Show probable echo from the More menu to view them."
+ }
+ if self.session.retention.audioDeletedAt != nil {
+ return "No transcript text is available. The captured audio has been deleted."
+ }
+ if self.session.hasRetryableAudio {
+ return "No transcript text is available. The captured audio is saved on this Mac."
+ }
+ if self.session.hasFinalizedAudio {
+ return "No transcript text is available. Some captured audio is saved on this Mac."
+ }
+ return "There is no transcript text or saved audio available for this meeting."
+ }
+
+ private var statusText: String {
+ switch self.session.state {
+ case .completed: "Completed"
+ case .failed: "Failed"
+ case .interrupted: "Interrupted"
+ case .processing: "Processing"
+ case .recording, .recordingDegraded, .preparing, .stopping: "Recording"
+ }
+ }
+
+ private var statusIcon: String {
+ switch self.session.state {
+ case .completed: "checkmark.circle.fill"
+ case .failed: "xmark.circle.fill"
+ case .interrupted: "exclamationmark.circle.fill"
+ case .processing: "ellipsis.circle.fill"
+ case .recording, .recordingDegraded, .preparing, .stopping: "record.circle.fill"
+ }
+ }
+
+ private var statusColor: Color {
+ switch self.session.state {
+ case .completed: self.theme.palette.success
+ case .failed: Color(nsColor: .systemRed)
+ case .interrupted: self.theme.palette.warning
+ case .processing: self.theme.palette.accent
+ case .recording, .recordingDegraded, .preparing, .stopping: self.theme.palette.warning
+ }
+ }
+
+ private static func durationText(_ duration: TimeInterval) -> String {
+ let total = max(0, Int(duration.rounded(.down)))
+ let hours = total / 3600
+ let minutes = (total % 3600) / 60
+ let seconds = total % 60
+ if hours > 0 {
+ return String(format: "%d:%02d:%02d", hours, minutes, seconds)
+ }
+ return String(format: "%d:%02d", minutes, seconds)
+ }
+}
+
+struct MeetingFailureCanvas: View {
+ let session: MeetingSession?
+ let message: String
+ let isRetrying: Bool
+ let onRetrySession: (MeetingSession) -> Void
+ let onRevealAudio: (MeetingSession) -> Void
+ let onRecordAgain: (MeetingSession) -> Void
+ let onClose: (() -> Void)?
+
+ @Environment(\.theme) private var theme
+
+ private var hasRecoverableAudio: Bool {
+ self.session?.hasRetryableAudio == true
+ }
+
+ private var title: String {
+ guard let session else { return "Meeting setup failed" }
+ let lastFailureDomain = session.failures.last?.domain
+ if lastFailureDomain == .processing ||
+ (session.state == .interrupted && !session.processingAttempts.isEmpty)
+ {
+ return session.state == .interrupted
+ ? "Meeting transcription was interrupted"
+ : "Meeting transcription failed"
+ }
+ if self.hasRecoverableAudio {
+ return session.state == .interrupted
+ ? "Meeting recording was interrupted"
+ : "Meeting recording failed"
+ }
+ return "Meeting setup failed"
+ }
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ HStack(spacing: self.theme.metrics.spacing.lg) {
+ Label(self.title, systemImage: "exclamationmark.circle")
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.theme.palette.warning)
+ .fixedSize(horizontal: false, vertical: true)
+ Spacer(minLength: 0)
+ if let onClose {
+ FluidGlassControlGroup {
+ MeetingCloseTranscriptButton(action: onClose)
+ }
+ }
+ }
+ MeetingDocumentTitle(title: self.session?.title ?? "Recording setup")
+ Divider()
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ Text(self.message)
+ .font(self.theme.typography.body)
+ .foregroundStyle(self.theme.palette.primaryText)
+ .textSelection(.enabled)
+ .fixedSize(horizontal: false, vertical: true)
+ if self.hasRecoverableAudio {
+ Label {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text("Your captured audio is preserved")
+ .font(self.theme.typography.bodyStrong)
+ Text("Retry transcription, or open the audio files on this Mac.")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ } icon: {
+ Image(systemName: "checkmark.shield")
+ .foregroundStyle(self.theme.palette.success)
+ }
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ }
+ FluidGlassControlGroup {
+ ViewThatFits(in: .horizontal) {
+ HStack(spacing: self.theme.metrics.spacing.sm) { self.recoveryActions }
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) { self.recoveryActions }
+ }
+ }
+ }
+ }
+
+ @ViewBuilder
+ private var recoveryActions: some View {
+ if let session, self.hasRecoverableAudio {
+ Button(action: { self.onRetrySession(session) }) {
+ if self.isRetrying {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ ProgressView().controlSize(.small)
+ Text("Retrying…")
+ }
+ } else {
+ Label("Retry transcription", systemImage: "arrow.clockwise")
+ }
+ }
+ .meetingGlassAction(prominent: true)
+ .disabled(self.isRetrying)
+ Button("Show audio", systemImage: "folder", action: { self.onRevealAudio(session) })
+ .meetingGlassAction()
+ }
+ if let session {
+ Button("Record again", systemImage: "arrow.counterclockwise.circle") {
+ self.onRecordAgain(session)
+ }
+ .meetingGlassAction(prominent: !self.hasRecoverableAudio)
+ .disabled(self.isRetrying)
+ }
+ }
+}
+
+private struct MeetingTrackHealthRow: View {
+ let title: String
+ let systemImage: String
+ let health: MeetingTrackHealth
+
+ @Environment(\.theme) private var theme
+
+ private var statusText: String {
+ switch self.health.status {
+ case .waiting: return "Waiting for audio"
+ case .healthy: return "Receiving audio"
+ case .degraded: return self.health.detail ?? "Audio source degraded"
+ case .unavailable: return self.health.detail ?? "Audio source unavailable"
+ case .stopped: return "Stopped"
+ }
+ }
+
+ private var statusColor: Color {
+ switch self.health.status {
+ case .healthy: self.theme.palette.success
+ case .degraded, .unavailable: self.theme.palette.warning
+ case .waiting, .stopped: self.theme.palette.secondaryText
+ }
+ }
+
+ private var statusIcon: String {
+ switch self.health.status {
+ case .healthy: "checkmark.circle.fill"
+ case .degraded, .unavailable: "exclamationmark.circle.fill"
+ case .waiting: "ellipsis.circle"
+ case .stopped: "stop.circle"
+ }
+ }
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Label(self.title, systemImage: self.systemImage)
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize()
+ ProgressView(value: min(max(Double(self.health.level), 0), 1))
+ .progressViewStyle(.linear)
+ .frame(width: 44)
+ .accessibilityLabel("\(self.title) level")
+ Image(systemName: self.statusIcon)
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.statusColor)
+ .accessibilityLabel(self.statusText)
+ }
+ if self.health.status == .degraded || self.health.status == .unavailable {
+ Text(self.statusText)
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.warning)
+ .lineLimit(2)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ }
+ .help("\(self.title): \(self.statusText)")
+ }
+}
+
+private struct MeetingSpeakerChip: View {
+ let title: String
+ let systemImage: String
+ let tint: Color
+ let action: () -> Void
+
+ @Environment(\.theme) private var theme
+ var body: some View {
+ Button(action: self.action) {
+ HStack(spacing: self.theme.metrics.spacing.xs) {
+ Label(self.title, systemImage: self.systemImage)
+ Image(systemName: "chevron.right")
+ .font(.fluidSystem(size: 9, weight: .semibold))
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.tint)
+ }
+ .buttonStyle(.borderless)
+ .meetingHoverFeedback()
+ .help("Edit speaker names")
+ .accessibilityLabel("Edit speaker name: \(self.title)")
+ }
+}
+
+private struct MeetingTranscriptSegmentRow: View {
+ let segment: MeetingTranscriptSegment
+ let speakerName: String
+ let speakerTint: Color?
+ let onRenameSpeakerTapped: (() -> Void)?
+ let isLocalUser: Bool
+ let showsSpeakerLabel: Bool
+ let reassignTargets: [MeetingSessionSpeaker]
+ let isQuiescent: Bool
+ let onReassign: (SessionSpeakerID) -> Void
+
+ @Environment(\.theme) private var theme
+
+ var body: some View {
+ HStack(alignment: .top, spacing: self.theme.metrics.spacing.lg) {
+ Text(MeetingTranscriptExporter.timestampText(self.segment.start.seconds))
+ .font(self.theme.typography.codeCaption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .frame(width: 58, alignment: .leading)
+ .padding(.top, 2)
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ if self.showsSpeakerLabel { self.speakerLabel }
+ Text(self.segment.text)
+ .font(self.theme.typography.body)
+ .foregroundStyle(self.theme.palette.primaryText)
+ .lineSpacing(5)
+ .textSelection(.enabled)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ if self.segment.isEcho {
+ Text("Probable echo").font(self.theme.typography.caption).foregroundStyle(.secondary)
+ }
+ }
+ }
+ .opacity(self.segment.isEcho ? 0.6 : 1)
+ .contextMenu {
+ Menu("Reassign to") {
+ ForEach(self.reassignTargets) { target in
+ Button(target.displayName) {
+ self.onReassign(target.id)
+ }
+ }
+ }
+ .disabled(!self.isQuiescent || self.reassignTargets.isEmpty)
+ }
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel(
+ "\(MeetingTranscriptExporter.timestampText(self.segment.start.seconds)), \(self.speakerName), \(self.segment.text)"
+ )
+ }
+
+ private var speakerLabel: some View {
+ let name = Text(self.speakerName)
+ .foregroundColor(self.nameColor)
+ .fontWeight(.semibold)
+ .font(self.theme.typography.bodySmallStrong)
+
+ return HStack(spacing: 8) {
+ if let onRenameSpeakerTapped = self.onRenameSpeakerTapped {
+ Button(action: onRenameSpeakerTapped) {
+ HStack(spacing: 3) {
+ name
+ // Always shown, not hover-only, so the affordance survives an unfocused window.
+ Image(systemName: "chevron.right")
+ .font(.fluidSystem(size: 10, weight: .semibold))
+ .foregroundColor(self.nameColor)
+ .opacity(0.65)
+ }
+ }
+ .buttonStyle(.plain)
+ .meetingHoverFeedback(cornerRadius: self.theme.metrics.corners.sm)
+ .disabled(!self.isQuiescent)
+ // No .help here: the tooltip lands on top of the turn's first line of text.
+ .accessibilityLabel("Rename \(self.speakerName)")
+ .pointerStyle(.link)
+ } else {
+ name
+ }
+ }
+ }
+
+ private var nameColor: Color {
+ if self.isLocalUser { return self.theme.palette.accent }
+ return self.speakerTint ?? self.theme.palette.tertiaryText
+ }
+}
diff --git a/Sources/Fluid/UI/MeetingSummaryComingSoon.swift b/Sources/Fluid/UI/MeetingSummaryComingSoon.swift
new file mode 100644
index 00000000..5968f9f0
--- /dev/null
+++ b/Sources/Fluid/UI/MeetingSummaryComingSoon.swift
@@ -0,0 +1,66 @@
+import SwiftUI
+
+/// A feature preview, never a fabricated summary of the selected meeting.
+struct MeetingSummaryComingSoon: View {
+ @Environment(\.theme) private var theme
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ Text("Coming soon")
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .padding(.horizontal, self.theme.metrics.spacing.sm)
+ .padding(.vertical, self.theme.metrics.spacing.xs)
+ .background(self.theme.palette.primaryText.opacity(0.06), in: Capsule())
+
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ Text("Your meeting, summed up.")
+ .font(.system(.title, design: .serif).weight(.medium))
+ .foregroundStyle(self.theme.palette.primaryText)
+ .accessibilityAddTraits(.isHeader)
+ Text("The recap, the decisions, and the follow-ups—without rereading the transcript.")
+ .font(self.theme.typography.body)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ .fixedSize(horizontal: false, vertical: true)
+
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.lg) {
+ self.feature("text.alignleft", title: "Catch up quickly", detail: "Get a short recap or a detailed summary of the discussion.")
+ Divider()
+ self.feature("checkmark.circle", title: "See what was decided", detail: "Find the key decisions and outcomes in one place.")
+ Divider()
+ self.feature("checklist", title: "Know what happens next", detail: "See action items and who owns them, when mentioned.")
+ }
+ .padding(self.theme.metrics.spacing.xl)
+ .background(self.theme.palette.primaryText.opacity(0.025), in: RoundedRectangle(cornerRadius: self.theme.metrics.corners.lg))
+
+ Label("Private, on-device summaries · English", systemImage: "lock")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ .frame(maxWidth: 620, alignment: .leading)
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(.vertical, self.theme.metrics.spacing.md)
+ }
+
+ private func feature(_ icon: String, title: String, detail: String) -> some View {
+ HStack(alignment: .top, spacing: self.theme.metrics.spacing.lg) {
+ Image(systemName: icon)
+ .font(self.theme.typography.bodySmallStrong)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .frame(width: 20, height: 20)
+ .accessibilityHidden(true)
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text(title)
+ .font(self.theme.typography.bodySmallStrong)
+ .foregroundStyle(self.theme.palette.primaryText)
+ Text(detail)
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ .accessibilityElement(children: .combine)
+ }
+}
diff --git a/Sources/Fluid/UI/MeetingTranscriptionView.swift b/Sources/Fluid/UI/MeetingTranscriptionView.swift
index 293d0d20..7b7f0b82 100644
--- a/Sources/Fluid/UI/MeetingTranscriptionView.swift
+++ b/Sources/Fluid/UI/MeetingTranscriptionView.swift
@@ -179,15 +179,16 @@ struct MeetingTranscriptionView: View {
canUndoCorrection: { self.coordinator.canUndoCorrection(sessionID: $0) },
isQuiescent: self.coordinator.isQuiescent,
onRepairSetup: self.repairRecordingSetup,
+ onEditSetup: self.openMeetingSettings,
isRetrying: self.isRetrying,
onCloseSelection: self.closeCanvasAction
)
- .padding(.trailing, self.isMeetingHistoryVisible && geometry.size.width >= 810 ? 290 : 0)
- .allowsHitTesting(!self.isMeetingHistoryVisible || geometry.size.width >= 810)
- .accessibilityHidden(self.isMeetingHistoryVisible && geometry.size.width < 810)
+ .padding(.trailing, self.isMeetingHistoryVisible && geometry.size.width >= 900 ? 272 : 0)
+ .allowsHitTesting(!self.isMeetingHistoryVisible || geometry.size.width >= 900)
+ .accessibilityHidden(self.isMeetingHistoryVisible && geometry.size.width < 900)
if self.isMeetingHistoryVisible {
- if geometry.size.width < 810 {
+ if geometry.size.width < 900 {
Button {
self.isMeetingHistoryVisible = false
} label: {
@@ -203,7 +204,7 @@ struct MeetingTranscriptionView: View {
set: {
if self.canBrowseMeetingHistory {
self.selectedHistorySessionID = $0
- if geometry.size.width < 810 { self.isMeetingHistoryVisible = false }
+ if geometry.size.width < 900 { self.isMeetingHistoryVisible = false }
}
}
),
@@ -218,7 +219,7 @@ struct MeetingTranscriptionView: View {
onDeleteRequest: { self.pendingDeleteSessionID = $0 },
onRecordAgain: self.recordAgain
)
- .frame(width: min(290, geometry.size.width))
+ .frame(width: min(272, geometry.size.width))
.overlay(alignment: .leading) { Divider() }
.transition(.move(edge: .trailing).combined(with: .opacity))
}
@@ -241,6 +242,10 @@ struct MeetingTranscriptionView: View {
.onChange(of: self.setupDraft.selectedApplicationID) { _, _ in
self.regenerateDefaultTitleIfNeeded()
}
+ .onChange(of: self.setupDraft.usesAutomaticApplication) { _, automatic in
+ guard automatic else { return }
+ self.selectPreferredApplication(from: self.applications.map(\.identity))
+ }
.onChange(of: self.appServices.meetingAutomaticTarget) { _, _ in
guard self.setupDraft.usesAutomaticApplication, !self.isShowingMeetingSettings,
self.coordinator.isQuiescent, !self.isStarting else { return }
@@ -393,10 +398,20 @@ struct MeetingTranscriptionView: View {
}
}
+ /// True only when an actual app will be captured; otherwise recording is mic-only.
+ private var capturesMeetingAudio: Bool {
+ guard self.setupDraft.mode == .onlineCall, let id = self.setupDraft.selectedApplicationID else { return false }
+ return self.applications.contains { $0.id == id }
+ }
+
+ private var effectiveCaptureMode: MeetingCaptureMode {
+ self.capturesMeetingAudio ? .onlineCall : .inRoom
+ }
+
private var readiness: MeetingSetupReadiness {
let microphoneStatus = self.cachedMicrophoneStatus
let microphoneReady = microphoneStatus == .authorized
- let meetingAudioReady = self.setupDraft.mode == .inRoom || self.cachedScreenCaptureAccess
+ let meetingAudioReady = !self.capturesMeetingAudio || self.cachedScreenCaptureAccess
let modelReady = self.cachedModelReady
let conflictingActivity = self.asrService.activeExclusiveActivity
let activityReady = conflictingActivity == nil
@@ -426,15 +441,15 @@ struct MeetingTranscriptionView: View {
blockingMessage = "Allow microphone access, then refresh sources."
} else if self.microphones.isEmpty {
blockingMessage = "Connect a microphone, then refresh sources."
- } else if self.setupDraft.mode == .onlineCall, !meetingAudioReady {
+ } else if !meetingAudioReady {
blockingMessage = "Allow Screen & System Audio access, then refresh sources."
} else if !self.cachedStorageReady {
- let trackCount = MeetingPCMStoragePolicy.trackCount(for: self.setupDraft.mode)
+ let trackCount = MeetingPCMStoragePolicy.trackCount(for: self.effectiveCaptureMode)
blockingMessage = "Free at least \(MeetingPCMStoragePolicy.requiredFreeSpaceDescription(trackCount: trackCount)) of storage before recording."
} else if !CPUArchitecture.isAppleSilicon {
- blockingMessage = "Meet Assist requires an Apple silicon Mac."
+ blockingMessage = "FluidMeet requires an Apple silicon Mac."
} else if !modelReady {
- blockingMessage = "Load the supplied speaker separation model in Meet Assist settings before recording."
+ blockingMessage = "Load the supplied speaker separation model in FluidMeet settings before recording."
} else {
blockingMessage = nil
}
@@ -452,7 +467,7 @@ struct MeetingTranscriptionView: View {
activityStatus: conflictingActivity.map { "Wait for \($0.displayName)" } ?? "Ready",
activityReady: activityReady,
showMicrophoneSettingsAction: microphoneStatus == .denied,
- showScreenRecordingSettingsAction: self.setupDraft.mode == .onlineCall && !meetingAudioReady,
+ showScreenRecordingSettingsAction: !meetingAudioReady,
blockingMessage: blockingMessage
)
}
@@ -578,7 +593,7 @@ struct MeetingTranscriptionView: View {
readiness.modelReady,
readiness.storageReady,
readiness.microphoneReady,
- self.setupDraft.mode == .inRoom || readiness.meetingAudioReady,
+ readiness.meetingAudioReady,
let configuration = self.captureConfiguration
else {
self.actionErrorMessage = readiness.blockingMessage ?? "Finish meeting setup before recording."
@@ -608,18 +623,22 @@ struct MeetingTranscriptionView: View {
var microphone = microphoneOption.identity
microphone.role = .unknown
+ // No resolved app means a mic-only recording, never a refusal to record.
let applicationOption = self.applications.first(where: { $0.id == self.setupDraft.selectedApplicationID })
- if self.setupDraft.mode == .onlineCall, applicationOption == nil { return nil }
var application = self.setupDraft.mode == .onlineCall ? applicationOption?.identity : nil
- if self.setupDraft.mode == .onlineCall, self.setupDraft.usesAutomaticApplication {
- guard let target = self.appServices.meetingAutomaticTarget,
- application?.bundleIdentifier == target.bundleIdentifier,
- application?.processID == target.pid else { return nil }
- application?.windowID = target.windowID
+ if application != nil, self.setupDraft.usesAutomaticApplication {
+ if let target = self.appServices.meetingAutomaticTarget,
+ application?.bundleIdentifier == target.bundleIdentifier,
+ application?.processID == target.pid
+ {
+ application?.windowID = target.windowID
+ } else {
+ application = nil
+ }
}
return MeetingCaptureConfiguration(
- mode: self.setupDraft.mode,
+ mode: application == nil ? .inRoom : .onlineCall,
title: title,
platform: application.map {
MeetingPlatformProfile(identifier: $0.bundleIdentifier, displayName: $0.displayName)
@@ -1104,7 +1123,7 @@ struct MeetingTranscriptionView: View {
private func refreshCachedReadiness() {
self.cachedMicrophoneStatus = AVCaptureDevice.authorizationStatus(for: .audio)
self.cachedScreenCaptureAccess = CGPreflightScreenCaptureAccess()
- let storage = Self.storageReadiness(trackCount: MeetingPCMStoragePolicy.trackCount(for: self.setupDraft.mode))
+ let storage = Self.storageReadiness(trackCount: MeetingPCMStoragePolicy.trackCount(for: self.effectiveCaptureMode))
self.cachedStorageStatus = storage.status
self.cachedStorageReady = storage.ready
}
@@ -1181,6 +1200,7 @@ struct MeetingTranscriptionCanvas: View {
let canUndoCorrection: (MeetingSessionID) -> Bool
let isQuiescent: Bool
let onRepairSetup: () -> Void
+ var onEditSetup: (() -> Void)? = nil
let isRetrying: Bool
let onCloseSelection: (() -> Void)?
@@ -1199,14 +1219,14 @@ struct MeetingTranscriptionCanvas: View {
Group {
if self.fillsCanvasHeight {
self.canvasContent
- .frame(maxWidth: AppTheme.Metrics.Showcase.pageMaxWidth)
- .padding(self.theme.metrics.spacing.xxl)
+ .frame(maxWidth: 820)
+ .padding(self.theme.metrics.spacing.lg * 2)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
} else {
ScrollView {
self.canvasContent
- .frame(maxWidth: 820)
- .padding(self.theme.metrics.spacing.xxl)
+ .frame(maxWidth: 720)
+ .padding(self.theme.metrics.spacing.lg * 2)
.frame(maxWidth: .infinity)
}
}
@@ -1223,13 +1243,13 @@ struct MeetingTranscriptionCanvas: View {
MeetingSetupCanvas(
draft: self.$setupDraft,
applications: self.applications,
- microphones: self.microphones,
readiness: self.readiness,
isStarting: isStarting,
errorMessage: self.errorMessage,
recentSession: recentSession,
onStart: self.onStart,
- onRepairSetup: self.onRepairSetup
+ onRepairSetup: self.onRepairSetup,
+ onEditSetup: self.onEditSetup ?? self.onRepairSetup
)
case let .recording(session, trackHealth, liveTranscript):
MeetingRecordingCanvas(
@@ -1299,26 +1319,29 @@ private struct MeetingTranscriptionHeader: View {
var body: some View {
HStack(spacing: self.theme.metrics.spacing.md) {
- Image(systemName: "person.2.fill")
- .font(self.theme.typography.titleIcon)
- .foregroundStyle(self.theme.palette.accent)
-
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
- Text("Meet Assist")
- .font(self.theme.typography.title)
- .foregroundStyle(self.theme.palette.primaryText)
- Text("Your conversations, kept close.")
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
+ Label("FluidMeet", systemImage: "person.2")
+ .font(self.theme.typography.bodyStrong)
+ .foregroundStyle(self.theme.palette.primaryText)
Spacer()
- HStack(spacing: self.theme.metrics.spacing.xs) {
+ ViewThatFits(in: .horizontal) {
+ self.actions(showsLabels: true)
+ self.actions(showsLabels: false)
+ }
+ }
+ .padding(.horizontal, self.theme.metrics.spacing.xxl)
+ .padding(.vertical, self.theme.metrics.spacing.md)
+ }
+
+ private func actions(showsLabels: Bool) -> some View {
+ FluidGlassControlGroup {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
if self.canStartNewMeeting {
MeetingHeaderIconButton(
systemImage: "plus",
label: "New Meeting",
+ visibleTitle: showsLabels ? "New meeting" : nil,
action: self.onNewMeeting
)
.keyboardShortcut("n", modifiers: .command)
@@ -1327,7 +1350,8 @@ private struct MeetingTranscriptionHeader: View {
MeetingHeaderIconButton(
systemImage: "gearshape",
- label: "Meet Assist settings",
+ label: "FluidMeet settings",
+ visibleTitle: showsLabels ? "Settings" : nil,
action: self.onOpenMeetingSettings
)
.disabled(!self.canEditSetup)
@@ -1338,13 +1362,12 @@ private struct MeetingTranscriptionHeader: View {
? "rectangle.righthalf.inset.filled"
: "sidebar.right",
label: self.isMeetingHistoryVisible ? "Hide meeting history" : "Show meeting history",
+ visibleTitle: showsLabels ? "Meetings" : nil,
isSelected: self.isMeetingHistoryVisible,
action: self.onToggleMeetingHistory
)
}
}
- .padding(.horizontal, self.theme.metrics.spacing.xxl)
- .padding(.vertical, self.theme.metrics.spacing.lg)
}
private var canStartNewMeeting: Bool {
@@ -1368,16 +1391,20 @@ private struct MeetingTranscriptionHeader: View {
private struct MeetingHeaderIconButton: View {
let systemImage: String
let label: String
+ var visibleTitle: String? = nil
var isSelected = false
let action: () -> Void
@Environment(\.theme) private var theme
var body: some View {
Button(action: self.action) {
- Image(systemName: self.systemImage)
- .foregroundStyle(self.isSelected ? self.theme.palette.accent : self.theme.palette.primaryText)
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Image(systemName: self.systemImage)
+ if let visibleTitle { Text(visibleTitle) }
+ }
+ .foregroundStyle(self.isSelected ? self.theme.palette.accent : self.theme.palette.primaryText)
}
- .fluidGlassAction(circular: true)
+ .meetingGlassAction(circular: self.visibleTitle == nil)
.help(self.label)
.accessibilityLabel(self.label)
.accessibilityAddTraits(self.isSelected ? .isSelected : [])
@@ -1400,6 +1427,7 @@ private struct MeetingHistoryInspector: View {
@Environment(\.theme) private var theme
@State private var searchText = ""
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
private var filteredSessions: [MeetingSession] {
let query = self.searchText.trimmingCharacters(in: .whitespacesAndNewlines)
@@ -1436,8 +1464,8 @@ private struct MeetingHistoryInspector: View {
var body: some View {
VStack(spacing: 0) {
HStack(spacing: self.theme.metrics.spacing.sm) {
- Text("Your meetings")
- .font(self.theme.typography.sectionTitle)
+ Text("Meetings")
+ .font(self.theme.typography.bodySmallStrong)
Text("\(self.sessions.count)")
.font(self.theme.typography.badge)
.foregroundStyle(self.theme.palette.secondaryText)
@@ -1446,6 +1474,7 @@ private struct MeetingHistoryInspector: View {
Image(systemName: "arrow.clockwise")
}
.buttonStyle(.borderless)
+ .meetingHoverFeedback()
.help("Refresh meeting history")
.accessibilityLabel("Refresh meeting history")
}
@@ -1456,6 +1485,14 @@ private struct MeetingHistoryInspector: View {
HStack(spacing: self.theme.metrics.spacing.sm) {
Image(systemName: "magnifyingglass").foregroundStyle(.secondary)
TextField("Search meetings", text: self.$searchText).textFieldStyle(.plain)
+ if !self.searchText.isEmpty {
+ Button { self.searchText = "" } label: {
+ Image(systemName: "xmark.circle.fill").foregroundStyle(.secondary)
+ }
+ .buttonStyle(.plain)
+ .meetingHoverFeedback()
+ .accessibilityLabel("Clear meeting search")
+ }
}
.padding(self.theme.metrics.spacing.md)
.fluidDropdownSurface()
@@ -1491,12 +1528,25 @@ private struct MeetingHistoryInspector: View {
session: session,
isSelected: self.selectedSessionID == session.id,
isQuiescent: self.isQuiescent,
+ onSelect: { self.selectedSessionID = session.id },
onRetry: { self.onRetry(session.id) },
onRecordAgain: { self.onRecordAgain(session) }
)
.id(session.id)
- .onTapGesture { self.selectedSessionID = session.id }
.contextMenu { self.contextMenu(for: session) }
+ .overlay(alignment: .topTrailing) {
+ Menu { self.contextMenu(for: session) } label: {
+ Image(systemName: "ellipsis")
+ .frame(width: 24, height: 24)
+ .contentShape(Rectangle())
+ }
+ .menuStyle(.borderlessButton)
+ .menuIndicator(.hidden)
+ .fixedSize()
+ .meetingHoverFeedback()
+ .accessibilityLabel("Actions for \(session.title)")
+ .padding(self.theme.metrics.spacing.sm)
+ }
}
} header: {
Text(group.key)
@@ -1521,7 +1571,7 @@ private struct MeetingHistoryInspector: View {
guard let moved = self.sessionID(movingFrom: self.selectedSessionID, direction: direction)
else { return }
self.selectedSessionID = moved
- withAnimation(.easeOut(duration: 0.12)) { proxy.scrollTo(moved, anchor: .center) }
+ withAnimation(self.reduceMotion ? nil : .easeOut(duration: 0.12)) { proxy.scrollTo(moved, anchor: .center) }
}
}
}
@@ -1597,37 +1647,70 @@ private struct MeetingHistoryRow: View {
let session: MeetingSession
let isSelected: Bool
let isQuiescent: Bool
+ let onSelect: () -> Void
let onRetry: () -> Void
let onRecordAgain: () -> Void
@Environment(\.theme) private var theme
+ @Environment(\.isEnabled) private var isEnabled
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
@State private var isHovered = false
var body: some View {
- HStack(spacing: self.theme.metrics.spacing.md) {
- self.tile
- VStack(alignment: .leading, spacing: 2) {
- Text(self.session.title)
- .font(self.theme.typography.bodyStrong)
- .foregroundStyle(self.theme.palette.primaryText)
- .lineLimit(1)
- .truncationMode(.tail)
- self.secondaryLine
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ Button(action: self.onSelect) {
+ HStack(alignment: .top, spacing: self.theme.metrics.spacing.md) {
+ self.tile
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text(self.session.title)
+ .font(self.theme.typography.bodyStrong)
+ .foregroundStyle(self.theme.palette.primaryText)
+ .lineLimit(2)
+ .multilineTextAlignment(.leading)
+ .padding(.trailing, self.theme.metrics.spacing.xxl)
+ self.secondaryLine
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .padding(.horizontal, self.theme.metrics.spacing.md)
+ .padding(.vertical, self.theme.metrics.spacing.md)
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
+ .accessibilityLabel("\(self.session.title), \(self.statusText), \(self.sourceName)")
+ .accessibilityAddTraits(self.isSelected ? .isSelected : [])
+ if let actionLabel {
+ Button(actionLabel, action: self.performAction)
+ .buttonStyle(.borderless)
+ .meetingHoverFeedback()
+ .font(self.theme.typography.captionStrong)
+ .foregroundStyle(self.actionColor)
+ .disabled(!self.isQuiescent)
+ .accessibilityLabel(self.actionAccessibilityLabel ?? actionLabel)
+ .padding(.leading, 18 + self.theme.metrics.spacing.md * 2)
+ .padding(.bottom, self.theme.metrics.spacing.sm)
}
- Spacer(minLength: 0)
}
- .padding(.horizontal, self.theme.metrics.spacing.sm)
- .padding(.vertical, self.theme.metrics.spacing.sm)
- .background(self.rowBackground, in: RoundedRectangle(cornerRadius: self.theme.metrics.corners.md, style: .continuous))
+ .background {
+ RoundedRectangle(cornerRadius: self.theme.metrics.corners.md, style: .continuous)
+ .fill(self.rowBackground)
+ .animation(self.reduceMotion ? nil : .easeOut(duration: 0.14), value: self.isHovered && self.isEnabled)
+ }
.contentShape(Rectangle())
- .onHover { self.isHovered = $0 }
- .accessibilityElement(children: .combine)
- .accessibilityLabel("\(self.session.title), \(self.statusText), \(self.sourceName)")
- .accessibilityAddTraits(self.isSelected ? [.isButton, .isSelected] : .isButton)
+ .onHover { self.isHovered = $0 && self.isEnabled }
+ .onChange(of: self.isEnabled) { _, enabled in
+ if !enabled { self.isHovered = false }
+ }
+ .onDisappear { self.isHovered = false }
+ .accessibilityElement(children: .contain)
}
private var tile: some View {
- FluidIconTile(icon: self.tileIcon, tint: self.tileIconColor, size: 44)
+ Image(systemName: self.tileIcon)
+ .font(self.theme.typography.bodySmall)
+ .foregroundStyle(self.tileIconColor)
+ .frame(width: 18, height: 22)
}
@ViewBuilder
@@ -1639,14 +1722,6 @@ private struct MeetingHistoryRow: View {
}
Text(part)
}
- if let actionLabel {
- Text("·").foregroundStyle(self.theme.palette.tertiaryText)
- Button(actionLabel, action: self.performAction)
- .buttonStyle(.plain)
- .foregroundStyle(self.actionColor)
- .disabled(!self.isQuiescent)
- .accessibilityLabel(self.actionAccessibilityLabel ?? actionLabel)
- }
}
.font(self.theme.typography.caption)
.foregroundStyle(self.theme.palette.secondaryText)
@@ -1670,13 +1745,13 @@ private struct MeetingHistoryRow: View {
case .completed:
var parts = [self.timeText, Self.durationText(self.session.duration)]
if !self.session.activeSpeakers.isEmpty {
- parts.append("\(self.session.activeSpeakers.count) speakers")
+ parts.append(self.session.activeSpeakers.count == 1 ? "1 speaker" : "\(self.session.activeSpeakers.count) speakers")
}
return parts
case .interrupted:
return [self.timeText, "Interrupted"]
case .failed:
- return [self.timeText, self.session.failures.last?.message ?? "Failed"]
+ return [self.timeText, "Failed"]
case .processing:
return [self.timeText, "Processing"]
case .recording, .recordingDegraded, .preparing, .stopping:
@@ -1706,12 +1781,8 @@ private struct MeetingHistoryRow: View {
}
private var rowBackground: Color {
- if self.isSelected {
- return self.theme.palette.accent.opacity(self.theme.metrics.pickerControl.selectedRowOpacity)
- }
- if self.isHovered {
- return self.theme.palette.accent.opacity(self.theme.metrics.pickerControl.selectedRowOpacity * 0.4)
- }
+ if self.isSelected { return self.theme.palette.primaryText.opacity(self.isHovered && self.isEnabled ? 0.14 : 0.08) }
+ if self.isHovered && self.isEnabled { return self.theme.palette.primaryText.opacity(0.06) }
return .clear
}
@@ -1754,522 +1825,241 @@ private struct MeetingHistoryRow: View {
}
}
-private struct MeetingRecordingSettingsSheet: View {
+private struct MeetingSetupCanvas: View {
@Binding var draft: MeetingTranscriptionSetupDraft
- @Binding var retentionPolicy: MeetingAudioRetentionPolicy
- @ObservedObject private var dismissalAdvisor = MeetingAutoDetectDismissalAdvisor.shared
- @ObservedObject private var appServices = AppServices.shared
let applications: [MeetingApplicationOption]
- let microphones: [MeetingMicrophoneOption]
let readiness: MeetingSetupReadiness
- let isFirstSetup: Bool
- let onRefreshSources: () -> Void
- let onOpenMicrophoneSettings: @MainActor @Sendable () -> Void
- let onOpenScreenRecordingSettings: @MainActor @Sendable () -> Void
- let onOpenVoiceEngine: () -> Void
- let onCancel: () -> Void
- let onSave: () -> Void
+ let isStarting: Bool
+ let errorMessage: String?
+ let recentSession: MeetingSession?
+ let onStart: () -> Void
+ let onRepairSetup: () -> Void
+ let onEditSetup: () -> Void
@Environment(\.theme) private var theme
+ @State private var documentSection = MeetingDocumentSection.transcript
- private var canSave: Bool {
- guard self.draft.selectedMicrophoneID != nil else { return false }
- return self.draft.mode == .inRoom
- || self.draft.usesAutomaticApplication
- || self.draft.selectedApplicationID != nil
+ private var systemsReady: Bool {
+ !self.readiness.isCheckingSources &&
+ self.readiness.microphoneReady &&
+ self.readiness.storageReady &&
+ self.readiness.activityReady &&
+ self.readiness.modelReady &&
+ self.readiness.meetingAudioReady
}
- private var separationDescription: String {
- if !CPUArchitecture.isAppleSilicon {
- return "Plain transcript on Intel"
- }
- return self.readiness.modelReady ? "Automatic after Stop" : "Load supplied model below"
+ private var canStart: Bool {
+ self.systemsReady && self.draft.selectedMicrophoneID != nil &&
+ !self.draft.title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
}
- private var saveHelp: String? {
- guard !self.canSave else { return nil }
- if let blockingMessage = readiness.blockingMessage {
- return blockingMessage
- }
- if self.draft.selectedMicrophoneID == nil {
- return "Choose an available microphone to save this setup."
- }
- return "Choose an available meeting application to save this setup."
+ private var resolvedApplication: MeetingApplicationOption? {
+ guard self.draft.mode == .onlineCall else { return nil }
+ return self.applications.first(where: { $0.id == self.draft.selectedApplicationID })
}
- var body: some View {
- VStack(spacing: 0) {
- HStack(spacing: self.theme.metrics.spacing.md) {
- Image(systemName: "gearshape.fill")
- .font(self.theme.typography.titleIcon)
- .foregroundStyle(self.theme.palette.accent)
-
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
- Text(self.isFirstSetup ? "Set up Meet Assist" : "Meet Assist settings")
- .font(self.theme.typography.title)
- Text("Set recording defaults and choose this meeting’s audio source.")
- .font(self.theme.typography.bodySmall)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
- Spacer()
- }
- .padding(.horizontal, self.theme.metrics.spacing.xl)
- .padding(.vertical, self.theme.metrics.spacing.lg)
-
- Divider()
-
- ScrollView {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.lg) {
- FluidManagementGroup(title: "Recording") {
- VStack(spacing: 0) {
- MeetingAdaptiveSetupRow(
- title: "Meeting type",
- detail: "Choose the setup you use most often."
- ) {
- Menu {
- Picker("Meeting type", selection: self.$draft.mode) {
- Text("Online call").tag(MeetingCaptureMode.onlineCall)
- Text("In-room").tag(MeetingCaptureMode.inRoom)
- }
- .pickerStyle(.inline)
- } label: {
- Text(self.draft.mode == .onlineCall ? "Online call" : "In-room")
- }
- .fluidDropdownStyle(fillsWidth: true)
- .accessibilityLabel("Default meeting type")
- }
+ private var blockedHelp: String {
+ if let blockingMessage = readiness.blockingMessage { return blockingMessage }
+ if self.draft.selectedMicrophoneID == nil { return "Choose a microphone in Settings to continue." }
+ return "Check the recording setup."
+ }
- if self.draft.mode == .onlineCall {
- Divider()
- MeetingAdaptiveSetupRow(
- title: "Meeting audio",
- detail: "Automatic uses the detected meeting. You can also choose an audio source for this meeting."
- ) {
- Menu {
- Picker("Meeting audio", selection: Binding(
- get: { self.draft.usesAutomaticApplication ? nil : self.draft.selectedApplicationID },
- set: {
- self.draft.usesAutomaticApplication = $0 == nil
- self.draft.selectedApplicationID = $0
- }
- )) {
- Text("Automatic").tag(String?.none)
- ForEach(self.applications) { option in
- Text(option.identity.displayName).tag(Optional(option.id))
- }
- }
- .pickerStyle(.inline)
- } label: {
- Text(self.draft.usesAutomaticApplication ? "Automatic" :
- (self.applications.first(where: { $0.id == self.draft.selectedApplicationID })?.identity.displayName ?? "Source unavailable"))
- }
- .fluidDropdownStyle(fillsWidth: true)
- .accessibilityLabel("Meeting audio source")
- }
- }
+ private var planHeadline: String {
+ if let app = resolvedApplication { return "\(app.identity.displayName) is open." }
+ return self.draft.mode == .inRoom ? "In-person meeting." : "No call open."
+ }
- if self.draft.autoDetectEnabled,
- self.appServices.meetingAutoDetectHealth == .zoomWindowTitleUnreadable
- {
- MeetingAdaptiveSetupRow(
- title: "Zoom window access needs repair",
- detail: "Screen Recording or Accessibility access is preventing FluidVoice from reading Zoom meeting windows. Recording has not started."
- ) {
- Button("Open Screen Recording Settings") {
- self.onOpenScreenRecordingSettings()
- }
- .fluidButton(.compact, size: .small)
- }
- }
+ private var planDetail: String {
+ if let app = resolvedApplication { return "\(app.identity.displayName) and your mic will be recorded." }
+ if self.draft.mode == .inRoom { return "Your mic will record the room." }
+ if self.applications.isEmpty { return "Your mic will record the room. No meeting apps are available to capture yet." }
+ return "Your mic will record the room. If a call is running, pick its app under Change."
+ }
- Divider()
- MeetingAdaptiveSetupRow(
- title: "Microphone",
- detail: "Used for your voice and in-room meetings."
- ) {
- Menu {
- Picker("Microphone", selection: self.$draft.selectedMicrophoneID) {
- Text("Choose microphone…").tag(String?.none)
- ForEach(self.microphones) { option in
- Text(option.identity.displayName).tag(Optional(option.id))
- }
- }
- .pickerStyle(.inline)
- } label: {
- Text(self.microphones.first(where: { $0.id == self.draft.selectedMicrophoneID })?.identity.displayName ?? "Choose microphone…")
- }
- .fluidDropdownStyle(fillsWidth: true)
- .accessibilityLabel("Default meeting microphone")
- }
+ private var sourceLabel: String {
+ if let app = resolvedApplication { return app.identity.displayName }
+ return self.draft.mode == .inRoom ? "In person" : "Automatic"
+ }
- Divider()
- MeetingAdaptiveSetupRow(title: "Language") {
- Text("English")
- .font(self.theme.typography.bodyStrong)
- .frame(maxWidth: .infinity, alignment: .leading)
- }
+ private var meetingApplications: [MeetingApplicationOption] {
+ self.applications.filter { MeetingAppRegistry.tier(forBundleIdentifier: $0.identity.bundleIdentifier) != nil }
+ }
- Divider()
- MeetingAdaptiveSetupRow(title: "Speaker separation") {
- Text(self.separationDescription)
- .font(self.theme.typography.bodyStrong)
- .frame(maxWidth: .infinity, alignment: .leading)
- }
- }
- }
- FluidManagementGroup(title: "Storage & detection") {
- VStack(spacing: 0) {
- MeetingAdaptiveSetupRow(
- title: "Keep audio",
- detail: "Applies to all recordings, including past ones. Audio is deleted only "
- + "while FluidVoice is running; transcripts are always kept."
- ) {
- Menu {
- Picker("Keep audio", selection: self.$retentionPolicy) {
- ForEach(MeetingAudioRetentionPolicy.allCases, id: \.self) { policy in
- Text(policy.displayName).tag(policy)
- }
- }
- .pickerStyle(.inline)
- } label: {
- Text(self.retentionPolicy.displayName)
- }
- .fluidDropdownStyle(fillsWidth: true)
- .accessibilityLabel("Audio retention")
- }
+ private var otherApplications: [MeetingApplicationOption] {
+ self.applications.filter { MeetingAppRegistry.tier(forBundleIdentifier: $0.identity.bundleIdentifier) == nil }
+ }
- Divider()
- MeetingAdaptiveSetupRow(
- title: "Detect meetings automatically",
- detail: "Shows a \"Meeting detected\" prompt for Zoom, Teams, and Webex. Never starts recording on its own.",
- trailingSwitch: true
- ) {
- Toggle("", isOn: self.$draft.autoDetectEnabled)
- .labelsHidden()
- .toggleStyle(.switch)
- .accessibilityLabel("Detect meetings automatically")
- }
+ var body: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
+ MeetingDocumentTitle(title: "Be in the conversation.")
+ Text("Record your meeting. Come back to every word.")
+ .font(self.theme.typography.body)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ }
- if self.draft.autoDetectEnabled {
- Divider()
- MeetingAdaptiveSetupRow(
- title: "Also check browser tabs",
- detail: "Checks the address of the frontmost browser tab against a fixed list of meeting "
- + "sites (Google Meet, Zoom, Teams, Whereby, Jitsi). Nothing is stored or sent.",
- trailingSwitch: true
- ) {
- Toggle("", isOn: self.$draft.browserDetectionEnabled)
- .labelsHidden()
- .toggleStyle(.switch)
- .accessibilityLabel("Also check browser tabs")
- }
- }
- }
- }
+ MeetingDocumentTabs(selection: self.$documentSection, primaryTitle: "Meeting home", primaryIcon: "house", isEnabled: !self.isStarting)
- MeetingModelSettingsSection()
-
- if self.dismissalAdvisor.shouldSuggest {
- ThemedCard(style: .subtle, padding: self.theme.metrics.spacing.md) {
- HStack(spacing: self.theme.metrics.spacing.md) {
- Label(
- "You've dismissed several meeting-detected prompts recently.",
- systemImage: "bell.slash"
- )
- .font(self.theme.typography.bodySmall)
- Spacer()
- Button("Turn Off") {
- self.draft.autoDetectEnabled = false
- self.draft.browserDetectionEnabled = false
- self.dismissalAdvisor.shouldSuggest = false
- }
- .fluidButton(.compact, size: .small)
- Button("Keep On") {
- self.dismissalAdvisor.shouldSuggest = false
- }
- .fluidButton(.compact, size: .small)
- }
- }
- }
+ if self.documentSection == .summary {
+ MeetingSummaryComingSoon()
+ } else {
+ self.recordingSetup
+ }
+ }
+ }
- ViewThatFits(in: .horizontal) {
- HStack(spacing: self.theme.metrics.spacing.sm) {
- self.repairActions
- }
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- self.repairActions
+ private var recordingSetup: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.lg) {
+ ThemedCard(style: .standard, padding: self.theme.metrics.spacing.xl) {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
+ self.plan
+ FluidGlassControlGroup {
+ ViewThatFits(in: .horizontal) {
+ HStack(spacing: self.theme.metrics.spacing.md) { self.actions }
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) { self.actions }
}
}
-
- Label("Recording and transcription stay on this Mac.", systemImage: "lock.fill")
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
-
- if let saveHelp {
- Label(saveHelp, systemImage: "exclamationmark.circle")
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.warning)
- }
- }
- .padding(self.theme.metrics.spacing.xl)
- }
-
- Divider()
-
- HStack(spacing: self.theme.metrics.spacing.md) {
- Button(self.isFirstSetup ? "Not Now" : "Cancel", action: self.onCancel)
- .fluidGlassAction(spacious: true)
- .keyboardShortcut(.cancelAction)
- Spacer()
- Button(self.readiness.isCheckingSources ? "Refreshing…" : "Refresh Sources", systemImage: "arrow.clockwise") {
- self.onRefreshSources()
}
- .fluidGlassAction(spacious: true)
- .disabled(self.readiness.isCheckingSources)
-
- Button(self.isFirstSetup ? "Save Setup" : "Save Changes", action: self.onSave)
- .fluidGlassAction(prominent: true, spacious: true)
- .disabled(!self.canSave)
- .keyboardShortcut(.defaultAction)
}
- .padding(self.theme.metrics.spacing.lg)
- }
- .frame(width: 720)
- .frame(minHeight: 540, idealHeight: 700)
- .background(self.theme.palette.windowBackground)
- }
- @ViewBuilder
- private var repairActions: some View {
- if self.readiness.showMicrophoneSettingsAction {
- Button("Microphone Settings", systemImage: "mic.fill", action: self.onOpenMicrophoneSettings)
- .fluidButton(.compact, size: .small)
- }
- if self.readiness.showScreenRecordingSettingsAction {
- Button(
- "Screen Recording Settings",
- systemImage: "rectangle.inset.filled.and.person.filled",
- action: self.onOpenScreenRecordingSettings
- )
- .fluidButton(.compact, size: .small)
+ self.recordingFooter
}
}
-}
-
-private struct MeetingSetupCanvas: View {
- @Binding var draft: MeetingTranscriptionSetupDraft
-
- let applications: [MeetingApplicationOption]
- let microphones: [MeetingMicrophoneOption]
- let readiness: MeetingSetupReadiness
- let isStarting: Bool
- let errorMessage: String?
- let recentSession: MeetingSession?
- let onStart: () -> Void
- let onRepairSetup: () -> Void
-
- @Environment(\.theme) private var theme
-
- private var requiredSystemsReady: Bool {
- !self.readiness.isCheckingSources &&
- self.readiness.microphoneReady &&
- self.readiness.storageReady &&
- self.readiness.activityReady &&
- self.readiness.modelReady &&
- (self.draft.mode == .inRoom || self.readiness.meetingAudioReady)
- }
- private var canStart: Bool {
- guard self.requiredSystemsReady,
- self.draft.selectedMicrophoneID != nil,
- !self.draft.title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
- else {
- return false
+ @ViewBuilder private var plan: some View {
+ if self.readiness.isCheckingSources {
+ MeetingHomeStatus(kind: .checking, title: "Checking your setup…", detail: "This only takes a moment.")
+ } else if !self.canStart {
+ MeetingHomeStatus(kind: .blocked, title: "One thing before recording", detail: self.blockedHelp)
+ } else {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text(self.planHeadline)
+ .font(.system(.title2, design: .serif).weight(.medium))
+ .foregroundStyle(self.theme.palette.primaryText)
+ Text(self.planDetail)
+ .font(self.theme.typography.body)
+ .foregroundStyle(self.theme.palette.secondaryText)
+ }
+ .fixedSize(horizontal: false, vertical: true)
+ .accessibilityElement(children: .combine)
}
- return self.draft.mode == .inRoom || self.draft.selectedApplicationID != nil
}
- private var waitingForMeeting: Bool {
- self.draft.usesAutomaticApplication && self.draft.autoDetectEnabled &&
- self.draft.mode == .onlineCall && self.draft.selectedApplicationID == nil &&
- self.draft.selectedMicrophoneID != nil && self.requiredSystemsReady
+ @ViewBuilder private var actions: some View {
+ self.startAction
+ self.sourceMenu
+ self.permissionAction
}
- private var startHelp: String? {
- if let blockingMessage = readiness.blockingMessage, !self.requiredSystemsReady {
- return blockingMessage
- }
- if self.draft.selectedMicrophoneID == nil {
- return "Choose a microphone in Settings to continue."
- }
- if self.draft.mode == .onlineCall, self.draft.selectedApplicationID == nil {
- if self.waitingForMeeting {
- return "Join a supported meeting. Its audio source will be detected automatically."
+ private var sourceMenu: some View {
+ Menu {
+ self.sourceEntry("In person · mic only", systemImage: "person.2", selected: self.draft.mode == .inRoom) {
+ self.draft.mode = .inRoom
}
- if self.draft.usesAutomaticApplication, !self.draft.autoDetectEnabled {
- return "Meeting detection is off. Enable it in Settings, or choose a source manually."
+ self.sourceEntry("Automatic · follows a detected call", systemImage: "wand.and.stars",
+ selected: self.draft.mode == .onlineCall && self.draft.usesAutomaticApplication) {
+ self.draft.mode = .onlineCall
+ self.draft.usesAutomaticApplication = true
+ self.draft.selectedApplicationID = nil
+ }
+ if !self.meetingApplications.isEmpty {
+ Divider()
+ ForEach(self.meetingApplications) { option in
+ self.applicationEntry(option)
+ }
+ }
+ if !self.otherApplications.isEmpty {
+ Divider()
+ Menu("Other audio sources") {
+ ForEach(self.otherApplications) { option in
+ self.applicationEntry(option)
+ }
+ }
+ }
+ if self.applications.isEmpty {
+ Divider()
+ Button("No apps found · Allow meeting audio access…", systemImage: "arrow.up.right", action: self.onRepairSetup)
+ }
+ Divider()
+ Button("More settings…", systemImage: "gearshape", action: self.onEditSetup)
+ } label: {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Text("Change · \(self.sourceLabel)")
+ Image(systemName: "chevron.up.chevron.down").imageScale(.small)
}
- return "Open your meeting app, or choose an audio source in Settings."
- }
- if self.draft.title.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
- return "Add a title for this meeting."
}
- return nil
+ .menuStyle(.button)
+ .menuIndicator(.hidden)
+ .meetingGlassAction(spacious: true)
+ .disabled(self.isStarting)
+ .help("Choose what gets recorded.")
+ .accessibilityLabel("Change recording source. Currently \(self.sourceLabel)")
}
- private var modeName: String {
- self.draft.mode == .onlineCall ? "Online call" : "In-room meeting"
- }
-
- private var applicationName: String? {
- guard self.draft.mode == .onlineCall else { return nil }
- return self.applications.first(where: { $0.id == self.draft.selectedApplicationID })?.identity.displayName
+ private func applicationEntry(_ option: MeetingApplicationOption) -> some View {
+ let selected = self.draft.mode == .onlineCall && !self.draft.usesAutomaticApplication && self.draft.selectedApplicationID == option.id
+ return self.sourceEntry(option.identity.displayName, systemImage: "app", selected: selected) {
+ self.draft.mode = .onlineCall
+ self.draft.usesAutomaticApplication = false
+ self.draft.selectedApplicationID = option.id
+ }
}
- private var microphoneName: String {
- self.microphones.first(where: { $0.id == self.draft.selectedMicrophoneID })?.identity.displayName
- ?? "No microphone selected"
+ private func sourceEntry(_ title: String, systemImage: String, selected: Bool, action: @escaping () -> Void) -> some View {
+ Button(action: action) {
+ if selected { Label(title, systemImage: "checkmark") } else { Text(title) }
+ }
}
- var body: some View {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
- Text("Ready for your next conversation.")
- .font(.fluidSystem(size: 30, weight: .regular, design: .serif))
+ private var recordingFooter: some View {
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.lg) {
+ Label(self.resolvedApplication != nil
+ ? "Stays on this Mac. Use headphones for clearer speaker separation."
+ : "Stays on this Mac. Place it where everyone can be heard.", systemImage: "lock")
+ .font(self.theme.typography.caption)
+ .foregroundStyle(self.theme.palette.secondaryText)
.fixedSize(horizontal: false, vertical: true)
- .accessibilityAddTraits(.isHeader)
-
- ThemedCard(style: .standard, padding: self.theme.metrics.spacing.xxl) {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- HStack {
- Text("Meeting title").font(self.theme.typography.caption).foregroundStyle(.secondary)
- Spacer()
- Label(self.modeName, systemImage: self.draft.mode == .onlineCall ? "video" : "person.2")
- .font(self.theme.typography.captionStrong)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
- TextField("Meeting title", text: Binding(
- get: { self.draft.title },
- set: { self.draft.title = $0; self.draft.titleWasEdited = true }
- ))
- .textFieldStyle(.plain)
- .font(self.theme.typography.sectionTitle)
- .padding(self.theme.metrics.spacing.md)
- .fluidDropdownSurface()
- .accessibilityLabel("Meeting title")
- .disabled(self.isStarting)
- }
-
- if self.draft.mode == .onlineCall {
- self.sourceRow(
- "Meeting audio",
- value: self.draft.usesAutomaticApplication
- ? "Automatic · \(self.applicationName ?? "No meeting detected")"
- : (self.applicationName ?? "Source unavailable"),
- icon: "macwindow"
- )
- }
- self.sourceRow("Microphone", value: self.microphoneName, icon: "mic")
- Divider().opacity(0.4)
- MeetingReadyStatus(
- isReady: self.canStart,
- isWaiting: self.waitingForMeeting,
- title: self.readiness.isCheckingSources ? "Checking recording setup…" :
- (self.canStart ? "Ready to record" : (self.waitingForMeeting ? "Waiting for a meeting" : "Setup needs attention")),
- detail: self.canStart ? "English · \(self.readiness.storageStatus)" : (self.startHelp ?? "Check the recording setup.")
- )
- ViewThatFits(in: .horizontal) {
- HStack(spacing: self.theme.metrics.spacing.lg) {
- self.permissionAction
- Spacer(minLength: self.theme.metrics.spacing.lg)
- self.startAction
- }
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.md) {
- self.permissionAction
- self.startAction.frame(maxWidth: .infinity, alignment: .trailing)
- }
- }
- }
- }
-
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- Label("Recording and transcription stay on this Mac.", systemImage: "lock.fill")
- Label(
- self.draft.mode == .onlineCall
- ? "Headphones give the cleanest speaker separation."
- : "Place the Mac where every speaker can be heard clearly.",
- systemImage: self.draft.mode == .onlineCall ? "headphones" : "mic.fill"
- )
- Label("Make sure everyone knows the meeting is being recorded.", systemImage: "person.2")
- }
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
if let errorMessage, !errorMessage.isEmpty {
Label(errorMessage, systemImage: "exclamationmark.triangle.fill")
.font(self.theme.typography.bodySmall)
.foregroundStyle(self.theme.palette.warning)
+ .fixedSize(horizontal: false, vertical: true)
.accessibilityLabel("Could not start recording. \(errorMessage)")
}
if let recentSession {
Divider()
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- Text("Recent meeting")
- .font(self.theme.typography.sectionTitle)
-
- HStack {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
- Text(recentSession.title)
- .font(self.theme.typography.bodyStrong)
- Text(recentSession.startedAt.formatted(date: .abbreviated, time: .shortened))
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
- Spacer()
- Text(Self.durationText(recentSession.duration))
- .font(self.theme.typography.codeCaption)
- .foregroundStyle(self.theme.palette.secondaryText)
+ HStack(spacing: self.theme.metrics.spacing.md) {
+ Image(systemName: "clock.arrow.circlepath")
+ .foregroundStyle(self.theme.palette.secondaryText)
+ VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
+ Text("Last meeting").font(self.theme.typography.caption).foregroundStyle(.secondary)
+ Text(recentSession.title).font(self.theme.typography.bodyStrong).lineLimit(2)
}
- .padding(self.theme.metrics.spacing.md)
- .background(self.theme.palette.contentBackground, in: RoundedRectangle(
- cornerRadius: self.theme.metrics.corners.md,
- style: .continuous
- ))
+ Spacer()
+ Text(Self.durationText(recentSession.duration))
+ .font(self.theme.typography.codeCaption).foregroundStyle(.secondary)
}
}
}
- .padding(.top, self.theme.metrics.spacing.xl)
- }
-
- private func sourceRow(_ title: String, value: String, icon: String) -> some View {
- HStack(spacing: self.theme.metrics.spacing.lg) {
- FluidIconTile(icon: icon, tint: self.theme.palette.accent, size: 44)
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
- Text(title).font(self.theme.typography.bodyStrong).foregroundStyle(self.theme.palette.primaryText)
- Text(value).font(self.theme.typography.bodySmall).foregroundStyle(.secondary).fixedSize(horizontal: false, vertical: true)
- }
- Spacer(minLength: 0)
- }
- .padding(.vertical, self.theme.metrics.spacing.sm)
- .accessibilityElement(children: .combine)
}
@ViewBuilder private var permissionAction: some View {
if !self.canStart, !self.readiness.isCheckingSources,
self.readiness.showMicrophoneSettingsAction || self.readiness.showScreenRecordingSettingsAction ||
- !self.readiness.modelReady ||
- (self.draft.mode == .onlineCall && self.draft.selectedApplicationID == nil)
+ !self.readiness.modelReady || !self.readiness.microphoneReady || self.draft.selectedMicrophoneID == nil
{
Button(
self.readiness.showMicrophoneSettingsAction ? "Allow microphone access" :
(self.readiness.showScreenRecordingSettingsAction ? "Allow meeting audio access" :
- (!self.readiness.modelReady ? "Load speaker model…" : "Choose source manually…")),
+ (!self.readiness.microphoneReady || self.draft.selectedMicrophoneID == nil ? "Set up microphone…" : "Set up speaker labels…")),
systemImage: self.readiness.showMicrophoneSettingsAction || self.readiness.showScreenRecordingSettingsAction ? "arrow.up.right" : "gearshape",
action: self.onRepairSetup
)
- .fluidGlassAction(spacious: true)
+ .meetingGlassAction(spacious: true)
.disabled(self.isStarting)
}
}
@@ -2278,7 +2068,7 @@ private struct MeetingSetupCanvas: View {
Button(action: self.onStart) {
Label(self.isStarting ? "Starting…" : "Start recording", systemImage: self.isStarting ? "hourglass" : "record.circle")
}
- .fluidGlassAction(prominent: true, spacious: true)
+ .meetingGlassAction(prominent: true, spacious: true)
.disabled(!self.canStart || self.isStarting)
.keyboardShortcut(.defaultAction)
}
@@ -2289,813 +2079,29 @@ private struct MeetingSetupCanvas: View {
}
}
-private struct MeetingRecordingCanvas: View {
- let session: MeetingSession
- let trackHealth: [MeetingAudioTrackKind: MeetingTrackHealth]
- let liveTranscript: MeetingLiveTranscriptSnapshot
- let isStopping: Bool
- let onStop: () -> Void
+/// Readiness at a glance: a single dot carries the state, the text explains it.
+private struct MeetingHomeStatus: View {
+ enum Kind { case checking, blocked }
+
+ let kind: Kind
+ let title: String
+ let detail: String
@Environment(\.theme) private var theme
var body: some View {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
- Text(self.session.title)
- .font(self.theme.typography.title)
- .lineLimit(2)
- TimelineView(.periodic(from: .now, by: 1)) { context in
- HStack {
- Label(
- self.isStopping ? "Stopping…" : "Recording",
- systemImage: self.isStopping ? "stop.circle.fill" : "record.circle.fill"
- )
- .font(self.theme.typography.sectionTitle)
- .foregroundStyle(self.isStopping ? self.theme.palette.warning : Color(nsColor: .systemRed))
-
- Text(Self.durationText(context.date.timeIntervalSince(self.session.startedAt)))
- .font(self.theme.typography.codeCaption)
- .foregroundStyle(self.theme.palette.primaryText)
-
- Spacer()
-
- Text(self.sourceSummary)
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- .lineLimit(1)
+ HStack(alignment: .firstTextBaseline, spacing: self.theme.metrics.spacing.md) {
+ Group {
+ if self.kind == .checking {
+ ProgressView().controlSize(.mini)
+ } else {
+ Circle().fill(self.theme.palette.warning)
}
- .accessibilityElement(children: .combine)
- .accessibilityLabel(
- "\(self.isStopping ? "Meeting recording is stopping" : "Meeting recording in progress"), " +
- "\(Self.durationText(context.date.timeIntervalSince(self.session.startedAt))) elapsed, " +
- self.sourceSummary
- )
}
+ .frame(width: 12, height: 12)
+ .alignmentGuide(.firstTextBaseline) { $0[VerticalAlignment.center] + 4 }
+ .accessibilityHidden(true)
- ThemedCard(style: .subtle, padding: self.theme.metrics.spacing.md) {
- ViewThatFits(in: .horizontal) {
- HStack(spacing: self.theme.metrics.spacing.xl) { self.sourceHealth }
- VStack(spacing: self.theme.metrics.spacing.md) { self.sourceHealth }
- }
- }
-
- MeetingLiveTranscriptCard(snapshot: self.liveTranscript)
-
- if self.isStopping {
- Text("Saving captured audio before offline transcription begins…")
- .font(self.theme.typography.body)
- .foregroundStyle(self.theme.palette.secondaryText)
- } else {
- Text("Speaker labels are added after recording.")
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
-
- HStack {
- Spacer()
-
- Button(action: self.onStop) {
- if self.isStopping {
- HStack(spacing: self.theme.metrics.spacing.sm) {
- ProgressView()
- .controlSize(.small)
- Text("Stopping…")
- }
- } else {
- Label("Stop & Transcribe", systemImage: "stop.fill")
- }
- }
- .fluidGlassAction(prominent: true, tone: Color(nsColor: .systemRed), spacious: true)
- .disabled(self.isStopping)
- }
- }
- }
-
- @ViewBuilder
- private var sourceHealth: some View {
- if self.session.mode == .onlineCall {
- MeetingTrackHealthRow(title: "Meeting audio", health: self.trackHealth[.applicationAudio] ?? .waiting)
- }
- MeetingTrackHealthRow(title: "Microphone", health: self.trackHealth[.microphone] ?? .waiting)
- }
-
- private var sourceSummary: String {
- let microphoneName = self.session.selectedMicrophone.displayName
- guard self.session.mode == .onlineCall else { return microphoneName }
- let applicationName = self.session.capturedApplication?.displayName ?? "Meeting audio"
- return "\(applicationName) · \(microphoneName)"
- }
-
- private static func durationText(_ duration: TimeInterval) -> String {
- let total = max(0, Int(duration.rounded(.down)))
- let hours = total / 3600
- let minutes = (total % 3600) / 60
- let seconds = total % 60
- if hours > 0 {
- return String(format: "%d:%02d:%02d", hours, minutes, seconds)
- }
- return String(format: "%d:%02d", minutes, seconds)
- }
-}
-
-/// Live captions during recording only — rows identify capture source, not a person; the offline
-/// diarization pipeline replaces this view's content entirely on completion.
-private struct MeetingLiveTranscriptCard: View {
- let snapshot: MeetingLiveTranscriptSnapshot
-
- @Environment(\.theme) private var theme
-
- var body: some View {
- ThemedCard(style: .subtle) {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- HStack {
- Text("Live captions")
- .font(self.theme.typography.captionStrong)
- .foregroundStyle(self.theme.palette.secondaryText)
- Spacer()
- if let indicator = self.availabilityIndicator {
- Label(indicator, systemImage: "exclamationmark.circle")
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- .labelStyle(.titleAndIcon)
- }
- Button {
- MeetingFloatingCaptionsController.shared.show()
- } label: {
- Image(systemName: "rectangle.portrait.and.arrow.right")
- .font(.fluidSystem(size: 12, weight: .semibold))
- .foregroundStyle(self.theme.palette.secondaryText)
- }
- .buttonStyle(.plain)
- .accessibilityLabel("Open floating captions")
- }
-
- if self.rows.isEmpty {
- Text("Listening…")
- .font(self.theme.typography.bodySmall)
- .foregroundStyle(self.theme.palette.secondaryText)
- .frame(maxHeight: .infinity, alignment: .top)
- } else {
- self.scrollingBubbleList
- }
- }
- .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
- }
- }
-
- private var rows: [MeetingLiveBubbleComposer.Row] {
- MeetingLiveBubbleComposer.rows(for: self.snapshot)
- }
-
- private var availabilityIndicator: String? {
- switch self.snapshot.availability {
- case .available:
- return nil
- case let .unavailable(reason), let .degraded(reason):
- return reason
- }
- }
-
- private var scrollingBubbleList: some View {
- MeetingLiveBubbleScrollList(rows: self.rows, documentStyle: true)
- .frame(minHeight: 120, maxHeight: .infinity)
- }
-}
-
-private struct MeetingProcessingCanvas: View {
- let session: MeetingSession
- let stage: MeetingProcessingStage
-
- @Environment(\.theme) private var theme
-
- private let stages: [MeetingProcessingStage] = [
- .saving,
- .identifyingSpeakers,
- .transcribing,
- .finalizing,
- ]
-
- var body: some View {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
- HStack(spacing: self.theme.metrics.spacing.md) {
- ProgressView()
- .controlSize(.regular)
- .fixedSize()
-
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
- Text("Preparing your transcript")
- .font(self.theme.typography.title)
- .accessibilityAddTraits(.isHeader)
- Text("You can close this window. Processing will continue.")
- .font(self.theme.typography.bodySmall)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
- }
-
- FluidManagementGroup(title: self.session.title) {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.lg) {
- ForEach(Array(self.stages.enumerated()), id: \.element) { index, stage in
- HStack(spacing: self.theme.metrics.spacing.md) {
- Image(systemName: self.icon(for: stage, index: index))
- .foregroundStyle(self.color(for: stage, index: index))
- .frame(width: 20)
- Text(Self.title(for: stage))
- .font(self.theme.typography.body)
- Spacer()
- }
- .accessibilityElement(children: .combine)
- .accessibilityLabel("\(Self.title(for: stage)), \(self.accessibilityStatus(for: stage, index: index))")
- }
- }
- }
-
- Label("Processing on this Mac", systemImage: "lock")
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
- }
-
- private var activeIndex: Int {
- self.stages.firstIndex(of: self.stage) ?? 0
- }
-
- private func icon(for stage: MeetingProcessingStage, index: Int) -> String {
- if self.stage == .completed || index < self.activeIndex { return "checkmark.circle.fill" }
- if stage == self.stage { return "circle.dotted" }
- return "circle"
- }
-
- private func color(for stage: MeetingProcessingStage, index: Int) -> Color {
- if self.stage == .completed || index < self.activeIndex { return self.theme.palette.success }
- if stage == self.stage { return self.theme.palette.accent }
- return self.theme.palette.tertiaryText
- }
-
- private func accessibilityStatus(for stage: MeetingProcessingStage, index: Int) -> String {
- if self.stage == .completed || index < self.activeIndex { return "complete" }
- if stage == self.stage { return "in progress" }
- return "waiting"
- }
-
- private static func title(for stage: MeetingProcessingStage) -> String {
- switch stage {
- case .pending: return "Waiting"
- case .saving: return "Saving"
- case .identifyingSpeakers: return "Identifying speakers"
- case .transcribing: return "Transcribing"
- case .finalizing: return "Finalizing"
- case .completed: return "Complete"
- }
- }
-}
-
-/// Escape also dismisses: viewing a past meeting is a detail view, not a mode.
-private struct MeetingCloseTranscriptButton: View {
- let action: () -> Void
-
- var body: some View {
- Button("Close", systemImage: "xmark") { self.action() }
- .labelStyle(.iconOnly)
- .buttonStyle(.borderless)
- .keyboardShortcut(.cancelAction)
- .help("Close this transcript")
- .accessibilityLabel("Close transcript")
- }
-}
-
-private struct MeetingResultCanvas: View {
- let session: MeetingSession
- let isQuiescent: Bool
- let canUndo: Bool
- @State private var showsProbableEchoes = false
- let onCopyTranscript: (MeetingSession, Bool) -> Void
- let onExportTranscript: (MeetingSession, MeetingTranscriptExportFormat, Bool) -> Void
- let onReassignSegment: (MeetingTranscriptSegmentID, SessionSpeakerID) -> Void
- let onNameUnknownSegment: (MeetingTranscriptSegmentID, String) -> Void
- let onRenameSpeaker: (SessionSpeakerID, String) -> Void
- let onMergeSpeakers: (SessionSpeakerID, SessionSpeakerID) -> Void
- let onUndo: () -> Void
- let onRenameSession: (String) -> Void
- let onAssignSpeakers: ([SessionSpeakerID: String]) async -> String?
- let onClose: (() -> Void)?
-
- @Environment(\.theme) private var theme
- @State private var pendingRenameSpeaker: MeetingSessionSpeaker?
- @State private var pendingRenameText = ""
- @State private var pendingNameUnknownSegmentID: MeetingTranscriptSegmentID?
- @State private var pendingUnknownSpeakerName = ""
- @State private var isRenamingSession = false
- @State private var pendingRenameSessionText = ""
- @State private var isShowingAssignSpeakers = false
- @State private var assignSpeakersFocus: SessionSpeakerID?
- @State private var copied = false
- @State private var copyRevision = 0
-
- /// Naming is reached by clicking a speaker's name, so the sheet opens on the one clicked.
- private func presentAssignSpeakers(focusing speakerID: SessionSpeakerID?) {
- guard self.isQuiescent, !self.session.activeSpeakers.isEmpty else { return }
- self.assignSpeakersFocus = speakerID
- self.isShowingAssignSpeakers = true
- }
-
- private var speakerNames: [SessionSpeakerID: String] {
- Dictionary(uniqueKeysWithValues: self.session.activeSpeakers.map { ($0.id, $0.displayName) })
- }
-
- private func chipTint(for speaker: MeetingSessionSpeaker) -> Color? {
- speaker.isLocalUser ? self.theme.palette.accent : self.speakerTints[speaker.id]
- }
-
- private var speakerTints: [SessionSpeakerID: Color] {
- MeetingSpeakerPalette.tints(for: self.session.activeSpeakers)
- }
-
- private var hasEchoSegments: Bool {
- self.session.transcriptSegments.contains(where: \.isEcho)
- }
-
- /// Single projection so shown and copied never disagree.
- private func visibleSegments(sorted: [MeetingTranscriptSegment]) -> [MeetingTranscriptSegment] {
- self.showsProbableEchoes ? sorted : sorted.filter { !$0.isEcho }
- }
-
- /// Sorted once with per-row display state — no per-row re-sorting. Compares the resolved
- /// displayed label (not the raw speaker id) so consecutive nil-speaker rows in different
- /// attribution states — e.g. `unassigned` then `timingUncertain` — each still show a label.
- private func rows(
- for visibleSegments: [MeetingTranscriptSegment]
- ) -> [(segment: MeetingTranscriptSegment, showsLabel: Bool, isLocal: Bool)] {
- let speakerNames = self.speakerNames
- var previousLabelIdentity: String?
- return visibleSegments.map { segment in
- let labelIdentity = MeetingTranscriptExporter.speakerLabelIdentity(
- for: segment,
- in: self.session,
- speakerNames: speakerNames
- )
- let showsLabel = labelIdentity != previousLabelIdentity
- previousLabelIdentity = labelIdentity
- return (segment, showsLabel, self.isLocalSegment(segment))
- }
- }
-
- var body: some View {
- let speakerNames = self.speakerNames
- let sorted = self.session.transcriptSegments.sorted { $0.start.seconds < $1.start.seconds }
- let visibleSegments = self.visibleSegments(sorted: sorted)
- let visibleSpeakerIDs = Set(visibleSegments.compactMap(\.speakerID))
- let activeSpeakers = self.session.activeSpeakers.filter { visibleSpeakerIDs.contains($0.id) }
- let rows = self.rows(for: visibleSegments)
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
- HStack(alignment: .firstTextBaseline) {
- Text(self.session.title)
- .font(self.theme.typography.title)
- .contextMenu {
- Button("Rename…", systemImage: "pencil") {
- self.pendingRenameSessionText = self.session.title
- self.isRenamingSession = true
- }
- }
- Spacer()
- if self.hasEchoSegments {
- Toggle("Show probable echo", isOn: self.$showsProbableEchoes)
- .toggleStyle(.checkbox)
- .font(self.theme.typography.caption)
- }
- Label(self.statusText, systemImage: self.statusIcon)
- .font(self.theme.typography.badge)
- .foregroundStyle(self.statusColor)
- if let onClose {
- MeetingCloseTranscriptButton(action: onClose)
- }
- }
-
- ViewThatFits(in: .horizontal) {
- HStack(spacing: self.theme.metrics.spacing.lg) {
- self.meetingMetadata
- }
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- self.meetingMetadata
- }
- }
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
-
- if !activeSpeakers.isEmpty {
- ScrollView(.horizontal, showsIndicators: false) {
- HStack(spacing: self.theme.metrics.spacing.sm) {
- ForEach(activeSpeakers) { speaker in
- MeetingSpeakerChip(
- title: self.displayName(for: speaker),
- systemImage: speaker.isLocalUser
- ? "person.crop.circle.badge.checkmark" : "person.crop.circle",
- tint: self.chipTint(for: speaker) ?? self.theme.palette.primaryText,
- action: { self.presentAssignSpeakers(focusing: speaker.id) }
- )
- .disabled(!self.isQuiescent)
- .contextMenu { self.speakerChipMenu(for: speaker) }
- }
- }
- }
- }
-
- ViewThatFits(in: .horizontal) {
- HStack(spacing: self.theme.metrics.spacing.sm) { self.transcriptActions(hasText: !visibleSegments.isEmpty) }
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) { self.transcriptActions(hasText: !visibleSegments.isEmpty) }
- }
-
- Divider().opacity(0.4)
-
- if visibleSegments.isEmpty {
- ContentUnavailableView(
- "No transcript text",
- systemImage: "waveform.slash",
- description: Text(self.session.hasRetryableAudio
- ? "The recording is available if you need to retry processing."
- : "There is no transcript text available for this meeting.")
- )
- .frame(maxWidth: .infinity, minHeight: 180)
- } else {
- ScrollView {
- LazyVStack(alignment: .leading, spacing: self.theme.metrics.spacing.xl) {
- ForEach(rows, id: \.segment.id) { row in
- MeetingTranscriptSegmentRow(
- segment: row.segment,
- speakerName: MeetingTranscriptExporter.speakerLabel(
- for: row.segment,
- in: self.session,
- speakerNames: speakerNames
- ),
- speakerTint: row.segment.speakerID.flatMap { self.speakerTints[$0] },
- onRenameSpeakerTapped: {
- if let speakerID = row.segment.speakerID {
- self.presentAssignSpeakers(focusing: speakerID)
- } else {
- self.pendingNameUnknownSegmentID = row.segment.id
- self.pendingUnknownSpeakerName = ""
- }
- },
- isLocalUser: row.isLocal,
- showsSpeakerLabel: row.showsLabel,
- reassignTargets: activeSpeakers.filter { $0.id != row.segment.speakerID },
- isQuiescent: self.isQuiescent,
- onReassign: { speakerID in self.onReassignSegment(row.segment.id, speakerID) }
- )
- }
- }
- .frame(maxWidth: 760)
- .frame(maxWidth: .infinity)
- .padding(.vertical, self.theme.metrics.spacing.lg)
- }
- .id(self.session.id)
- }
- }
- .task(id: self.copyRevision) {
- guard self.copied else { return }
- do { try await Task.sleep(for: .seconds(2)) } catch { return }
- self.copied = false
- }
- .alert(
- "Rename Speaker",
- isPresented: Binding(
- get: { self.pendingRenameSpeaker != nil },
- set: { if !$0 { self.pendingRenameSpeaker = nil } }
- )
- ) {
- TextField("Speaker name", text: self.$pendingRenameText)
- Button("Cancel", role: .cancel) { self.pendingRenameSpeaker = nil }
- Button("Rename") {
- if let speaker = self.pendingRenameSpeaker {
- self.onRenameSpeaker(speaker.id, self.pendingRenameText)
- }
- self.pendingRenameSpeaker = nil
- }
- } message: {
- Text("Enter a new name for this speaker.")
- }
- .alert(
- "Name Unknown Speaker",
- isPresented: Binding(
- get: { self.pendingNameUnknownSegmentID != nil },
- set: { if !$0 { self.pendingNameUnknownSegmentID = nil } }
- )
- ) {
- TextField("Speaker name", text: self.$pendingUnknownSpeakerName)
- Button("Cancel", role: .cancel) { self.pendingNameUnknownSegmentID = nil }
- Button("Save") {
- if let segmentID = self.pendingNameUnknownSegmentID {
- self.onNameUnknownSegment(segmentID, self.pendingUnknownSpeakerName)
- }
- self.pendingNameUnknownSegmentID = nil
- }
- } message: {
- Text("This name applies only to this transcript turn.")
- }
- .alert("Rename Meeting", isPresented: self.$isRenamingSession) {
- TextField("Meeting title", text: self.$pendingRenameSessionText)
- Button("Cancel", role: .cancel) {}
- Button("Rename") { self.onRenameSession(self.pendingRenameSessionText) }
- } message: {
- Text("Enter a new title for this meeting.")
- }
- // Prevents an echo toggle left on for one meeting from leaking into the next.
- .onChange(of: self.session.id) { _, _ in
- self.copied = false
- self.showsProbableEchoes = false
- self.isShowingAssignSpeakers = false
- self.pendingNameUnknownSegmentID = nil
- }
- .sheet(isPresented: self.$isShowingAssignSpeakers) {
- MeetingAssignSpeakersSheet(
- speakers: self.session.activeSpeakers,
- quotesBySpeaker: Dictionary(uniqueKeysWithValues: self.session.activeSpeakers.map {
- ($0.id, MeetingAssignSpeakersQuoteSource.sampleQuotes(for: $0.id, in: self.session.transcriptSegments))
- }),
- tints: self.speakerTints,
- accentColor: self.theme.palette.accent,
- focusedSpeakerID: self.assignSpeakersFocus,
- onSave: self.onAssignSpeakers,
- onCancel: { self.isShowingAssignSpeakers = false }
- )
- }
- }
-
- @ViewBuilder private func transcriptActions(hasText: Bool) -> some View {
- Button(self.copied ? "Copied" : "Copy transcript", systemImage: self.copied ? "checkmark" : "doc.on.doc") {
- self.onCopyTranscript(self.session, self.showsProbableEchoes)
- self.copied = true
- self.copyRevision += 1
- }
- .fluidGlassAction(prominent: true, spacious: true)
- .disabled(!hasText)
- Menu("Export", systemImage: "square.and.arrow.up") {
- Button("Text…") { self.onExportTranscript(self.session, .text, self.showsProbableEchoes) }
- Button("JSON…") { self.onExportTranscript(self.session, .json, self.showsProbableEchoes) }
- }
- .fluidGlassAction(spacious: true)
- .disabled(!hasText)
- Button("Undo correction", systemImage: "arrow.uturn.backward", action: self.onUndo)
- .fluidGlassAction(spacious: true)
- .disabled(!self.canUndo || !self.isQuiescent)
- }
-
- @ViewBuilder
- private func speakerChipMenu(for speaker: MeetingSessionSpeaker) -> some View {
- Button("Rename…", systemImage: "pencil") {
- self.pendingRenameSpeaker = speaker
- self.pendingRenameText = speaker.displayName
- }
- .disabled(!self.isQuiescent)
- if !speaker.isLocalUser {
- let eligibleTargets = self.session.activeSpeakers.filter {
- $0.id != speaker.id && !$0.isLocalUser && $0.trackKind == speaker.trackKind
- }
- if !eligibleTargets.isEmpty {
- Menu("Merge into") {
- ForEach(eligibleTargets) { target in
- Button(target.displayName) {
- self.onMergeSpeakers(speaker.id, target.id)
- }
- }
- }
- .disabled(!self.isQuiescent)
- }
- }
- }
-
- private func displayName(for speaker: MeetingSessionSpeaker) -> String {
- guard speaker.isLocalUser,
- speaker.displayName.caseInsensitiveCompare("You") != .orderedSame
- else {
- return speaker.displayName
- }
- return "\(speaker.displayName) (You)"
- }
-
- // Only explicitly persisted legacy ownership metadata receives the local-user treatment.
- private func isLocalSegment(_ segment: MeetingTranscriptSegment) -> Bool {
- guard let speakerID = segment.speakerID,
- let speaker = self.session.speakers.first(where: { $0.id == speakerID })
- else { return false }
- return speaker.isLocalUser
- }
-
- @ViewBuilder
- private var meetingMetadata: some View {
- Label(
- self.session.startedAt.formatted(date: .abbreviated, time: .shortened),
- systemImage: "calendar"
- )
- Label(Self.durationText(self.session.duration), systemImage: "clock")
- Label(self.sourceName, systemImage: self.session.mode == .onlineCall ? "macwindow" : "person.3")
- Label(self.session.selectedMicrophone.displayName, systemImage: "mic")
- }
-
- private var sourceName: String {
- self.session.capturedApplication?.displayName ?? "In-room meeting"
- }
-
- private var statusText: String {
- switch self.session.state {
- case .completed: "Completed"
- case .failed: "Failed"
- case .interrupted: "Interrupted"
- case .processing: "Processing"
- case .recording, .recordingDegraded, .preparing, .stopping: "Recording"
- }
- }
-
- private var statusIcon: String {
- switch self.session.state {
- case .completed: "checkmark.circle.fill"
- case .failed: "xmark.circle.fill"
- case .interrupted: "exclamationmark.circle.fill"
- case .processing: "ellipsis.circle.fill"
- case .recording, .recordingDegraded, .preparing, .stopping: "record.circle.fill"
- }
- }
-
- private var statusColor: Color {
- switch self.session.state {
- case .completed: self.theme.palette.success
- case .failed: Color(nsColor: .systemRed)
- case .interrupted: self.theme.palette.warning
- case .processing: self.theme.palette.accent
- case .recording, .recordingDegraded, .preparing, .stopping: self.theme.palette.warning
- }
- }
-
- private static func durationText(_ duration: TimeInterval) -> String {
- let total = max(0, Int(duration.rounded(.down)))
- let hours = total / 3600
- let minutes = (total % 3600) / 60
- let seconds = total % 60
- if hours > 0 {
- return String(format: "%d:%02d:%02d", hours, minutes, seconds)
- }
- return String(format: "%d:%02d", minutes, seconds)
- }
-}
-
-private struct MeetingFailureCanvas: View {
- let session: MeetingSession?
- let message: String
- let isRetrying: Bool
- let onRetrySession: (MeetingSession) -> Void
- let onRevealAudio: (MeetingSession) -> Void
- let onRecordAgain: (MeetingSession) -> Void
- let onClose: (() -> Void)?
-
- @Environment(\.theme) private var theme
-
- private var hasRecoverableAudio: Bool {
- self.session?.hasRetryableAudio == true
- }
-
- private var title: String {
- guard let session else { return "Meeting setup failed" }
- let lastFailureDomain = session.failures.last?.domain
- if lastFailureDomain == .processing ||
- (session.state == .interrupted && !session.processingAttempts.isEmpty)
- {
- return session.state == .interrupted
- ? "Meeting transcription was interrupted"
- : "Meeting transcription failed"
- }
- if self.hasRecoverableAudio {
- return session.state == .interrupted
- ? "Meeting recording was interrupted"
- : "Meeting recording failed"
- }
- return "Meeting setup failed"
- }
-
- var body: some View {
- FluidManagementGroup(title: self.session?.title ?? "Recording setup") {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.lg) {
- HStack(alignment: .firstTextBaseline) {
- Label(self.title, systemImage: "exclamationmark.triangle.fill")
- .font(self.theme.typography.sectionTitle)
- .foregroundStyle(self.theme.palette.warning)
- .accessibilityAddTraits(.isHeader)
- Spacer(minLength: 0)
- if let onClose {
- MeetingCloseTranscriptButton(action: onClose)
- }
- }
- Text(self.message)
- .font(self.theme.typography.body)
- .textSelection(.enabled)
- if self.hasRecoverableAudio {
- Text("The captured audio has been preserved on this Mac.")
- .font(self.theme.typography.bodySmall)
- .foregroundStyle(self.theme.palette.secondaryText)
- }
- HStack(spacing: self.theme.metrics.spacing.sm) {
- if let session, self.hasRecoverableAudio {
- Button("Reveal Audio", systemImage: "folder", action: { self.onRevealAudio(session) })
- .fluidButton(.compact, size: .medium)
- Button(action: { self.onRetrySession(session) }) {
- if self.isRetrying {
- HStack(spacing: self.theme.metrics.spacing.sm) {
- ProgressView().controlSize(.small)
- Text("Retrying…")
- }
- } else {
- Label("Retry Transcription", systemImage: "arrow.clockwise")
- }
- }
- .fluidButton(.accent, size: .medium)
- .disabled(self.isRetrying)
- }
- if let session {
- Button("Record Again", systemImage: "arrow.counterclockwise.circle") {
- self.onRecordAgain(session)
- }
- .fluidButton(.compact, size: .medium)
- }
- }
- }
- }
- }
-}
-
-private struct MeetingAdaptiveSetupRow<Content: View>: View {
- let title: String
- var detail: String?
- let trailingSwitch: Bool
- @ViewBuilder let content: Content
-
- @Environment(\.theme) private var theme
-
- init(
- title: String,
- detail: String? = nil,
- trailingSwitch: Bool = false,
- @ViewBuilder content: () -> Content
- ) {
- self.title = title
- self.detail = detail
- self.trailingSwitch = trailingSwitch
- self.content = content()
- }
-
- var body: some View {
- Group {
- if self.trailingSwitch {
- HStack(alignment: .center, spacing: self.theme.metrics.spacing.lg) {
- self.label.frame(maxWidth: .infinity, alignment: .leading)
- self.content.fixedSize()
- }
- } else {
- ViewThatFits(in: .horizontal) {
- HStack(alignment: .center, spacing: self.theme.metrics.spacing.lg) {
- self.label
- .frame(width: 220, alignment: .leading)
- self.content
- .frame(maxWidth: .infinity, alignment: .leading)
- }
-
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- self.label
- self.content
- .frame(maxWidth: .infinity, alignment: .leading)
- }
- }
- }
- }
- .frame(maxWidth: .infinity, alignment: .leading)
- .padding(.horizontal, self.theme.metrics.spacing.xs)
- .padding(.vertical, self.theme.metrics.spacing.md)
- }
-
- private var label: some View {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
- Text(self.title)
- .font(self.theme.typography.bodyStrong)
- .foregroundStyle(self.theme.palette.primaryText)
- if let detail {
- Text(detail)
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- .fixedSize(horizontal: false, vertical: true)
- }
- }
- }
-}
-
-private struct MeetingReadyStatus: View {
- let isReady: Bool
- var isWaiting = false
- let title: String
- let detail: String
-
- @Environment(\.theme) private var theme
-
- var body: some View {
- HStack(spacing: self.theme.metrics.spacing.md) {
- Image(systemName: self.isReady ? "checkmark.circle.fill" : (self.isWaiting ? "clock" : "exclamationmark.circle.fill"))
- .foregroundStyle(self.isReady ? self.theme.palette.success : (self.isWaiting ? self.theme.palette.secondaryText : self.theme.palette.warning))
- .accessibilityHidden(true)
VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
Text(self.title)
.font(self.theme.typography.bodyStrong)
@@ -3110,171 +2116,3 @@ private struct MeetingReadyStatus: View {
.accessibilityLabel("\(self.title). \(self.detail)")
}
}
-
-private struct MeetingTrackHealthRow: View {
- let title: String
- let health: MeetingTrackHealth
-
- @Environment(\.theme) private var theme
-
- private var statusText: String {
- switch self.health.status {
- case .waiting: return "Waiting for audio"
- case .healthy: return "Healthy"
- case .degraded: return self.health.detail ?? "Audio source degraded"
- case .unavailable: return self.health.detail ?? "Audio source unavailable"
- case .stopped: return "Stopped"
- }
- }
-
- private var isHealthy: Bool {
- self.health.status == .healthy
- }
-
- var body: some View {
- HStack(spacing: self.theme.metrics.spacing.md) {
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.xs) {
- Text(self.title)
- .font(self.theme.typography.bodyStrong)
- Text(self.statusText)
- .font(self.theme.typography.caption)
- .foregroundStyle(self.theme.palette.secondaryText)
- .lineLimit(2)
- }
-
- Spacer()
-
- ProgressView(value: min(max(Double(self.health.level), 0), 1))
- .progressViewStyle(.linear)
- .frame(width: 80)
- .accessibilityLabel("\(self.title) level")
-
- Label(
- self.statusText,
- systemImage: self.isHealthy ? "checkmark.circle.fill" : "exclamationmark.circle.fill"
- )
- .labelStyle(.iconOnly)
- .foregroundStyle(self.isHealthy ? self.theme.palette.success : self.theme.palette.warning)
- .accessibilityLabel(self.statusText)
- }
- }
-}
-
-private struct MeetingSpeakerChip: View {
- let title: String
- let systemImage: String
- let tint: Color
- let action: () -> Void
-
- @Environment(\.theme) private var theme
- @Environment(\.isEnabled) private var isEnabled
- @State private var isHovering = false
-
- var body: some View {
- Button(action: self.action) {
- HStack(spacing: 3) {
- Label(self.title, systemImage: self.systemImage)
- Image(systemName: "chevron.right")
- .font(.fluidSystem(size: 9, weight: .semibold))
- .opacity(self.isHovering ? 1 : 0.45)
- }
- .font(self.theme.typography.badge)
- .foregroundStyle(self.tint)
- .padding(.horizontal, self.theme.metrics.spacing.md)
- .padding(.vertical, self.theme.metrics.spacing.sm)
- .background(self.tint.opacity(self.isHovering ? 0.20 : 0.12), in: Capsule())
- .overlay(Capsule().strokeBorder(self.tint.opacity(self.isHovering ? 0.45 : 0.22)))
- }
- .buttonStyle(.plain)
- .help("Rename this speaker")
- .accessibilityLabel("Rename \(self.title)")
- .pointerStyle(self.isEnabled ? .link : nil)
- .onHover { self.isHovering = self.isEnabled && $0 }
- }
-}
-
-private struct MeetingTranscriptSegmentRow: View {
- let segment: MeetingTranscriptSegment
- let speakerName: String
- let speakerTint: Color?
- let onRenameSpeakerTapped: (() -> Void)?
- let isLocalUser: Bool
- let showsSpeakerLabel: Bool
- let reassignTargets: [MeetingSessionSpeaker]
- let isQuiescent: Bool
- let onReassign: (SessionSpeakerID) -> Void
-
- @Environment(\.theme) private var theme
- @State private var isHoveringSpeaker = false
-
- var body: some View {
- HStack(alignment: .top, spacing: self.theme.metrics.spacing.lg) {
- Text(MeetingTranscriptExporter.timestampText(self.segment.start.seconds))
- .font(self.theme.typography.codeCaption)
- .foregroundStyle(self.theme.palette.secondaryText)
- .frame(width: 58, alignment: .leading)
- .padding(.top, 2)
- VStack(alignment: .leading, spacing: self.theme.metrics.spacing.sm) {
- if self.showsSpeakerLabel { self.speakerLabel }
- Text(self.segment.text)
- .font(self.theme.typography.body)
- .foregroundStyle(self.theme.palette.primaryText)
- .lineSpacing(5)
- .textSelection(.enabled)
- .frame(maxWidth: .infinity, alignment: .leading)
- if self.segment.isEcho {
- Text("Probable echo").font(self.theme.typography.caption).foregroundStyle(.secondary)
- }
- }
- }
- .opacity(self.segment.isEcho ? 0.6 : 1)
- .contextMenu {
- Menu("Reassign to") {
- ForEach(self.reassignTargets) { target in
- Button(target.displayName) {
- self.onReassign(target.id)
- }
- }
- }
- .disabled(!self.isQuiescent)
- }
- .accessibilityElement(children: .combine)
- .accessibilityLabel(
- "\(MeetingTranscriptExporter.timestampText(self.segment.start.seconds)), \(self.speakerName), \(self.segment.text)"
- )
- }
-
- private var speakerLabel: some View {
- let name = Text(self.speakerName)
- .foregroundColor(self.nameColor)
- .fontWeight(.semibold)
- .font(self.theme.typography.bodySmallStrong)
-
- return HStack(spacing: 8) {
- if let onRenameSpeakerTapped = self.onRenameSpeakerTapped {
- Button(action: onRenameSpeakerTapped) {
- HStack(spacing: 3) {
- name
- // Always shown, not hover-only, so the affordance survives an unfocused window.
- Image(systemName: "chevron.right")
- .font(.fluidSystem(size: 10, weight: .semibold))
- .foregroundColor(self.nameColor)
- .opacity(self.isHoveringSpeaker ? 1 : 0.45)
- }
- }
- .buttonStyle(.plain)
- // No .help here: the tooltip lands on top of the turn's first line of text.
- .accessibilityLabel("Rename \(self.speakerName)")
- .pointerStyle(.link)
- .onHover { self.isHoveringSpeaker = $0 }
- } else {
- name
- }
- }
- }
-
- private var nameColor: Color {
- if self.isLocalUser { return self.theme.palette.accent }
- return self.speakerTint ?? self.theme.palette.tertiaryText
- }
-}
diff --git a/Sources/Fluid/UI/MeetingWorkspaceComponents.swift b/Sources/Fluid/UI/MeetingWorkspaceComponents.swift
new file mode 100644
index 00000000..e9f55e46
--- /dev/null
+++ b/Sources/Fluid/UI/MeetingWorkspaceComponents.swift
@@ -0,0 +1,169 @@
+import SwiftUI
+
+/// Pointer-only feedback; overlays never change geometry or intercept the native control.
+struct MeetingHoverHighlight: View {
+ @Environment(\.theme) private var theme
+ @Environment(\.isEnabled) private var isEnabled
+ let isHovered: Bool
+ let cornerRadius: CGFloat
+ let reduceMotion: Bool
+
+ var body: some View {
+ let highlighted = self.isHovered && self.isEnabled
+ RoundedRectangle(cornerRadius: self.cornerRadius, style: .continuous)
+ .fill(self.theme.palette.primaryText.opacity(0.08))
+ .opacity(highlighted ? 1 : 0)
+ .animation(self.reduceMotion ? nil : .easeOut(duration: 0.14), value: highlighted)
+ .allowsHitTesting(false)
+ .accessibilityHidden(true)
+ }
+}
+
+private struct MeetingHoverFeedback: ViewModifier {
+ @Environment(\.isEnabled) private var isEnabled
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
+ @State private var isHovered = false
+ let cornerRadius: CGFloat
+
+ func body(content: Content) -> some View {
+ content
+ .overlay {
+ MeetingHoverHighlight(isHovered: self.isHovered, cornerRadius: self.cornerRadius, reduceMotion: self.reduceMotion)
+ }
+ .onHover { self.isHovered = $0 && self.isEnabled }
+ .onChange(of: self.isEnabled) { _, enabled in
+ if !enabled { self.isHovered = false }
+ }
+ .onDisappear { self.isHovered = false }
+ }
+}
+
+extension View {
+ func meetingHoverFeedback(cornerRadius: CGFloat = 1000) -> some View {
+ self.modifier(MeetingHoverFeedback(cornerRadius: cornerRadius))
+ }
+
+ func meetingGlassAction(prominent: Bool = false, circular: Bool = false, tone: Color? = nil, spacious: Bool = false) -> some View {
+ self.fluidGlassAction(prominent: prominent, circular: circular, tone: tone, spacious: spacious)
+ .meetingHoverFeedback()
+ }
+}
+
+enum MeetingDocumentSection: Hashable {
+ case transcript
+ case summary
+}
+
+/// Meeting titles use the system's editorial face; controls retain the app's native type.
+struct MeetingDocumentTitle: View {
+ let title: String
+ @Environment(\.theme) private var theme
+
+ var body: some View {
+ Text(self.title)
+ .font(.system(.largeTitle, design: .serif).weight(.medium))
+ .foregroundStyle(self.theme.palette.primaryText)
+ .fixedSize(horizontal: false, vertical: true)
+ .accessibilityAddTraits(.isHeader)
+ }
+}
+
+/// Document navigation, deliberately quieter than the primary recording action.
+struct MeetingDocumentTabs: View {
+ @Binding var selection: MeetingDocumentSection
+ var primaryTitle = "Transcript"
+ var primaryIcon = "text.alignleft"
+ var isEnabled = true
+ @Environment(\.theme) private var theme
+
+ var body: some View {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ self.tab(self.primaryTitle, section: .transcript, icon: self.primaryIcon)
+ self.tab("Meet Summary", section: .summary, icon: "sparkles")
+ Spacer(minLength: 0)
+ }
+ .overlay(alignment: .bottom) {
+ // Divider inherits its axis from the surrounding layout, including the toolbar's HStack.
+ Rectangle()
+ .fill(self.theme.palette.separator)
+ .frame(height: 1)
+ .allowsHitTesting(false)
+ .accessibilityHidden(true)
+ }
+ .disabled(!self.isEnabled)
+ .accessibilityElement(children: .contain)
+ .accessibilityLabel("Meeting document views")
+ }
+
+ private func tab(_ title: String, section: MeetingDocumentSection, icon: String) -> some View {
+ Button { self.selection = section } label: {
+ HStack(spacing: self.theme.metrics.spacing.sm) {
+ Image(systemName: icon)
+ Text(title)
+ if section == .summary {
+ Text("Soon")
+ .font(self.theme.typography.captionSmall)
+ .opacity(0.7)
+ }
+ }
+ .font(self.theme.typography.bodySmallStrong)
+ .frame(height: 20)
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(MeetingDocumentTabButtonStyle(isSelected: self.selection == section))
+ .accessibilityLabel(section == .summary ? "Meet Summary, coming soon" : title)
+ .accessibilityAddTraits(self.selection == section ? .isSelected : [])
+ }
+}
+
+/// A quiet document tab: rounded pointer feedback above a stable selection underline.
+private struct MeetingDocumentTabButtonStyle: ButtonStyle {
+ let isSelected: Bool
+
+ func makeBody(configuration: Configuration) -> some View {
+ TabBody(configuration: configuration, isSelected: self.isSelected)
+ }
+
+ private struct TabBody: View {
+ let configuration: ButtonStyleConfiguration
+ let isSelected: Bool
+ @Environment(\.theme) private var theme
+ @Environment(\.isEnabled) private var isEnabled
+ @Environment(\.accessibilityReduceMotion) private var reduceMotion
+ @State private var isHovered = false
+
+ var body: some View {
+ let highlighted = self.isEnabled && (self.isHovered || self.configuration.isPressed)
+ self.configuration.label
+ .foregroundStyle(self.isSelected || highlighted ? self.theme.palette.primaryText : self.theme.palette.secondaryText)
+ .padding(.horizontal, self.theme.metrics.spacing.md)
+ .frame(height: FluidButtonSize.medium.controlHeight)
+ .background {
+ Capsule()
+ .fill(self.theme.palette.elevatedCardBackground)
+ .overlay { Capsule().strokeBorder(self.theme.palette.separator.opacity(0.5), lineWidth: 1) }
+ .shadow(color: .black.opacity(0.12), radius: 3, y: 1)
+ .opacity(highlighted ? 1 : 0)
+ .allowsHitTesting(false)
+ .accessibilityHidden(true)
+ }
+ .contentShape(Capsule())
+ .padding(.bottom, self.theme.metrics.spacing.sm)
+ .overlay(alignment: .bottom) {
+ Capsule()
+ .fill(self.theme.palette.primaryText)
+ .frame(height: 2)
+ .opacity(self.isSelected ? 1 : 0)
+ .allowsHitTesting(false)
+ .accessibilityHidden(true)
+ }
+ .opacity(self.isEnabled ? 1 : 0.45)
+ .animation(self.reduceMotion ? nil : .easeOut(duration: 0.14), value: highlighted)
+ .onHover { self.isHovered = $0 && self.isEnabled }
+ .onChange(of: self.isEnabled) { _, enabled in
+ if !enabled { self.isHovered = false }
+ }
+ .onDisappear { self.isHovered = false }
+ }
+ }
+}
diff --git a/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swift b/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swift
index e049d059..b04a6af5 100644
--- a/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swift
+++ b/Tests/FluidDictationIntegrationTests/MeetingRecoveryTests.swift
@@ -24,6 +24,7 @@ final class MeetingRecoveryTests: XCTestCase {
}
func testNotesCanvasStatesRenderWithoutInvokingActions() throws {
+ let preferences = MeetingUIPreferences()
var session = self.makeCorrectionSession(state: .completed).session
session.title = "Design review"
session.transcriptSegments[0].text = "The meeting workspace should keep recording sources visible and make the transcript easy to read."
@@ -96,6 +97,255 @@ final class MeetingRecoveryTests: XCTestCase {
}
}
XCTAssertEqual(actionCount, 0, "Rendering must not start capture, persist settings, export or modify a transcript")
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "Rendering must not change saved meeting or audio-device preferences")
+ }
+
+ func testFluidMeetSetupReadinessStatesRenderWithoutSideEffects() throws {
+ let preferences = MeetingUIPreferences()
+ let actions = MeetingUIActionRecorder()
+ let fixture = self.makeMeetingUISetupFixture()
+
+ var waitingDraft = fixture.draft
+ waitingDraft.selectedApplicationID = nil
+
+ var microphoneDenied = fixture.readiness
+ microphoneDenied.microphoneReady = false
+ microphoneDenied.microphoneStatus = "Access denied"
+ microphoneDenied.showMicrophoneSettingsAction = true
+ microphoneDenied.blockingMessage = "Allow microphone access, then refresh sources."
+
+ var meetingAudioDenied = fixture.readiness
+ meetingAudioDenied.meetingAudioReady = false
+ meetingAudioDenied.meetingAudioStatus = "Access required"
+ meetingAudioDenied.showScreenRecordingSettingsAction = true
+ meetingAudioDenied.blockingMessage = "Allow Screen & System Audio access, then refresh sources."
+
+ var modelMissing = fixture.readiness
+ modelMissing.modelReady = false
+ modelMissing.modelStatus = "Load speaker model in Settings"
+ modelMissing.blockingMessage = "Load the supplied speaker separation model in FluidMeet settings before recording."
+
+ var inRoomDraft = fixture.draft
+ inRoomDraft.mode = .inRoom
+ inRoomDraft.selectedApplicationID = nil
+ inRoomDraft.title = "In-room planning session"
+
+ let scenarios: [(String, MeetingTranscriptionSetupDraft, MeetingSetupReadiness)] = [
+ ("setup-ready", fixture.draft, fixture.readiness),
+ ("setup-waiting", waitingDraft, fixture.readiness),
+ ("setup-microphone-denied", fixture.draft, microphoneDenied),
+ ("setup-meeting-audio-denied", fixture.draft, meetingAudioDenied),
+ ("setup-model-missing", fixture.draft, modelMissing),
+ ("setup-in-room", inRoomDraft, fixture.readiness),
+ ]
+ for (name, draft, readiness) in scenarios {
+ for scheme in [ColorScheme.dark, .light] {
+ for width in [CGFloat(520), 1000] {
+ try self.renderMeetingUI(
+ self.meetingUICanvas(draft: draft, readiness: readiness, fixture: fixture, actions: actions),
+ name: name, width: width, scheme: scheme
+ )
+ }
+ }
+ }
+ XCTAssertEqual(actions.count, 0, "Readiness rendering must not invoke actions or write the setup draft")
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "Readiness rendering must not persist settings or change audio routing")
+ }
+
+ func testMeetSummaryComingSoonRendersWithoutChangingPreferences() throws {
+ let preferences = MeetingUIPreferences()
+ for scheme in [ColorScheme.dark, .light] {
+ for width in [CGFloat(520), 1000] {
+ try self.renderMeetingUI(MeetingSummaryComingSoon(), name: "summary-coming-soon", width: width, scheme: scheme)
+ }
+ }
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "The planned summary feature must not change settings")
+ }
+
+ func testFluidMeetDocumentTabBaselineStaysHorizontalInBothStackAxes() throws {
+ let preferences = MeetingUIPreferences()
+ let actions = MeetingUIActionRecorder()
+ let tabWidth: CGFloat = 420
+ for scheme in [ColorScheme.dark, .light] {
+ let base = AppTheme.adaptive(accent: FluidBrandColors.blue, colorScheme: scheme)
+ // Distinct probe colors isolate geometry from text rasterization and native materials.
+ let probeTheme = AppTheme(
+ palette: AppTheme.Palette(
+ windowBackground: base.palette.windowBackground,
+ contentBackground: base.palette.contentBackground,
+ sidebarBackground: base.palette.sidebarBackground,
+ cardBackground: base.palette.cardBackground,
+ elevatedCardBackground: base.palette.elevatedCardBackground,
+ toolbarBackground: base.palette.toolbarBackground,
+ cardBorder: base.palette.cardBorder,
+ separator: Color(red: 1, green: 0, blue: 1),
+ primaryText: Color(red: 0, green: 1, blue: 1),
+ secondaryText: base.palette.secondaryText,
+ tertiaryText: base.palette.tertiaryText,
+ accent: base.palette.accent,
+ warning: base.palette.warning,
+ success: base.palette.success
+ ),
+ typography: base.typography, metrics: base.metrics, materials: base.materials
+ )
+ for section in [MeetingDocumentSection.transcript, .summary] {
+ for horizontal in [true, false] {
+ let tabs = MeetingDocumentTabs(selection: Binding(get: { section }, set: { _ in actions.record() }))
+ .frame(width: tabWidth)
+ let ancestor: AnyView
+ if horizontal {
+ ancestor = AnyView(HStack(spacing: 0) {
+ tabs
+ Color.clear.frame(width: 40, height: 64)
+ })
+ } else {
+ ancestor = AnyView(VStack(spacing: 0) {
+ tabs
+ Color.clear.frame(height: 24)
+ })
+ }
+ let context = "\(horizontal ? "hstack" : "vstack")-\(section)-\(scheme)"
+ let bitmap = try self.renderMeetingUI(
+ ancestor.appTheme(probeTheme), name: "tabs-baseline-\(context)",
+ width: 500, height: 140, scheme: scheme
+ )
+ let scale = CGFloat(bitmap.pixelsWide) / 500
+ // Color-managed capture can shift RGB values; classify hue, not exact pixels.
+ let baseline = try XCTUnwrap(self.meetingUIPixelBounds(in: bitmap) { color, _ in
+ color.alphaComponent > 0.5 && min(color.redComponent, color.blueComponent) - color.greenComponent > 0.3
+ }, "\(context): the document baseline must render")
+ XCTAssertEqual(baseline.width / scale, tabWidth, accuracy: 2, "\(context): baseline must span both tabs, not turn vertical")
+ XCTAssertLessThanOrEqual(baseline.height / scale, 2, "\(context): baseline must stay one point tall, allowing pixel antialiasing")
+ }
+ }
+ }
+ XCTAssertEqual(actions.count, 0, "Layout must not select a document tab")
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "Tab layout must not change meeting or audio-device preferences")
+ }
+
+ func testFluidMeetHoverHighlightRespectsDisabledAndReducedMotionStates() throws {
+ let preferences = MeetingUIPreferences()
+ for scheme in [ColorScheme.dark, .light] {
+ for enabled in [true, false] {
+ for hovered in [true, false] {
+ for reducedMotion in [true, false] {
+ let highlight = MeetingHoverHighlight(isHovered: hovered, cornerRadius: 8, reduceMotion: reducedMotion)
+ .frame(width: 120, height: 36)
+ .disabled(!enabled)
+ let bitmap = try self.renderMeetingUI(
+ highlight,
+ name: "hover-\(enabled)-\(hovered)-\(reducedMotion)",
+ width: 160, height: 80, scheme: scheme
+ )
+ let bounds = self.meetingUIPixelBounds(in: bitmap) { color, _ in color.alphaComponent > 0.01 }
+ if enabled, hovered {
+ let visible = try XCTUnwrap(bounds, "Enabled hover must provide feedback even with Reduce Motion")
+ let scale = CGFloat(bitmap.pixelsWide) / 160
+ XCTAssertEqual(visible.width / scale, 120, accuracy: 1, "Hover must not expand the control")
+ XCTAssertEqual(visible.height / scale, 36, accuracy: 1, "Hover must not change control height")
+ } else {
+ XCTAssertNil(bounds, "Idle and disabled controls must not show a hover highlight")
+ }
+ }
+ }
+ }
+ }
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "Hover rendering must not change settings or audio routing")
+ }
+
+ func testFluidMeetSettingsSectionsRenderWithoutSideEffects() throws {
+ let preferences = MeetingUIPreferences()
+ let actions = MeetingUIActionRecorder()
+ let fixture = self.makeMeetingUISetupFixture()
+ let sections: [(String, MeetingSettingsSection)] = [
+ ("recording", .recording),
+ ("automation", .automation),
+ ("integrations", .integrations),
+ ]
+ for (name, section) in sections {
+ let sheet = MeetingRecordingSettingsSheet(
+ draft: Binding(get: { fixture.draft }, set: { _ in actions.record() }),
+ retentionPolicy: Binding(get: { .days7 }, set: { _ in actions.record() }),
+ applications: fixture.applications,
+ microphones: fixture.microphones,
+ readiness: fixture.readiness,
+ isFirstSetup: false,
+ onRefreshSources: { actions.record() },
+ onOpenMicrophoneSettings: { actions.record() },
+ onOpenScreenRecordingSettings: { actions.record() },
+ onOpenVoiceEngine: { actions.record() },
+ onCancel: { actions.record() },
+ onSave: { actions.record() },
+ initialSection: section
+ )
+ for scheme in [ColorScheme.dark, .light] {
+ try self.renderMeetingUI(sheet, name: "settings-\(name)", width: 820, height: 700, scheme: scheme)
+ }
+ }
+ XCTAssertEqual(actions.count, 0, "Opening settings sections must not save, request permissions, or write draft bindings")
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "Opening settings must not change retention, detection, or audio routing")
+ }
+
+ func testFluidMeetLongTranscriptRendersWithoutSideEffects() throws {
+ let preferences = MeetingUIPreferences()
+ let actions = MeetingUIActionRecorder()
+ let fixture = self.makeMeetingUISetupFixture()
+ let session = self.makeLongMeetingUIResult()
+ let echo = try XCTUnwrap(session.transcriptSegments.first(where: \.isEcho))
+ let visibleText = MeetingTranscriptExporter.text(for: session)
+ XCTAssertFalse(visibleText.contains(echo.text), "Probable echo is hidden from the default transcript output")
+ XCTAssertTrue(MeetingTranscriptExporter.text(for: session, includeEchoes: true).contains(echo.text))
+ XCTAssertTrue(visibleText.contains("Amelia Richardson"))
+ XCTAssertTrue(visibleText.contains("Rafael Moreno"))
+ XCTAssertTrue(visibleText.contains("Unknown speaker"))
+
+ var echoOnly = session
+ echoOnly.title = "Meeting with only probable echo remaining"
+ echoOnly.transcriptSegments = [echo]
+ XCTAssertTrue(MeetingTranscriptExporter.text(for: echoOnly).isEmpty)
+
+ for (name, result) in [("result-long-conversation", session), ("result-echo-only", echoOnly)] {
+ for scheme in [ColorScheme.dark, .light] {
+ for width in [CGFloat(520), 1000] {
+ try self.renderMeetingUI(
+ self.meetingUICanvas(
+ draft: fixture.draft, readiness: fixture.readiness, fixture: fixture,
+ actions: actions, state: .result(result)
+ ),
+ name: name, width: width, scheme: scheme
+ )
+ }
+ }
+ }
+ XCTAssertEqual(actions.count, 0, "Reading a long transcript must not start audio, export, or modify speakers and transcript text")
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "Transcript rendering must not change saved meeting settings or audio routing")
+ }
+
+ func testFluidMeetShortRecordingRendersWithoutSideEffects() throws {
+ let preferences = MeetingUIPreferences()
+ let actions = MeetingUIActionRecorder()
+ let fixture = self.makeMeetingUISetupFixture()
+ var session = self.makeLongMeetingUIResult()
+ session.state = .recording
+ session.startedAt = Date(timeIntervalSinceNow: -94)
+ session.endedAt = nil
+ session.transcriptSegments = []
+ let state = MeetingTranscriptionCanvasState.recording(
+ session: session,
+ trackHealth: [.microphone: .waiting, .applicationAudio: .waiting],
+ liveTranscript: .empty
+ )
+ for scheme in [ColorScheme.dark, .light] {
+ try self.renderMeetingUI(
+ self.meetingUICanvas(
+ draft: fixture.draft, readiness: fixture.readiness, fixture: fixture,
+ actions: actions, state: state
+ ),
+ name: "recording-short-window", width: 520, height: 500, scheme: scheme
+ )
+ }
+ XCTAssertEqual(actions.count, 0, "Rendering recording controls must not start or stop real audio capture")
+ XCTAssertEqual(MeetingUIPreferences(), preferences, "Recording presentation must not change saved settings or audio routing")
}
func testHistoryKeyboardTraversalWalksTheRenderedOrder() {
@@ -112,6 +362,213 @@ final class MeetingRecoveryTests: XCTestCase {
// MARK: - Fixtures
+ @MainActor
+ private final class MeetingUIActionRecorder {
+ var count = 0
+ func record() { self.count += 1 }
+ }
+
+ private struct MeetingUIPreferences: Equatable {
+ let recording: MeetingRecordingDefaults
+ let retention: MeetingAudioRetentionPolicy
+ let nativeDetection: Bool
+ let browserDetection: Bool
+ let inputDeviceUID: String?
+ let outputDeviceUID: String?
+
+ @MainActor
+ init() {
+ let settings = SettingsStore.shared
+ self.recording = settings.meetingRecordingDefaults
+ self.retention = settings.meetingAudioRetentionPolicy
+ self.nativeDetection = settings.meetingAutoDetectEnabled
+ self.browserDetection = settings.meetingAutoDetectBrowserEnabled
+ self.inputDeviceUID = settings.preferredInputDeviceUID
+ self.outputDeviceUID = settings.preferredOutputDeviceUID
+ }
+ }
+
+ private struct MeetingUISetupFixture {
+ let draft: MeetingTranscriptionSetupDraft
+ let applications: [MeetingApplicationOption]
+ let microphones: [MeetingMicrophoneOption]
+ let readiness: MeetingSetupReadiness
+ }
+
+ private func makeMeetingUISetupFixture() -> MeetingUISetupFixture {
+ let application = MeetingApplicationOption(identity: MeetingApplicationIdentity(
+ bundleIdentifier: "us.zoom.xos", processID: 42, displayName: "Zoom Workplace"
+ ))
+ let microphone = MeetingMicrophoneOption(identity: MeetingMicrophoneIdentity(
+ captureDeviceID: "meeting-ui-fixture-microphone", displayName: "MacBook Pro Microphone"
+ ))
+ var draft = MeetingTranscriptionSetupDraft()
+ draft.mode = .onlineCall
+ draft.title = "Product design review and launch planning"
+ draft.titleWasEdited = true
+ draft.selectedApplicationID = application.id
+ draft.usesAutomaticApplication = true
+ draft.selectedMicrophoneID = microphone.id
+ draft.autoDetectEnabled = true
+ draft.browserDetectionEnabled = true
+ return MeetingUISetupFixture(
+ draft: draft,
+ applications: [application],
+ microphones: [microphone],
+ readiness: MeetingSetupReadiness(
+ isCheckingSources: false,
+ meetingAudioStatus: "Ready", meetingAudioReady: true,
+ microphoneStatus: "Ready", microphoneReady: true,
+ modelStatus: "Speaker model installed", modelReady: true,
+ storageStatus: "120 GB available", storageReady: true,
+ activityStatus: "Ready", activityReady: true,
+ showMicrophoneSettingsAction: false,
+ showScreenRecordingSettingsAction: false,
+ blockingMessage: nil
+ )
+ )
+ }
+
+ private func meetingUICanvas(
+ draft: MeetingTranscriptionSetupDraft,
+ readiness: MeetingSetupReadiness,
+ fixture: MeetingUISetupFixture,
+ actions: MeetingUIActionRecorder,
+ state: MeetingTranscriptionCanvasState = .setup(isStarting: false, recentSession: nil)
+ ) -> some View {
+ MeetingTranscriptionCanvas(
+ setupDraft: Binding(get: { draft }, set: { _ in actions.record() }),
+ state: state,
+ applications: fixture.applications,
+ microphones: fixture.microphones,
+ readiness: readiness,
+ errorMessage: nil,
+ onStart: { actions.record() },
+ onStop: { actions.record() },
+ onRetrySession: { _ in actions.record() },
+ onRevealAudio: { _ in actions.record() },
+ onRecordAgain: { _ in actions.record() },
+ onCopyTranscript: { _, _ in actions.record() },
+ onExportTranscript: { _, _, _ in actions.record() },
+ onReassignSegment: { _, _, _ in actions.record() },
+ onNameUnknownSegment: { _, _, _ in actions.record() },
+ onRenameSpeaker: { _, _, _ in actions.record() },
+ onMergeSpeakers: { _, _, _ in actions.record() },
+ onUndoCorrection: { _ in actions.record() },
+ onRenameSession: { _, _ in actions.record() },
+ onAssignSpeakers: { _, _ in actions.record(); return nil },
+ canUndoCorrection: { _ in false },
+ isQuiescent: true,
+ onRepairSetup: { actions.record() },
+ onEditSetup: { actions.record() },
+ isRetrying: false,
+ onCloseSelection: { actions.record() }
+ )
+ }
+
+ private func makeLongMeetingUIResult() -> MeetingSession {
+ var microphone = self.makeMicrophoneTrack(chunks: [])
+ microphone.sourceDisplayName = "MacBook Pro Microphone"
+ var application = self.makeMicrophoneTrack(chunks: [])
+ application.kind = .applicationAudio
+ application.sourceIdentifier = "us.zoom.xos"
+ application.sourceDisplayName = "Zoom Workplace"
+ let startedAt = Date(timeIntervalSince1970: 1_789_996_800)
+ var session = self.makeSession(
+ state: .completed, startedAt: startedAt,
+ endedAt: startedAt.addingTimeInterval(32 * 60 + 18),
+ audioTracks: [microphone, application]
+ )
+ session.title = "Product design review — simplifying the first meeting experience before our autumn launch"
+ session.mode = .onlineCall
+ session.capturedApplication = MeetingApplicationIdentity(bundleIdentifier: "us.zoom.xos", displayName: "Zoom Workplace")
+ session.selectedMicrophone.displayName = microphone.sourceDisplayName
+ session.transcriptTimeDomain = .meetingRelative
+ session.transcriptIsComplete = true
+ let local = self.makeSpeaker(name: "You", isLocalUser: true)
+ let amelia = self.makeSpeaker(name: "Amelia Richardson", trackKind: .applicationAudio)
+ let rafael = self.makeSpeaker(name: "Rafael Moreno", trackKind: .applicationAudio)
+ session.speakers = [local, amelia, rafael]
+
+ let turns: [(MeetingSessionSpeaker?, String)] = [
+ (local, "Let's start with what someone needs in their first thirty seconds. They should know which meeting we are capturing, see that their microphone is ready, and find the recording control without having to read a settings page."),
+ (local, "Once a conversation has finished, the transcript should read like a document. Keep the title and date nearby, but let the words take up most of the space. We can move less common actions into the menu."),
+ (amelia, "I agree. In the interviews, people went back to a meeting because they remembered a decision, not because they wanted to inspect a recording. The first screen should help them recognize the conversation and pick up where they left off."),
+ (rafael, "The longer examples matter here. A one-line transcript looks fine in almost any layout. We need to see what happens with several speakers, names that wrap, and a paragraph that takes more than two lines on a small laptop."),
+ (amelia, "For speaker corrections, I would keep the name close to the passage. If I notice that the wrong person has been assigned, I should be able to fix it there and continue reading without losing my place."),
+ (nil, "Could we also make it clear when the recording contains an overlap that the model cannot confidently assign? An honest unknown label is more useful than attributing the statement to the wrong person."),
+ (local, "Yes. We should preserve uncertain attribution and avoid making the interface look more confident than the transcript is. The correction remains a deliberate action, and the original recording stays available until the retention policy removes it."),
+ (rafael, "For the launch review, I will test the smallest supported window and both appearances. I will also check a meeting that has no readable transcript, so the recovery action is still obvious when someone needs it."),
+ (amelia, "I'll collect three longer conversations for the design review. We should compare the same content each time, including one where the speaker names are much longer than the labels in our initial mockup."),
+ (local, "The next step is to review those examples together on Thursday. We can then decide whether the meeting list, transcript width, and primary actions feel consistent with the rest of the app."),
+ ]
+ session.transcriptSegments = turns.enumerated().map { index, turn in
+ let trackID = turn.0?.isLocalUser == true ? microphone.id : application.id
+ var segment = self.makeTranscriptSegment(sourceTrackID: trackID, speakerID: turn.0?.id)
+ segment.start = MeetingMediaTime(value: Int64(index * 32_000), timescale: 1000)
+ segment.end = MeetingMediaTime(value: Int64(index * 32_000 + 27_000), timescale: 1000)
+ segment.text = turn.1
+ segment.attributionState = turn.0 == nil ? .unassigned : .assigned
+ return segment
+ }
+ var echo = self.makeTranscriptSegment(sourceTrackID: microphone.id, speakerID: local.id)
+ echo.start = MeetingMediaTime(value: 66_000, timescale: 1000)
+ echo.end = MeetingMediaTime(value: 70_000, timescale: 1000)
+ echo.text = "This repeated phrase was captured through the speakers and is marked as probable echo."
+ echo.isLikelyEcho = true
+ echo.attributionState = .assigned
+ session.transcriptSegments.append(echo)
+ return session
+ }
+
+ private func meetingUIPixelBounds(
+ in bitmap: NSBitmapImageRep,
+ matching predicate: (NSColor, Int) -> Bool
+ ) -> CGRect? {
+ var bounds: CGRect?
+ for y in 0..<bitmap.pixelsHigh {
+ for x in 0..<bitmap.pixelsWide {
+ guard let color = bitmap.colorAt(x: x, y: y)?.usingColorSpace(.sRGB), predicate(color, y) else { continue }
+ let pixel = CGRect(x: x, y: y, width: 1, height: 1)
+ bounds = bounds.map { $0.union(pixel) } ?? pixel
+ }
+ }
+ return bounds
+ }
+
+ @discardableResult
+ private func renderMeetingUI<Content: View>(
+ _ content: Content,
+ name: String,
+ width: CGFloat,
+ height: CGFloat = 680,
+ scheme: ColorScheme
+ ) throws -> NSBitmapImageRep {
+ let canvas = content
+ .frame(width: width, height: height)
+ .appTheme(.adaptive(accent: FluidBrandColors.blue, colorScheme: scheme))
+ .environment(\.colorScheme, scheme)
+ let host = NSHostingView(rootView: canvas)
+ let window = NSWindow(
+ contentRect: NSRect(x: 0, y: 0, width: width, height: height),
+ styleMask: [.borderless], backing: .buffered, defer: false
+ )
+ window.isReleasedWhenClosed = false
+ window.appearance = NSAppearance(named: scheme == .dark ? .darkAqua : .aqua)
+ window.contentView = host
+ defer { window.close() }
+ // AppKit-backed scroll views and native menus need hosting-view capture.
+ host.layoutSubtreeIfNeeded()
+ host.displayIfNeeded()
+ let bitmap = try XCTUnwrap(host.bitmapImageRepForCachingDisplay(in: host.bounds), "\(name) must render")
+ host.cacheDisplay(in: host.bounds, to: bitmap)
+ let png = try XCTUnwrap(bitmap.representation(using: .png, properties: [:]))
+ let output = URL(fileURLWithPath: "/tmp/meet-assist-ui-review", isDirectory: true)
+ try FileManager.default.createDirectory(at: output, withIntermediateDirectories: true)
+ try png.write(to: output.appendingPathComponent("\(name)-\(scheme)-\(Int(width)).png"))
+ return bitmap
+ }
+
private func makeTempDirectory() -> URL {
let dir = FileManager.default.temporaryDirectory
.appendingPathComponent("MeetingRecoveryTests-\(UUID().uuidString)", isDirectory: true)