diff --git a/Changelog.md b/Changelog.md index 4e17738..9cbd329 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ - Support for `dialDown` and `dialUp` events - ` DisableAutomaticStates` in the Action protocol - `setTriggerDescription` event for SD+ +- `sortName` to provide a custom sort key for actions ## Changed diff --git a/Sources/StreamDeck/StreamDeck Plugin/Action/Action+Support.swift b/Sources/StreamDeck/StreamDeck Plugin/Action/Action+Support.swift index f85d4d5..5930770 100644 --- a/Sources/StreamDeck/StreamDeck Plugin/Action/Action+Support.swift +++ b/Sources/StreamDeck/StreamDeck Plugin/Action/Action+Support.swift @@ -55,6 +55,9 @@ extension EncoderAction { extension Action { // MARK: Defaults + + public static var sortTitle: String { name } + public static var userTitleEnabled: Bool? { nil } public static var propertyInspectorPath: String? { nil } diff --git a/Sources/StreamDeck/StreamDeck Plugin/Action/Action.swift b/Sources/StreamDeck/StreamDeck Plugin/Action/Action.swift index dcf38a5..f3c6cf8 100644 --- a/Sources/StreamDeck/StreamDeck Plugin/Action/Action.swift +++ b/Sources/StreamDeck/StreamDeck Plugin/Action/Action.swift @@ -23,6 +23,12 @@ public protocol Action { /// The name of the action. This string is visible to the user in the actions list. static var name: String { get } + /// A name used for sorting actions in the Stream Deck app. + /// + /// By default this is `name`, but a custom value can be provided to sort + /// and group actions together. + static var sortName: String { get } + /// The unique identifier of the action. /// /// It must be a uniform type identifier (UTI) that contains only lowercase alphanumeric characters (a-z, 0-9), hyphen (-), and period (.).