Refined the recording Live Activity presentation in the Widget target.

This commit is contained in:
2026-07-07 00:11:39 +02:00
parent 9e431c8e7a
commit dfd4829980
13 changed files with 281 additions and 163 deletions
@@ -1,5 +1,5 @@
import Commanding
import AppIntents
import Commanding
/// The intent behind the discard button of the recording Live Activity, which throws the recording away.
///
@@ -10,9 +10,14 @@ struct DiscardRecordingIntent: LiveActivityIntent {
// MARK: Constants
static let title: LocalizedStringResource = "Discard Recording"
static let description = IntentDescription("Throws the paused recording away.")
static let openAppWhenRun = false
/// The localized title of the intent, resolved from the widget target's string catalog and shown wherever the system surfaces
/// the intent.
static let title: LocalizedStringResource = "intent.discard-recording.title"
/// The localized description of the intent, resolved from the widget target's string catalog.
static let description = IntentDescription("intent.discard-recording.description")
/// Whether running the intent brings the app to the foreground; `true`, so discarding the recording opens the app from the
/// Live Activity.
static let openAppWhenRun = true
// MARK: Methods
@@ -1,5 +1,5 @@
import Commanding
import AppIntents
import Commanding
/// The intent behind the send button of the recording Live Activity, which sends the paused recording for processing.
///
@@ -10,9 +10,14 @@ struct ProcessRecordingIntent: LiveActivityIntent {
// MARK: Constants
static let title: LocalizedStringResource = "Process Recording"
static let description = IntentDescription("Sends the paused recording for processing.")
static let openAppWhenRun = false
/// The localized title of the intent, resolved from the widget target's string catalog and shown wherever the system surfaces
/// the intent.
static let title: LocalizedStringResource = "intent.processing-recording.title"
/// The localized description of the intent, resolved from the widget target's string catalog.
static let description = IntentDescription("intent.processing-recording.description")
/// Whether running the intent brings the app to the foreground; `true`, so sending the recording for processing opens the app
/// from the Live Activity.
static let openAppWhenRun = true
// MARK: Methods
@@ -1,5 +1,5 @@
import Commanding
import AppIntents
import Commanding
/// The intent behind the main button of the recording Live Activity, which pauses or resumes the recording.
///
@@ -10,8 +10,13 @@ struct ToggleRecordingIntent: LiveActivityIntent {
// MARK: Constants
static let title: LocalizedStringResource = "Pause or Resume Recording"
static let description = IntentDescription("Pauses or resumes the ongoing recording.")
/// The localized title of the intent, resolved from the widget target's string catalog and shown wherever the system surfaces
/// the intent.
static let title: LocalizedStringResource = "intent.toggle-recording.title"
/// The localized description of the intent, resolved from the widget target's string catalog.
static let description = IntentDescription("intent.toggle-recording.description")
/// Whether running the intent brings the app to the foreground; kept `false` so the button acts straight from the Live Activity,
/// in the app's background process, without opening the app.
static let openAppWhenRun = false
// MARK: Methods